You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by aj...@apache.org on 2008/03/22 09:46:13 UTC

svn commit: r639964 [3/3] - in /webservices/commons/trunk/modules/XmlSchema: ./ src/main/assembly/ src/main/java/org/apache/ws/commons/schema/ src/main/java/org/apache/ws/commons/schema/constants/ src/main/java/org/apache/ws/commons/schema/resolver/ sr...

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?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/IncludeTest.java Sat Mar 22 01:46:10 2008
@@ -88,8 +88,6 @@
         </schema>
         */
 
-        QName ELEMENT_QNAME = new QName("http://soapinterop.org/types",
-                                        "test1include");
         InputStream is = new FileInputStream(Resources.asURI("include.xsd"));
         XmlSchemaCollection schemaCol = new XmlSchemaCollection();
         XmlSchema schema = schemaCol.read(new StreamSource(is), null);
@@ -170,4 +168,4 @@
         XmlSchema schema = schemaCol.read(isource, null);
         assertNotNull(schema);
     }
-}
\ No newline at end of file
+}

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ListTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ListTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ListTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ListTest.java Sat Mar 22 01:46:10 2008
@@ -78,7 +78,7 @@
                 "workDays");
         InputStream is = new FileInputStream(Resources.asURI("list.xsd"));
         XmlSchemaCollection schemaCol = new XmlSchemaCollection();
-        XmlSchema schema = schemaCol.read(new StreamSource(is), null);
+        schemaCol.read(new StreamSource(is), null);
 
         XmlSchemaElement elem = schemaCol.getElementByQName(ELEMENT_QNAME);
         assertNotNull(elem);
@@ -104,4 +104,4 @@
 
     }
 
-}
\ No newline at end of file
+}

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/NamespaceContextTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/NamespaceContextTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/NamespaceContextTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/NamespaceContextTest.java Sat Mar 22 01:46:10 2008
@@ -18,7 +18,6 @@
  */
 
 package tests;
-
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.utils.NamespaceMap;
@@ -31,19 +30,15 @@
 import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
