Author: jochen
Date: Fri Sep  8 13:02:15 2006
New Revision: 441628

URL: http://svn.apache.org/viewvc?view=rev&rev=441628
Log:
Added the WSCOMMONS-87 test case.

Added:
    
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/
    
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAux.xsd
    
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAuxNoDefaultNS.xsd
    
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBase.xsd
    
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBaseNoDefaultNS.xsd
Modified:
    
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java

Modified: 
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java?view=diff&rev=441628&r1=441627&r2=441628
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java
 (original)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java
 Fri Sep  8 13:02:15 2006
@@ -16,6 +16,7 @@
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
 import org.apache.ws.commons.schema.XmlSchemaInclude;
+import org.xml.sax.InputSource;
 
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
@@ -132,4 +133,29 @@
         assertNotNull(schemaCol.getTypeByQName(new 
QName("http://tns.demo.org";, "XdwsGroupId")));
        }
 
+    /**
+     * Schema included defined xmlns="http://www.w3.org/2001/XMLSchema";
+     * @throws Exception
+     */
+    public void testSchemaInclude() throws Exception{
+        String uri = Resources.asURI("WSCOMMONS-87/includeBase.xsd");
+        InputSource isource = new InputSource(new FileInputStream(uri));
+        isource.setSystemId(uri);
+        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
+        XmlSchema schema = schemaCol.read(isource, null);
+        assertNotNull(schema);
+    }
+    
+    /**
+     * Schema included does not define xmlns="http://www.w3.org/2001/XMLSchema";
+     * @throws Exception
+     */
+    public void testSchemaIncludeNoDefaultNS() throws Exception{
+        String uri = 
Resources.asURI("WSCOMMONS-87/includeBaseNoDefaultNS.xsd");
+        InputSource isource = new InputSource(new FileInputStream(uri));
+        isource.setSystemId(uri);
+        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
+        XmlSchema schema = schemaCol.read(isource, null);
+        assertNotNull(schema);
+    }
 }

Added: 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAux.xsd
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAux.xsd?view=auto&rev=441628
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAux.xsd
 (added)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAux.xsd
 Fri Sep  8 13:02:15 2006
@@ -0,0 +1,23 @@
+<schema 
+        xmlns="http://www.w3.org/2001/XMLSchema";
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+        xmlns:xs="http://www.w3.org/2001/XMLSchema";
+        xmlns:xsd1="http://soapinterop.org/xsd2";
+        elementFormDefault="qualified">
+        
+    <xs:simpleType name="PaymentCardCodeType">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction base="UpperCaseAlphaLength1to2"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+  
+  <xs:simpleType name="UpperCaseAlphaLength1to2">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Z]{1,2}"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+</schema>

Added: 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAuxNoDefaultNS.xsd
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAuxNoDefaultNS.xsd?view=auto&rev=441628
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAuxNoDefaultNS.xsd
 (added)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeAuxNoDefaultNS.xsd
 Fri Sep  8 13:02:15 2006
@@ -0,0 +1,27 @@
+<!-- 
+<schema 
+        xmlns="http://www.w3.org/2001/XMLSchema";  <== Removed this line
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+-->
+<schema 
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+        xmlns:xs="http://www.w3.org/2001/XMLSchema";
+        xmlns:xsd1="http://soapinterop.org/xsd2";
+        elementFormDefault="qualified">
+ 
+    <xs:simpleType name="PaymentCardCodeType">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction base="UpperCaseAlphaLength1to2"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+  
+  <xs:simpleType name="UpperCaseAlphaLength1to2">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[A-Z]{1,2}"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+</schema>

Added: 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBase.xsd
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBase.xsd?view=auto&rev=441628
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBase.xsd
 (added)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBase.xsd
 Fri Sep  8 13:02:15 2006
@@ -0,0 +1,9 @@
+<schema targetNamespace="http://soapinterop.org/xsd";
+        xmlns="http://www.w3.org/2001/XMLSchema";
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+        xmlns:xsd1="http://soapinterop.org/xsd";
+        xmlns:xsd2="http://soapinterop.org/xsd2";
+        elementFormDefault="qualified">
+    <include schemaLocation="includeAux.xsd"/>
+</schema>

Added: 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBaseNoDefaultNS.xsd
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBaseNoDefaultNS.xsd?view=auto&rev=441628
==============================================================================
--- 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBaseNoDefaultNS.xsd
 (added)
+++ 
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/WSCOMMONS-87/includeBaseNoDefaultNS.xsd
 Fri Sep  8 13:02:15 2006
@@ -0,0 +1,9 @@
+<schema targetNamespace="http://soapinterop.org/xsd";
+        xmlns="http://www.w3.org/2001/XMLSchema";
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+        xmlns:xsd1="http://soapinterop.org/xsd";
+        xmlns:xsd2="http://soapinterop.org/xsd2";
+        elementFormDefault="qualified">
+    <include schemaLocation="includeAuxNoDefaultNS.xsd"/>
+</schema>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to