1 /* 2 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. 3 * 4 * This software is open source. 5 * See the bottom of this file for the licence. 6 * 7 * $Id: TestSchemaParse.java,v 1.1 2003/07/07 10:30:29 per_nyfelt Exp $ 8 */ 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.datatype.DatatypeDocumentFactory; 17 import org.dom4j.io.SAXReader; 18 19 20 /** Tests the SchemaParser based on a test case provided by 21 * Luis Peña Sánchez 22 * 23 * @author <a HREF="mailto:jstrachan@apache.org">James Strachan</a> 24 * @version $Revision: 1.1 $ 25 */ 26 public class TestSchemaParse extends test.dom4j.AbstractTestCase { 27 28 public static void main( String[] args ) { 29 TestRunner.run( suite() ); 30 } 31 32 public static Test suite() { 33 return new TestSuite( TestSchemaParse.class ); 34 } 35 36 public TestSchemaParse(String name) { 37 super(name); 38 } 39 40 // Test case(s) 41 //------------------------------------------------------------------------- 42 public void testParseSchema() throws Exception { 43 // todo create an ozone versionof the factory 44 DatatypeDocumentFactory factory = new DatatypeDocumentFactory(); 45 46 SAXReader reader = new SAXReader(); 47 reader.setNodeFactory( factory ); 48 Document schema = reader.read( "xml/test/LuisSchema.xsd" ); 49 factory.loadSchema( schema ); 50 51 log( "Loaded the schema" ); 52 53 // now load an instance document 54 } 55 } 56 57 58 59 60 /* 61 * Redistribution and use of this software and associated documentation 62 * ("Software"), with or without modification, are permitted provided 63 * that the following conditions are met: 64 * 65 * 1. Redistributions of source code must retain copyright 66 * statements and notices. Redistributions must also contain a 67 * copy of this document. 68 * 69 * 2. Redistributions in binary form must reproduce the 70 * above copyright notice, this list of conditions and the 71 * following disclaimer in the documentation and/or other 72 * materials provided with the distribution. 73 * 74 * 3. The name "DOM4J" must not be used to endorse or promote 75 * products derived from this Software without prior written 76 * permission of MetaStuff, Ltd. For written permission, 77 * please contact dom4j-info@metastuff.com. 78 * 79 * 4. Products derived from this Software may not be called "DOM4J" 80 * nor may "DOM4J" appear in their names without prior written 81 * permission of MetaStuff, Ltd. DOM4J is a registered 82 * trademark of MetaStuff, Ltd. 83 * 84 * 5. Due credit should be given to the DOM4J Project 85 * (http://dom4j.org/). 86 * 87 * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS 88 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT 89 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 90 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 91 * METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 92 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 93 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 94 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 95 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 96 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 97 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 98 * OF THE POSSIBILITY OF SUCH DAMAGE. 99 * 100 * Copyright 2001 (C) MetaStuff, Ltd. All Rights Reserved. 101 * 102 * $Id: TestSchemaParse.java,v 1.1 2003/07/07 10:30:29 per_nyfelt Exp $ 103 */ 104