You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2006/05/31 07:05:31 UTC

svn commit: r410431 - in /webservices/axis2/trunk/c/xml_schema: test-resources/ test-resources/circular/ test/

Author: nandika
Date: Tue May 30 22:05:30 2006
New Revision: 410431

URL: http://svn.apache.org/viewvc?rev=410431&view=rev
Log:
tests added to xml_schema 

Added:
    webservices/axis2/trunk/c/xml_schema/test/
    webservices/axis2/trunk/c/xml_schema/test-resources/
    webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/circular/
    webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd
    webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl
    webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd
    webservices/axis2/trunk/c/xml_schema/test/main.c
    webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c
    webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h

Added: webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,20 @@
+<schema
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types">
+
+    <simpleType name="layoutComponentType">
+        <restriction base="xsd:string">
+            <enumeration value="Field"/>
+            <enumeration value="Separator"/>
+        </restriction>
+    </simpleType>
+    <simpleType name="layoutComponentTypeName">
+        <restriction base="xsd:string"/>
+    </simpleType>
+
+    <element name="foo" type="tns:layoutComponentType"/>
+    <element name="bar" type="tns:layoutComponentTypeName"/>
+    
+</schema>

Added: webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<!--
+         3.2.1 string
+        3.2.2 boolean
+        3.2.3 decimal
+        3.2.4 float
+        3.2.5 double
+        3.2.6 duration
+        3.2.7 dateTime
+        3.2.8 time
+        3.2.9 date
+        3.2.10 gYearMonth
+        3.2.11 gYear
+        3.2.12 gMonthDay
+        3.2.13 gDay
+        3.2.14 gMonth
+        3.2.15 hexBinary
+        3.2.16 base64Binary
+        3.2.17 anyURI
+        3.2.18 QName
+        3.2.19 NOTATION
+
+     -->
+	<xs:element name="PrimitiveString" type="xs:string"/>
+	<xs:element name="PrimitiveBoolean" type="xs:boolean"/>
+	<xs:element name="PrimitiveDecimal" type="xs:decimal"/>
+	<xs:element name="PrimitiveFloat" type="xs:float"/>
+	<xs:element name="PrimitiveDouble" type="xs:double"/>
+	<xs:element name="PrimitiveDate" type="xs:date"/>
+	<xs:element name="PrimitiveDateTime" type="xs:dateTime"/>
+	<xs:element name="PrimitiveDuration" type="xs:duration"/>
+	<xs:element name="PrimitiveDay" type="xs:gDay"/>
+	<xs:element name="PrimitiveMonth" type="xs:gMonth"/>
+	<xs:element name="PrimitiveMonthDay" type="xs:gMonthDay"/>
+	<xs:element name="PrimitiveYear" type="xs:gYear"/>
+	<xs:element name="PrimitiveBase64Bin" type="xs:base64Binary"/>
+	<xs:element name="PrimitiveHexBin" type="xs:hexBinary"/>
+	<xs:element name="PrimitiveQName" type="xs:QName"/>
+	<xs:element name="PrimitiveNotation" type="xs:NOTATION"/>
+	<xs:element name="PrimitiveAnyURI" type="xs:anyURI"/>
+	<xs:element name="PrimitiveYearMonth" type="xs:gYearMonth"/>
+	<xs:element name="PrimitiveTime" type="xs:time"/>
+	<!--3.3.1 normalizedString
+        3.3.2 token
+        3.3.3 language
+        3.3.4 NMTOKEN
+        3.3.5 NMTOKENS
+        3.3.6 Name
+        3.3.7 NCName
+        3.3.8 ID
+        3.3.9 IDREF
+        3.3.10 IDREFS
+        3.3.11 ENTITY
+        3.3.12 ENTITIES
+        3.3.13 integer
+        3.3.14 nonPositiveInteger
+        3.3.15 negativeInteger
+        3.3.16 long
+        3.3.17 int
+        3.3.18 short
+        3.3.19 byte
+        3.3.20 nonNegativeInteger
+        3.3.21 unsignedLong
+        3.3.22 unsignedInt
+        3.3.23 unsignedShort
+        3.3.24 unsignedByte
+        3.3.25 positiveInteger
+
+-->
+	<xs:element name="DerivedPositiveInteger" type="xs:positiveInteger"/>
+	<xs:element name="DerivedNegativeInteger" type="xs:negativeInteger"/>
+	<xs:element name="DerivedNonNegativeInteger" type="xs:nonNegativeInteger"/>
+	<xs:element name="DerivedNonpositiveInteger" type="xs:nonPositiveInteger"/>
+	<xs:element name="DerivedUnsignedShort" type="xs:unsignedShort"/>
+	<xs:element name="DerivedUnsignedLong" type="xs:unsignedLong"/>
+	<xs:element name="DerivedUnsignedInt" type="xs:unsignedInt"/>
+	<xs:element name="DerivedUnsignedByte" type="xs:unsignedByte"/>
+	<xs:element name="DerivedLong" type="xs:long"/>
+	<xs:element name="DerivedShort" type="xs:short"/>
+	<xs:element name="DerivedInt" type="xs:int"/>
+	<xs:element name="DerivedByte" type="xs:byte"/>
+	<xs:element name="DerivedToken" type="xs:token"/>
+	<xs:element name="DerivedLanguage" type="xs:language"/>
+	<xs:element name="DerivedNMTOKEN" type="xs:NMTOKEN"/>
+	<xs:element name="DerivedNMTOKENS" type="xs:NMTOKENS"/>
+	<xs:element name="DerivedID" type="xs:ID"/>
+	<xs:element name="DerivedIDRef" type="xs:IDREF"/>
+	<xs:element name="DerivedEntity" type="xs:ENTITY"/>
+	<xs:element name="DerivedEntities" type="xs:ENTITIES"/>
+	<xs:element name="DerivedName" type="xs:Name"/>
+	<xs:element name="DerivedNameToken" type="xs:NMTOKEN"/>
+	<xs:element name="DerivedNCName" type="xs:NCName"/>
+	<xs:element name="DerivedNormalizedString" type="xs:normalizedString"/>
+	<xs:element name="DerivedInteger" type="xs:integer"/>
+</xs:schema>

