1 9 10 package test.dom4j.datatype; 11 12 import junit.framework.Test; 13 import junit.framework.TestSuite; 14 import junit.textui.TestRunner; 15 import org.dom4j.Document; 16 import org.dom4j.DocumentFactory; 17 import org.dom4j.datatype.DatatypeDocumentFactory; 18 import org.dom4j.io.SAXReader; 19 20 21 27 public class TestManualSchema extends TestAutoSchema { 28 29 protected static boolean VERBOSE = true; 30 31 public static void main( String [] args ) { 32 TestRunner.run( suite() ); 33 } 34 35 public static Test suite() { 36 return new TestSuite( TestManualSchema.class ); 37 } 38 39 public TestManualSchema(String name) { 40 super(name); 41 } 42 43 44 protected String getDocumentURI() { 47 return "xml/test/schema/personal.xml"; 48 } 49 50 protected DocumentFactory loadDocumentFactory() throws Exception { 51 DatatypeDocumentFactory factory = new DatatypeDocumentFactory(); 53 54 SAXReader reader = new SAXReader(); 55 Document schemaDocument = reader.read( "xml/test/schema/personal.xsd" ); 56 factory.loadSchema( schemaDocument ); 57 return factory; 58 } 59 } 60 61 62 63 64 108 | Popular Tags |