Author: ajith
Date: Sat Mar 22 14:25:47 2008
New Revision: 640083
URL: http://svn.apache.org/viewvc?rev=640083&view=rev
Log:
1. Test case for issue 310
Modified:
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/MixedContentTest.java
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/mixedContent.xsd
Modified:
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/MixedContentTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/MixedContentTest.java?rev=640083&r1=640082&r2=640083&view=diff
==============================================================================
---
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/MixedContentTest.java
(original)
+++
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/MixedContentTest.java
Sat Mar 22 14:25:47 2008
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaComplexContent;
+import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaType;
@@ -36,6 +38,9 @@
"complexElt");
+ QName TYPE_QNAME = new QName("http://soapinterop.org/xsd",
+ "NoAssemblyRequiredProduct");
+
InputStream is = new
FileInputStream(Resources.asURI("mixedContent.xsd"));
XmlSchemaCollection schema = new XmlSchemaCollection();
XmlSchema s = schema.read(new StreamSource(is), null);
@@ -47,5 +52,13 @@
assertNotNull(schemaType);
assertTrue(schemaType.isMixed());
+
+ XmlSchemaComplexType typeByName =
(XmlSchemaComplexType)s.getTypeByName(TYPE_QNAME);
+ assertNotNull(typeByName);
+
+
assertTrue(((XmlSchemaComplexContent)typeByName.getContentModel()).isMixed());
+
+
+
}
}
Modified:
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/mixedContent.xsd
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/mixedContent.xsd?rev=640083&r1=640082&r2=640083&view=diff
==============================================================================
---
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/mixedContent.xsd
(original)
+++
webservices/commons/trunk/modules/XmlSchema/src/test/test-resources/mixedContent.xsd
Sat Mar 22 14:25:47 2008
@@ -23,6 +23,7 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://soapinterop.org/xsd"
xmlns:xsd2="http://soapinterop.org/xsd2"
+ xmlns:tns="http://soapinterop.org/types"
elementFormDefault="qualified">
<element name="complexElt">
<complexType mixed="true">
@@ -32,4 +33,24 @@
</sequence>
</complexType>
</element>
+
+ <complexType name="NoAssemblyRequiredProduct">
+ <complexContent mixed="true">
+ <restriction base="tns:AssemblyRequiredProduct">
+ <sequence>
+ <element name="Name" type="string"/>
+ <element name="Description" type="string" nillable="true"/>
+ <element name="Parts" type="string"/>
+ </sequence>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+ <complexType name="AssemblyRequiredProduct">
+ <sequence>
+ <element name="Name" type="string"/>
+ <element name="Description" type="string" nillable="true"/>
+ <element name="Parts" type="string" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
</schema>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]