Added: webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,18 @@
+<schema
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:tns="http://unqualified-elements.example.com"
+    targetNamespace="http://unqualified-elements.example.com">
+
+    <element name="AnyAttContainer">
+        <complexType>
+            <sequence>
+                <element name="chileValue" type="xsd:string"/>
+            </sequence>
+            <anyAttribute namespace="##other" processContents="lax"></anyAttribute>
+        </complexType>
+    </element>
+
+    <element name="global" type="xsd:int"/>
+
+</schema>

Added: webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,16 @@
+<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">
+     <element name="complexElt" block="restriction">
+         <complexType>
+             <sequence>
+                  <element name="name" type="string"/>
+                  <element name="age" type="int"/>
+             </sequence>
+         </complexType>
+     </element>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,8 @@
+<schema targetNamespace="urn:xmlschema:recursive:a"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        elementFormDefault="qualified" >
+        
+    <import namespace="urn:xmlschema:recursive:b" schemaLocation="b.xsd"></import>
+    
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,8 @@
+<schema targetNamespace="urn:xmlschema:recursive:b"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        elementFormDefault="qualified" >
+        
+    <import namespace="urn:xmlschema:recursive:a" schemaLocation="a.xsd"></import>
+    
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://finance.example.com/CreditCardFaults/xsd"
+	xmlns:tns="http://finance.example.com/CreditCardFaults/xsd"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.w3.org/2001/XMLSchema ../../../xmlcatalog/xsd/XMLSchema.xsd">
+
+	<element name="CreditCardNumber" type="string"></element>
+
+	<element name="CreditCardType">
+		<simpleType>
+			<restriction base="string">
+				<enumeration value="AMEX" />
+				<enumeration value="MASTERCARD" />
+				<enumeration value="VISA" />
+			</restriction>
+		</simpleType>
+	</element>
+
+	<element name="ExpirationDate" type="date"></element>
+
+	<element name="InvalidCreditCardNumber">
+		<complexType>
+			<sequence>
+				<element ref="tns:CreditCardType"></element>
+				<element ref="tns:CreditCardNumber"></element>
+			</sequence>
+		</complexType>
+	</element>
+
+	<element name="InvalidExpirationDate">
+		<complexType>
+			<sequence>
+				<element ref="tns:CreditCardNumber"></element>
+				<element ref="tns:ExpirationDate"></element>
+			</sequence>
+		</complexType>
+	</element>
+
+	<element name="ExpiredCreditCard">
+		<complexType>
+			<sequence>
+				<element ref="tns:CreditCardNumber"></element>
+			</sequence>
+		</complexType>
+	</element>
+
+	<element name="CancelledCreditCard">
+		<complexType>
+			<sequence>
+				<element ref="tns:CreditCardNumber"></element>
+			</sequence>
+		</complexType>
+	</element>
+
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,19 @@
+<schema
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:tns="http://unqualified-elements.example.com"
+    targetNamespace="http://unqualified-elements.example.com">
+
+    <element name="unQualifiedLocals">
+        <complexType>
+            <sequence>
+                <element name="unqualified" type="xsd:string"/>
+                <element name="qualified" form="qualified" type="xsd:int"/>
+<!--                <element ref="tns:global"/>-->
+            </sequence>
+        </complexType>
+    </element>
+
+    <element name="global" type="xsd:int"/>
+
+</schema>

