KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > dom4j > datatype > TestManualSchemaPrefix


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: TestManualSchemaPrefix.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.DocumentFactory;
17 import org.dom4j.datatype.DatatypeDocumentFactory;
18 import org.dom4j.io.SAXReader;
19
20
21 /** Test harness for the XML Schema Data Type integration. These tests
22   * manually load the schemas using prefixes in the XSD file.
23   *
24   * @author <a HREF="mailto:jstrachan@apache.org">James Strachan</a>
25   * @version $Revision: 1.1 $
26   */

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

102
Popular Tags