-
 public class NamespaceContextTest extends XMLTestCase {
     protected boolean whitespace = true;
-
     protected void setUp() throws Exception {
         whitespace = XMLUnit.getIgnoreWhitespace();
         XMLUnit.setIgnoreWhitespace(true);
     }
-
     protected void tearDown() throws java.lang.Exception {
         XMLUnit.setIgnoreWhitespace(whitespace);
     }
-
     public void testNamespaceContext() throws Exception {
         Map namespaceMapFromWSDL = new HashMap();
         namespaceMapFromWSDL.put("tns", new URI("http://example.org/getBalance/"));

Added: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/RecursiveImportTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/RecursiveImportTest.java?rev=639964&view=auto
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/RecursiveImportTest.java (added)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/RecursiveImportTest.java Sat Mar 22 01:46:10 2008
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package tests;
+
+import junit.framework.TestCase;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.w3c.dom.Document;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.namespace.QName;
+import java.io.File;
+
+public class RecursiveImportTest extends TestCase {
+
+    public void testSchemaImport() throws Exception{
+        //create a DOM document
+        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+        documentBuilderFactory.setNamespaceAware(true);
+        Document doc = documentBuilderFactory.newDocumentBuilder().
+                parse(Resources.asURI("circular/a.xsd"));
+
+        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
+        schemaCol.setBaseUri(Resources.TEST_RESOURCES + "/circular");
+        XmlSchema schema = schemaCol.read(doc,null);
+        assertNotNull(schema);
+
+      
+        
+        //these qnames are *not* there in these schemas
+        assertNull(schema.getTypeByName(new QName("http://soapinterop.org/xsd2","SOAPStruct")));
+        assertNull(schema.getElementByName(new QName("http://soapinterop.org/xsd2","SOAPWrapper")));
+
+    }
+
+    
+}

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SequenceTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SequenceTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SequenceTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/SequenceTest.java Sat Mar 22 01:46:10 2008
@@ -19,17 +19,18 @@
 
 package tests;
 
-import junit.framework.TestCase;
+import java.io.FileInputStream;
+import java.io.InputStream;
 
 import javax.xml.namespace.QName;
 import javax.xml.transform.stream.StreamSource;
-import java.io.InputStream;
-import java.io.FileInputStream;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
 
-import org.apache.ws.commons.schema.*;
+import junit.framework.TestCase;
+
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaSequence;
 
 /*
  * Copyright 2004,2007 The Apache Software Foundation.
@@ -81,7 +82,7 @@
 
         InputStream is = new FileInputStream(Resources.asURI("sequence.xsd"));
         XmlSchemaCollection schemaCol = new XmlSchemaCollection();
-        XmlSchema schema = schemaCol.read(new StreamSource(is), null);
+        schemaCol.read(new StreamSource(is), null);
 
         QName WRONG_QNAME = new QName("http://soapinterop.org/types",
                                       "machine");

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/TestSimpleRestriction.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/TestSimpleRestriction.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/TestSimpleRestriction.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/TestSimpleRestriction.java Sat Mar 22 01:46:10 2008
@@ -19,7 +19,6 @@
 package tests;
 
 import junit.framework.TestCase;
-import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaType;
@@ -38,7 +37,7 @@
 
         InputStream is = new FileInputStream(Resources.asURI("SimpleContentRestriction.xsd"));
         XmlSchemaCollection schema = new XmlSchemaCollection();
-        XmlSchema s = schema.read(new StreamSource(is), null);
+        schema.read(new StreamSource(is), null);
 
         XmlSchemaType simpleType = schema.getTypeByQName(TYPE_QNAME);
         assertNotNull(simpleType);
@@ -53,11 +52,11 @@
     public void testSimpleTypeRestrictionWithoutNamespace() throws Exception {
     	InputStream is = new FileInputStream(Resources.asURI("includedWithoutNamespace.xsd"));
     	XmlSchemaCollection schema = new XmlSchemaCollection();
-    	XmlSchema s = schema.read(new StreamSource(is), null);
+    	schema.read(new StreamSource(is), null);
     	XmlSchemaType principalId = schema.getTypeByQName(new QName("", "XdwsPrincipalId"));
     	assertNotNull(principalId);
     	XmlSchemaType groupId = schema.getTypeByQName(new QName("", "XdwsGroupId"));
     	assertNotNull(groupId);
-    	assertEquals(principalId, groupId.getBaseSchemaType());
+    	assertEquals(groupId.getBaseSchemaType(), principalId);
     }
 }

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/UnionTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/UnionTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/UnionTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/UnionTest.java Sat Mar 22 01:46:10 2008
@@ -74,7 +74,7 @@
                                         "unionTest");
         InputStream is = new FileInputStream(Resources.asURI("union.xsd"));
         XmlSchemaCollection schemaCol = new XmlSchemaCollection();
-        XmlSchema schema = schemaCol.read(new StreamSource(is), null);
+        schemaCol.read(new StreamSource(is), null);
 
 
         XmlSchemaElement elem = schemaCol.getElementByQName(ELEMENT_QNAME);
@@ -105,4 +105,4 @@
 
     }
 
-}
\ No newline at end of file
+}

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/attrib/CustomExtensionSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/attrib/CustomExtensionSerializerTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/attrib/CustomExtensionSerializerTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/attrib/CustomExtensionSerializerTest.java Sat Mar 22 01:46:10 2008
@@ -66,6 +66,7 @@
         Document doc2 = documentBuilderFactory.newDocumentBuilder().
                 parse(new ByteArrayInputStream(baos.toByteArray()));
 
+        schemaCol = new XmlSchemaCollection();
         schema = schemaCol.read(doc2,null);
         assertNotNull(schema);
 

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/elt/CustomExtElementSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/elt/CustomExtElementSerializerTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/elt/CustomExtElementSerializerTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/customext/elt/CustomExtElementSerializerTest.java Sat Mar 22 01:46:10 2008
@@ -65,6 +65,8 @@
         Document doc2 = documentBuilderFactory.newDocumentBuilder().
                 parse(new ByteArrayInputStream(baos.toByteArray()));
 
+        // we can't have two copies in the same collection.
+        schemaCol = new XmlSchemaCollection();
         schema = schemaCol.read(doc2,null);
         assertNotNull(schema);
 

Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ext/PlainExtensionSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ext/PlainExtensionSerializerTest.java?rev=639964&r1=639963&r2=639964&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ext/PlainExtensionSerializerTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/ext/PlainExtensionSerializerTest.java Sat Mar 22 01:46:10 2008
@@ -18,19 +18,17 @@
  */
 package tests.ext;
 
-import junit.framework.TestCase;
+import java.io.ByteArrayOutputStream;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.w3c.dom.Document;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
+import junit.framework.TestCase;
+
 import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import tests.Resources;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.w3c.dom.Document;
 
-import java.util.Iterator;
-import java.util.Map;
-import java.io.ByteArrayOutputStream;
+import tests.Resources;
 
 /**
  * try writing the schemas after they are built



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org