Added: webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,28 @@
+<schema
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:tns="http://soapinterop.org/types"
+        targetNamespace="http://soapinterop.org/types">
+
+    <complexType name="Struct">
+        <sequence>
+            <element name="varString" type="xsd:string"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varStruct" type="tns:Struct"/>
+        </sequence>
+    </complexType>
+
+    <element name="attrTest" type="tns:Struct"/>
+
+    <element name="attTests">
+        <complexType>
+            <sequence>
+                <element ref="tns:attrTest" maxOccurs="5"></element>
+            </sequence>
+        </complexType>
+    </element>
+
+
+
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,62 @@
+<schema
+    xmlns="http://www.w3.org/2001/XMLSchema"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:tns="http://soapinterop.org/types"
+    targetNamespace="http://soapinterop.org/types">
+
+    <element name="attrTest">
+        <complexType>
+             <sequence>
+                <element name="foo" type="xsd:string"/>
+            </sequence>
+            <attribute name="forward" type="xsd:int"/>
+        </complexType>
+    </element>
+
+    <complexType name="Struct">
+        <sequence>
+            <element name="varString" type="xsd:string"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varStruct" type="tns:Struct"/>
+            <element name="varForward" type="tns:Forward"/>
+        </sequence>
+    </complexType>
+
+    <complexType name="Forward">
+        <sequence>
+            <element name="soapStruct" type="tns:Struct"/>
+        </sequence>
+    </complexType>
+
+    <complexType name="BaseStruct">
+        <sequence>
+            <element name="structMessage" type="tns:Struct"/>
+            <element name="shortMessage" type="xsd:short"/>
+        </sequence>
+    </complexType>
+
+    <complexType name="ExtendedStruct">
+        <complexContent>
+            <extension base="tns:BaseStruct">
+                <sequence>
+                    <element name="stringMessage" type="xsd:string"/>
+                    <element name="intMessage" type="xsd:int"/>
+                    <element name="anotherIntMessage" type="xsd:int"/>
+                </sequence>
+            </extension>
+        </complexContent>
+    </complexType>
+
+    <complexType name="MoreExtendedStruct">
+        <complexContent>
+            <extension base="tns:ExtendedStruct">
+                <sequence>
+                    <element name="booleanMessage" type="xsd:boolean"/>
+                </sequence>
+            </extension>
+        </complexContent>
+    </complexType>
+
+    <element name="foo" type="tns:ExtendedStruct"/>
+</schema>

Added: webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,14 @@
+<schema targetNamespace="http://soapinterop.org/xsd2"
+        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/xsd2"
+        elementFormDefault="qualified">
+    <complexType name="SOAPStruct">
+        <all>
+            <element name="varFloat" type="xsd:float"/>
+            <element name="varInt" type="xsd:int"/>
+            <element name="varString" type="xsd:string"/>
+        </all>
+    </complexType>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,10 @@
+<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">
+    <import namespace="http://soapinterop.org/xsd2" schemaLocation="importAux.xsd"></import>
+    <element name="echoStructParam" type="xsd2:SOAPStruct"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,16 @@
+<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">
+     <element name="complexElt">
+         <complexType mixed="true">
+             <sequence>
+                  <element name="name" type="string"/>
+                  <element name="age" type="int"/>
+             </sequence>
+         </complexType>
+     </element>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://greath.example.com/2004/schemas/resSvc"
+	xmlns="http://greath.example.com/2004/schemas/resSvc"
+	xmlns:cc="http://finance.example.com/CreditCardFaults/xsd">
+
+	<xs:import xmlns:xs="http://www.w3.org/2001/XMLSchema"
+		namespace="http://finance.example.com/CreditCardFaults/xsd"
+		schemaLocation="credit-card-faults.xsd" />
+
+	<xs:element name="checkAvailability" type="tCheckAvailability" />
+	<xs:complexType name="tCheckAvailability">
+		<xs:sequence>
+			<xs:element name="checkInDate" type="xs:date" />
+			<xs:element name="checkOutDate" type="xs:date" />
+			<xs:element name="roomType" type="xs:string" />
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:element name="checkAvailabilityResponse" type="xs:double" />
+
+	<xs:element name="makeReservation" type="tMakeReservation" />
+	<xs:complexType name="tMakeReservation">
+		<xs:sequence>
+			<xs:element ref="cc:CreditCardType" />
+			<xs:element ref="cc:CreditCardNumber" />
+			<xs:element name="checkInDate" type="xs:date" />
+			<xs:element name="checkOutDate" type="xs:date" />
+			<xs:element name="roomType" type="xs:string" />
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:element name="makeReservationResponse" type="xs:double" />
+
+	<xs:element name="invalidDataError" type="xs:string" />
+
+</xs:schema>

