axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r443352 - in /webservices/axis/trunk/c/tests/auto_build/testcases: ./ client/cpp/ output/ tests/ wsdls/
Date Thu, 14 Sep 2006 13:43:28 GMT
Author: prestonf
Date: Thu Sep 14 06:43:28 2006
New Revision: 443352

URL: http://svn.apache.org/viewvc?view=rev&rev=443352
Log:
Hi All,
New UT to test complextypes with restrictions such as patterns.

Added:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RestrictedPattern17667Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667.cpp.out
    webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/RestrictedPattern17667.xml
    webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.wsdl
    webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.xsd
Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RestrictedPattern17667Client.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RestrictedPattern17667Client.cpp?view=auto&rev=443352
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RestrictedPattern17667Client.cpp
(added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RestrictedPattern17667Client.cpp
Thu Sep 14 06:43:28 2006
@@ -0,0 +1,88 @@
+#include "IQueryService.hpp"
+#include <iostream>
+
+int main( int argc, char * argv[])
+{
+	char *	pszEndpoint = "http://localhost:9020/UnitTest_17667";
+
+	// If there are arguments, replace the default URL with that specified on the
+	// command line.
+	if( argc > 1)
+	{
+		pszEndpoint = argv[1];
+	}
+
+	// Create the web service.
+	IQueryService *	pIQueryService = new IQueryService( pszEndpoint, APTHTTP1_1);
+
+	try
+	{
+		// Initialise the objects that will be returned from the web service call.
+		plmType_Array *			pPlmType_Array = NULL;
+		RepFormatType_Array *	pRepFormatType_Array = NULL;
+
+		// Get the information from the response message.
+		pIQueryService->query( &pPlmType_Array, &pRepFormatType_Array);
+
+		int					iPlmType_ArraySize = 0;
+		plmType **			ppPlmType = pPlmType_Array->get( iPlmType_ArraySize);
+		int					iRepFormatType_ArraySize = 0;
+		RepFormatType **	ppRepFormatType = pRepFormatType_Array->get( iRepFormatType_ArraySize);
+
+		// Display the response information.
+		for( int iIndex = 0; iIndex < iPlmType_ArraySize; iIndex++)
+		{
+			xsd__int	id = ppPlmType[iIndex]->getplmid();
+
+			cout << "id: " << id << endl;
+		}
+
+		if( iRepFormatType_ArraySize == 0)
+		{
+			cout << "RepFormatType is empty" << endl;
+		}
+
+		for( int iIndex = 0; iIndex < iRepFormatType_ArraySize; iIndex++)
+		{
+			xsd__unsignedInt			uiOwner = ppRepFormatType[iIndex]->getowner();
+			RepresentationFormatType	pszFormat = ppRepFormatType[iIndex]->getformat();
+			RepresentationLinkType		pRLT = ppRepFormatType[iIndex]->getassociatedFile();
+
+			cout << "Owner[" << iIndex << "]:         " << uiOwner <<
endl;
+			cout << "Format[" << iIndex << "]:        " << pszFormat <<
endl;
+			cout << "Rep Link Type[" << iIndex << "]: " << pRLT << endl;
+		}
+
+		// Tidy up.
+		delete *ppPlmType;
+		delete *ppRepFormatType;
+	}
+
+	// Catch those exceptions!
+	catch( AxisException& e)
+	{
+		cout << "Exception : " << e.what() << endl;
+	}
+	catch( exception& e)
+	{
+	    cout << "Unknown exception has occured: " << e.what() << endl;
+	}
+	catch( ...)
+	{
+	    cout << "Unknown exception has occured" << endl;
+	}
+
+	// Final tidy up.
+	delete pIQueryService;
+
+	// Done!
+	cout << "---------------------- TEST COMPLETE -----------------------------" <<
endl;
+
+	// Output should be as follows:-
+	// id: 5
+	// Owner[0]:         25
+	// Format[0]:        format
+	// Rep Link Type[0]: associatedFile
+	// ---------------------- TEST COMPLETE -----------------------------
+	return 0;
+}
\ No newline at end of file

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667.cpp.out
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667.cpp.out?view=auto&rev=443352
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667.cpp.out
(added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667.cpp.out
Thu Sep 14 06:43:28 2006
@@ -0,0 +1,5 @@
+id: 5
+Owner[0]:         25
+Format[0]:        format
+Rep Link Type[0]: associatedFile
+---------------------- TEST COMPLETE -----------------------------

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667_ServerResponse.expected
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667_ServerResponse.expected?view=auto&rev=443352
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667_ServerResponse.expected
(added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/RestrictedPattern17667_ServerResponse.expected
Thu Sep 14 06:43:28 2006
@@ -0,0 +1,21 @@
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+                      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<soapenv:Header/>
+<soapenv:Body>
+<queryResponse xmlns="http://arrays.test.apache.org">
+<item1 plmid="5"></item1>
+<item2 owner="25" format="format" associatedFile="associatedFile"></item2>
+</queryResponse>
+</soapenv:Body>
+</soapenv:Envelope>
+0

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/RestrictedPattern17667.xml
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/tests/RestrictedPattern17667.xml?view=auto&rev=443352
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/RestrictedPattern17667.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/RestrictedPattern17667.xml Thu
Sep 14 06:43:28 2006
@@ -0,0 +1,16 @@
+<test>
+  <name>RestrictedPattern17667</name>
+  <description>RestrictedPattern17667</description>
+  <clientLang>cpp</clientLang>
+  <clientCode>RestrictedPattern17667client.cpp</clientCode>
+  <wsdl>RestrictedPattern17667.wsdl</wsdl>
+  <expected>
+    <output>
+      RestrictedPattern17667.cpp.out
+    </output>
+    <serverResponse>
+      RestrictedPattern17667_ServerResponse.expected
+    </serverResponse>
+  </expected>
+  <endpoint>http://localhost:80/RestrictedPattern17667</endpoint>
+</test>

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list?view=diff&rev=443352&r1=443351&r2=443352
==============================================================================
Binary files - no diff available.

Added: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.wsdl?view=auto&rev=443352
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.wsdl
(added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.wsdl
Thu Sep 14 06:43:28 2006
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions targetNamespace="urn:com:17667:plm1wsdl"
+                       xmlns="http://schemas.xmlsoap.org/wsdl/"
+                  xmlns:plm1="urn:com:17667:plm1"
+                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                   xmlns:tns="urn:com:17667:plm1wsdl"
+                   xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/"
+                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <types>
+    <xsd:schema targetNamespace="urn:com:17667:plm1wsdl">
+      <xsd:import namespace="urn:com:17667:plm1" schemaLocation="RestrictedPattern17667.xsd"/>
+      <xsd:element name="query">
+        <xsd:complexType/>
+      </xsd:element>
+      <xsd:element name="queryResponse" type="plm1:queryResultType"/>
+    </xsd:schema>
+  </types>
+
+	<message name="queryInput">
+		<part element="tns:query" name="parameters"/>
+	</message>
+	
+	<message name="queryOutput">
+		<part element="tns:queryResponse" name="parameters"/>
+	</message>
+	
+	<portType name="IQueryService">
+		<operation name="query">
+			<input message="tns:queryInput"/>
+			<output message="tns:queryOutput"/>
+		</operation>
+	</portType>
+	<binding name="IQueryServiceBinding" type="tns:IQueryService">
+		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+		<operation name="query">
+			<soap:operation soapAction="" style="document"/>
+			<input>
+				<soap:body use="literal"/>
+			</input>
+			<output>
+				<soap:body use="literal"/>
+			</output>
+		</operation>
+	</binding>
+	<service name="queryService">
+     <port binding="tns:IQueryServiceBinding" name="IQueryServicePort">
+      <soap:address location="http://localhost:9080/webapp/QueryService"/>
+     </port>  
+    </service>
+</definitions>

Added: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.xsd
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.xsd?view=auto&rev=443352
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.xsd (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/RestrictedPattern17667.xsd Thu
Sep 14 06:43:28 2006
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+          xmlns:tns="urn:com:17667:plm1"
+    targetNamespace="urn:com:17667:plm1"
+ elementFormDefault="qualified">
+
+ <xs:complexType name="plmType" abstract="true">
+  <xs:attribute name="plmid" type="xs:int"/>
+ </xs:complexType>
+
+ <xs:complexType name="partType">
+  <xs:complexContent>
+   <xs:extension base="tns:plmType">
+    <xs:attribute name="partName" type="xs:string"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="productType">
+  <xs:complexContent>
+   <xs:extension base="tns:plmType">
+    <xs:attribute name="productName" type="xs:string"/>
+    <xs:attribute name="productDescription" type="xs:string"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="queryResultType">
+  <xs:sequence>
+   <xs:element name="item1" type="tns:plmType" minOccurs="0" maxOccurs="unbounded"/>
+   <xs:element name="item2" type="tns:RepFormatType" minOccurs="0" maxOccurs="unbounded"/>
+  </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="newQueryResultType">  
+  <xs:sequence>  
+   <xs:element name="item" type="tns:plmType" minOccurs="0" maxOccurs="unbounded"/>
 
+  </xs:sequence>  
+ </xs:complexType>
+ 
+	<xs:simpleType name="LinkType">
+		<xs:restriction base="xs:string">
+			<xs:pattern value="urn:3DXML:.*:(loc|ext):.*"/>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="RepresentationLinkType">
+		<xs:restriction base="tns:LinkType">
+			<xs:pattern value="urn:3DXML:(Representation|TechRep):(loc|ext):.*"/>
+		</xs:restriction>
+	</xs:simpleType>
+ 
+	<xs:complexType name="RepFormatType" abstract="false">
+		<xs:attribute name="owner" type="xs:unsignedInt" use="required"/>
+		<xs:attribute name="format" type="tns:RepresentationFormatType" use="required"/>
+		<xs:attribute name="associatedFile" type="tns:RepresentationLinkType" use="required"/>
+	</xs:complexType>
+
+	<xs:simpleType name="RepresentationFormatType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="TESSELLATED"/>
+			<xs:enumeration value="ANNOTATION3D"/>
+		</xs:restriction>
+	</xs:simpleType>
+
+ <xs:element name="queryResult" type="tns:queryResultType"/>
+</xs:schema>



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


Mime
View raw message