1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 =
59 JXPathContext.newContext(null, new TestIndexedPropertyBean());
60
61 assertXPathValueAndPointer(
62 context,
63 "indexed[1]",
64 new Integer(0),
65 "/indexed[1]");
66 }
67
68
69 }