KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > xml > NamespaceTests


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: NamespaceTests.java,v 1.2 2005/01/26 08:29:25 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.xml;
25 import java.lang.reflect.Method JavaDoc;
26
27 import junit.framework.Test;
28
29 /**
30  * Namespace tests
31  */

32 public class NamespaceTests extends XmlTestCaseBase {
33
34     /** Factory method to create suite of these tests */
35     public static Test suite() {
36         return createSuite(NamespaceTests.class, null);
37     }
38     
39     /** Constructor */
40     public NamespaceTests(Method JavaDoc method) {
41         super(method);
42     }
43
44     /**
45      * Test 1:
46      */

47     public void test1() {
48         XmlBasicTest test
49             = new XmlBasicTest(this, getInputFile("namespace/hor.xml"),
50                                getInputFile("namespace/hor.dtd"));
51         test.basicTest();
52     }
53
54     /**
55      * Test 2:
56      */

57     public void test2() {
58         XmlBasicTest test
59             = new XmlBasicTest(this, getInputFile("namespace/ns-default-attr.xml"),
60                                null);
61         test.basicTest();
62     }
63
64     /**
65      * Test 3:
66      */

67     public void test3() {
68         XmlBasicTest test
69             = new XmlBasicTest(this, getInputFile("namespace/default-override.xml"),
70                                null);
71         test.basicTest();
72     }
73
74     /**
75      * Test 4:
76      */

77     public void test4() {
78         XmlBasicTest test
79             = new XmlBasicTest(this, getInputFile("namespace/prefix-override.xml"),
80                                null);
81         test.basicTest();
82     }
83
84     /**
85      * Test 5: XMLC didn't generate accessors if an element is in a namespace.
86      */

87     public void test5() {
88         //FIXME: verify this works
89
XmlBasicTest test
90             = new XmlBasicTest(this, getInputFile("namespace/nsaccessors.xml"),
91                                getInputFile("namespace/nsaccessors.dtd"));
92         test.basicTest();
93     }
94 }
95
Popular Tags