01: /*
02: * Copyright 1999-2004 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.jxpath.ri.model.beans;
17:
18: import junit.framework.TestSuite;
19:
20: import org.apache.commons.jxpath.AbstractFactory;
21: import org.apache.commons.jxpath.JXPathContext;
22: import org.apache.commons.jxpath.TestBean;
23: import org.apache.commons.jxpath.ri.model.BeanModelTestCase;
24:
25: /**
26: * Tests JXPath with JavaBeans
27: *
28: * @author Dmitri Plotnikov
29: * @version $Revision: 1.7 $ $Date: 2004/02/29 14:17:43 $
30: */
31:
32: public class BeanModelTest extends BeanModelTestCase {
33: /**
34: * Construct a new instance of this test case.
35: *
36: * @param name Name of the test case
37: */
38: public BeanModelTest(String name) {
39: super (name);
40: }
41:
42: /**
43: * Return the tests included in this test suite.
44: */
45: public static TestSuite suite() {
46: return (new TestSuite(BeanModelTest.class));
47: }
48:
49: protected Object createContextBean() {
50: return new TestBean();
51: }
52:
53: protected AbstractFactory getAbstractFactory() {
54: return new TestBeanFactory();
55: }
56:
57: public void testIndexedProperty() {
58: JXPathContext context = JXPathContext.newContext(null,
59: new TestIndexedPropertyBean());
60:
61: assertXPathValueAndPointer(context, "indexed[1]",
62: new Integer(0), "/indexed[1]");
63: }
64:
65: }
|