1 61 62 63 package org.jaxen.dom; 64 65 import junit.framework.Test; 66 import junit.framework.TestSuite; 67 import junit.textui.TestRunner; 68 69 import javax.xml.parsers.DocumentBuilder ; 70 import javax.xml.parsers.DocumentBuilderFactory ; 71 72 import org.jaxen.Navigator; 73 import org.jaxen.XPathTestBase; 74 75 public class DocumentNavigatorTest extends XPathTestBase 76 { 77 public DocumentNavigatorTest(String name) 78 { 79 super( name ); 80 } 81 82 public static void main(String [] args) 83 { 84 verbose = true; 85 if ( args.length > 0 ) 86 { 87 TESTS_XML = args[0]; 88 } 89 TestRunner.run( suite() ); 90 } 91 92 public static Test suite() 93 { 94 return new TestSuite( DocumentNavigatorTest.class ); 95 } 96 97 public Navigator getNavigator() 98 { 99 return new DocumentNavigator(); 100 } 101 102 public Object getDocument(String url) throws Exception 103 { 104 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 105 factory.setNamespaceAware(true); 106 DocumentBuilder builder = factory.newDocumentBuilder(); 107 108 return builder.parse( url ); 109 } 110 111 112 113 } 114 | Popular Tags |