Added: webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl Tue May 30 22:05:30 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        xmlns:ns1="http://ns1.demo.org"
+        xmlns:tns="http://tns.demo.org"
+        xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        targetNamespace="http://tns.demo.org">
+    <wsdl:types>
+        <xsd:schema targetNamespace="http://tns.demo.org" elementFormDefault="qualified" attributeFormDefault="qualified">
+            <xsd:element name="elem1">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="elem2" type="ns1:elem3" minOccurs="1" maxOccurs="1"/>
+                    </xsd:sequence>
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:schema>
+        <xsd:schema targetNamespace="http://ns1.demo.org" elementFormDefault="qualified" attributeFormDefault="qualified">
+            <xsd:complexType name="elem3">
+                <xsd:sequence>
+                    <xsd:element name="elem4" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+            </xsd:complexType>
+        </xsd:schema>
+    </wsdl:types>
+</wsdl:definitions>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd (added)
+++ webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd Tue May 30 22:05:30 2006
@@ -0,0 +1,16 @@
+<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">
+     <element name="complexElt">
+         <complexType>
+             <sequence>
+                  <element name="name" type="string"/>
+                  <element name="age" type="int"/>
+             </sequence>
+         </complexType>
+     </element>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test/main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test/main.c?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test/main.c (added)
+++ webservices/axis2/trunk/c/xml_schema/test/main.c Tue May 30 22:05:30 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#include "xml_schema_test.h"
+
+void RunAllTests(void) {
+    CuString *output = CuStringNew();
+    CuSuite* suite = xml_schema_GetSuite();
+    CuSuiteRun(suite);
+    CuSuiteSummary(suite, output);
+    CuSuiteDetails(suite, output);
+    printf("%s", output->buffer);
+}
+
+int main(void) {
+    RunAllTests();
+    getchar();
+    return 0;
+}

