1 package org.jaxen.javabean; 2 3 import junit.framework.TestCase; 4 import org.jaxen.saxpath.helpers.XPathReaderFactory; 5 6 public class DocumentNavigatorTest 7 extends TestCase 8 { 9 10 protected void setUp() throws Exception 11 { 12 System.setProperty( XPathReaderFactory.DRIVER_PROPERTY, 13 "" ); 14 } 15 16 public void testNothing() 17 throws Exception 18 { 19 JavaBeanXPath xpath = new JavaBeanXPath( "brother[position()<4]/name" ); 20 21 Person bob = new Person( "bob", 30 ); 22 23 bob.addBrother( new Person( "billy", 34 ) ); 24 bob.addBrother( new Person( "seth", 29 ) ); 25 bob.addBrother( new Person( "dave", 32 ) ); 26 bob.addBrother( new Person( "jim", 29 ) ); 27 bob.addBrother( new Person( "larry", 42 ) ); 28 bob.addBrother( new Person( "ted", 22 ) ); 29 30 System.out.println( xpath.evaluate( bob ) ); 31 } 32 33 }