Revision: 50
http://practicalxml.svn.sourceforge.net/practicalxml/?rev=50&view=rev
Author: kmudrick
Date: 2008-12-09 18:54:12 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
New test case
Modified Paths:
--------------
trunk/src/test/java/net/sf/practicalxml/TestSchemaUtil.java
Modified: trunk/src/test/java/net/sf/practicalxml/TestSchemaUtil.java
===================================================================
--- trunk/src/test/java/net/sf/practicalxml/TestSchemaUtil.java 2008-12-09 18:49:48 UTC (rev 49)
+++ trunk/src/test/java/net/sf/practicalxml/TestSchemaUtil.java 2008-12-09 18:54:12 UTC (rev 50)
@@ -41,8 +41,20 @@
public final static String NEW_SCHEMA_FINISH
= "</xsd:schema>";
+
+ public final static String NEW_SCHEMA_WITH_NAMESPACE_START
+ = "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://foo/bar\" xmlns:bar=\"http://foo/bar\" elementFormDefault=\"qualified\">";
+
+ public final static String NEW_SCHEMA_WITH_NAMESPACE_DEF_1
+ = "<xsd:element name=\"foo\" type=\"bar:FooType\"/>";
+
+ public final static String NEW_SCHEMA_WITH_NAMESPACE_DEF_2
+ = "<xsd:complexType name=\"FooType\">"
+ + "<xsd:sequence>"
+ + "<xsd:element name=\"argle\" type=\"xsd:integer\"/>"
+ + "</xsd:sequence>"
+ + "</xsd:complexType>";
-
//----------------------------------------------------------------------------
// Test Cases
//----------------------------------------------------------------------------
@@ -87,4 +99,17 @@
new InputSource(xsd3));
assertNotNull(schema);
}
+
+ public void testNewSchemaWithNamespace() throws Exception
+ {
+ Reader xsd = new StringReader(
+ NEW_SCHEMA_WITH_NAMESPACE_START
+ + NEW_SCHEMA_WITH_NAMESPACE_DEF_1 + NEW_SCHEMA_WITH_NAMESPACE_DEF_2
+ + NEW_SCHEMA_FINISH);
+
+ Schema schema = SchemaUtil.newSchema(
+ SchemaUtil.newFactory(new ExceptionErrorHandler()),
+ new InputSource(xsd));
+ assertNotNull(schema);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|