Added: webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c (added)
+++ webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c Tue May 30 22:05:30 2006
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#include <CuTest.h>
+#include <stdio.h>
+#include <axis2_om.h>
+#include <xml_schema/axis2_xml_schema_includes.h>
+#include <axis2_env.h>
+#include "xml_schema_test.h"
+
+
+static axis2_om_document_t* 
+get_root_element_from_filename(axis2_env_t **env, 
+                               axis2_char_t *filename);
+
+void test_simple_type_schema_generation(CuTest *tc);
+void test_any_attribute(CuTest *tc);
+void test_block_content(CuTest *tc);
+void test_circular_schema(CuTest *tc);
+void test_schema_import1(CuTest *tc);
+void test_schema_import2(CuTest *tc);
+void test_mixed_content(CuTest *tc);
+void test_local_elements(CuTest *tc);
+void test_element_refs(CuTest *tc);
+void test_forward_refs(CuTest *tc);
+void test_local_unnamed_simple_type(CuTest *tc);
+void test_simple_restriction(CuTest *tc);
+void test_unqualified_schemas(CuTest *tc);
+void test_two_schmes(CuTest *tc);
+
+
+CuSuite* xml_schema_GetSuite()
+{
+    CuSuite* suite = CuSuiteNew();
+    SUITE_ADD_TEST(suite, test_simple_type_schema_generation);
+    SUITE_ADD_TEST(suite, test_any_attribute);
+    SUITE_ADD_TEST(suite, test_block_content);
+    SUITE_ADD_TEST(suite, test_circular_schema);
+    SUITE_ADD_TEST(suite, test_schema_import1);
+    SUITE_ADD_TEST(suite, test_schema_import2);
+    SUITE_ADD_TEST(suite, test_mixed_content);
+    SUITE_ADD_TEST(suite, test_local_elements);
+    SUITE_ADD_TEST(suite, test_element_refs);
+    SUITE_ADD_TEST(suite, test_forward_refs);
+    SUITE_ADD_TEST(suite, test_local_unnamed_simple_type);
+    SUITE_ADD_TEST(suite, test_simple_restriction);
+    SUITE_ADD_TEST(suite, test_unqualified_schemas);
+    SUITE_ADD_TEST(suite, test_two_schmes);
+    return suite;
+}
+
+void test_simple_type_schema_generation(CuTest *tc)
+{
+    axis2_env_t *env = NULL;
+    axis2_om_document_t *om_doc = NULL;
+    axis2_xml_schema_collection_t *sch_collection = NULL;
+    axis2_xml_schema_t *schema = NULL;
+    axis2_xml_schema_obj_table_t *obj_table = NULL;
+    axis2_array_list_t *list = NULL;
+    int i = 0;
+    
+    void *ele = NULL;
+    void *sch_type = NULL;
+    axis2_char_t *filename = "./..//test-resources/allSimpleTypes.xsd"; 
+    
+    
+    
+    env = axis2_env_create_all("test.log", 1);
+    om_doc = get_root_element_from_filename(&env, filename);
+    sch_collection = axis2_xml_schema_collection_create(&env);
+    schema = AXIS2_XML_SCHEMA_COLLECTION_READ_DOCUMENT(
+        sch_collection, &env, om_doc);
+    
+    CuAssertPtrNotNull(tc, schema); 
+    
+    obj_table = AXIS2_XML_SCHEMA_GET_ELEMENTS(schema, &env);
+    
+    CuAssertPtrNotNull(tc, obj_table); 
+    
+    list = AXIS2_XML_SCHEMA_OBJ_TABLE_GET_VALUES(obj_table, &env);
+    
+    CuAssertPtrNotNull(tc, list);
+    
+    for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(list, &env); i++)
+    {
+        ele = AXIS2_ARRAY_LIST_GET(list, &env, i);
+            
+        CuAssertPtrNotNull(tc, ele);
+        
+        sch_type = AXIS2_XML_SCHEMA_ELEMENT_GET_SCHEMA_TYPE(ele, &env);
+        
+        CuAssertPtrNotNull(tc, sch_type);
+        
+        ele = NULL;
+        sch_type = NULL;
+    }
+}    
+
+void test_any_attribute(CuTest *tc){}
+void test_block_content(CuTest *tc){}
+void test_circular_schema(CuTest *tc){}
+void test_schema_import1(CuTest *tc){}
+void test_schema_import2(CuTest *tc){}
+void test_mixed_content(CuTest *tc){}
+void test_local_elements(CuTest *tc){}
+void test_element_refs(CuTest *tc){}
+void test_forward_refs(CuTest *tc){}
+void test_local_unnamed_simple_type(CuTest *tc){}
+void test_simple_restriction(CuTest *tc){}
+void test_unqualified_schemas(CuTest *tc){}
+void test_two_schmes(CuTest *tc){}
+
+static axis2_om_document_t* 
+get_root_element_from_filename(axis2_env_t **env, 
+                               axis2_char_t *filename)
+{
+    axis2_xml_reader_t *reader = NULL;
+    axis2_om_stax_builder_t *om_builder = NULL;
+    axis2_om_document_t *doc   = NULL;
+    reader = axis2_xml_reader_create_for_file(env, filename, NULL);
+    om_builder = axis2_om_stax_builder_create(env, reader);
+    doc = axis2_om_document_create(env, NULL, om_builder); 
+    AXIS2_OM_DOCUMENT_BUILD_ALL(doc, env);
+    return doc;    
+}                               
\ No newline at end of file

Added: webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h?rev=410431&view=auto
==============================================================================
--- webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h (added)
+++ webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h Tue May 30 22:05:30 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef XML_SCHEMA_TEST_H
+#define XML_SCHEMA_TEST_H
+
+#include <CuTest.h>
+#include <stdio.h>
+
+CuSuite* xml_schema_GetSuite();
+
+void test_simple_type_schema_generation(CuTest *tc);
+void test_any_attribute(CuTest *tc);
+void test_block_content(CuTest *tc);
+void test_circular_schema(CuTest *tc);
+void test_schema_import1(CuTest *tc);
+void test_schema_import2(CuTest *tc);
+void test_mixed_content(CuTest *tc);
+void test_local_elements(CuTest *tc);
+void test_element_refs(CuTest *tc);
+void test_forward_refs(CuTest *tc);
+void test_local_unnamed_simple_type(CuTest *tc);
+void test_simple_restriction(CuTest *tc);
+void test_unqualified_schemas(CuTest *tc);
+void test_two_schmes(CuTest *tc);
+
+#endif /* XML_SCHEMA_TEST_H */



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