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 bi...@apache.org on 2009/04/10 23:17:00 UTC

svn commit: r764061 - in /webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test: java/tests/SingleElementNoNamespace.java test-resources/singleElementNoNamespace.xsd

Author: bimargulies
Date: Fri Apr 10 21:16:59 2009
New Revision: 764061

URL: http://svn.apache.org/viewvc?rev=764061&view=rev
Log:
Add test case to disprove alleged problem.

Added:
    webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java   (with props)
    webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd   (with props)

Added: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java?rev=764061&view=auto
==============================================================================
--- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java (added)
+++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java Fri Apr 10 21:16:59 2009
@@ -0,0 +1,29 @@
+/**
+ * 
+ */
+package tests;
+
+import java.io.InputStream;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaObjectTable;
+
+import junit.framework.TestCase;
+
+
+public class SingleElementNoNamespace extends TestCase {
+	
+	public void testReadOneElement() throws Exception {
+
+		InputStream is = 
+			SingleElementNoNamespace.class.
+				getClassLoader().getResourceAsStream("singleElementNoNamespace.xsd");
+		XmlSchemaCollection schemaCol = new XmlSchemaCollection();
+		XmlSchema schema = schemaCol.read(new StreamSource(is), null);
+		XmlSchemaObjectTable objectTable = schema.getElements();
+		assertEquals(1, objectTable.getCount());
+	}
+}

Propchange: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/java/tests/SingleElementNoNamespace.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd
URL: http://svn.apache.org/viewvc/webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd?rev=764061&view=auto
==============================================================================
--- webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd (added)
+++ webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd Fri Apr 10 21:16:59 2009
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+<xs:element name="note">
+ <xs:complexType>
+   <xs:sequence>
+     <xs:element name="to" type="xs:string"/>
+     <xs:element name="from" type="xs:string"/>
+     <xs:element name="heading" type="xs:string"/>
+     <xs:element name="body" type="xs:string"/>
+   </xs:sequence>
+ </xs:complexType>
+</xs:element>
+
+</xs:schema>

Propchange: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: webservices/commons/branches/modules/XmlSchema/1_4_X_BRANCH/src/test/test-resources/singleElementNoNamespace.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml