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 di...@apache.org on 2006/01/20 15:53:38 UTC
svn commit: r370835 - in
/webservices/axis/trunk/c/tests/auto_build/testcases: ./ client/cpp/
output/ tests/
Author: dicka
Date: Fri Jan 20 06:53:31 2006
New Revision: 370835
URL: http://svn.apache.org/viewcvs?rev=370835&view=rev
Log:
Add ComplexTypeNillableAll testcases to unit test framework, also modified to better test nillable element.
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_Request.expected
webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_ServerResponse.expected
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeNillableAllClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll.cpp.out
webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeNillableAll.xml
webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeNillableAllClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeNillableAllClient.cpp?rev=370835&r1=370834&r2=370835&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeNillableAllClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeNillableAllClient.cpp Fri Jan 20 06:53:31 2006
@@ -32,108 +32,131 @@
int main(int argc, char* argv[])
{
-
- operations *ws;
-
- char *endpoint = WSDL_DEFAULT_ENDPOINT;
- bool endpoint_set = false;
- int returnValue = 1; // Assume Failure
-
- endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
+ operations *ws;
- bool bSuccess = false;
- int iRetryIterationCount = 3;
-
- do
- {
- try {
-
- if(endpoint_set) {
- ws = new operations(endpoint, APTHTTP1_1);
- free(endpoint);
- endpoint_set = false;
- } else
- ws = new operations();
-
- aRecord* input=new aRecord();
-
- xsd__int* fieldone=new xsd__int();
- *fieldone=NULL ;
- input->field1=fieldone;
-
- input->field2 = "I'm still here!";
-
- /* xsd__byte* fieldthree=new xsd__byte();
- *fieldthree=65;
- input->field3=fieldthree; */
+ char *endpoint = WSDL_DEFAULT_ENDPOINT;
+ bool endpoint_set = false;
+ int returnValue = 1; // Assume Failure
+
+ endpoint_set = parse_args_for_endpoint(&argc, argv, &endpoint);
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ if(endpoint_set)
+ {
+ ws = new operations(endpoint, APTHTTP1_1);
+ free(endpoint);
+ endpoint_set = false;
+ }
+ else
+ {
+ ws = new operations();
+ }
+
+ aRecord* input=new aRecord();
+
+ xsd__int* fieldone = NULL ;
+ input->field1=fieldone;
+ input->field2 = "I'm still here!";
- aRecord* result;
- result = ws->myOperation(input);
+ aRecord* result;
+ result = ws->myOperation(input);
- if (result== NULL)
- cout<< "result is NULL " << endl;
- else
- cout << "result is not NULL" << endl;
-
- cout << "Field1 = " << *(result->field1) << endl;
- cout << "Field2 = " << *(result->field2) << endl;
-
- bSuccess = true;
+ if (result== NULL)
+ {
+ cout<< "result is NULL " << endl;
+ }
+ else
+ {
+ cout << "result is not NULL" << endl;
+
+ if (result->field1)
+ {
+ cout << " Field1 = " << *(result->field1) << endl;
+ }
+ else
+ {
+ cout << " Field1 = <nil>" << endl;
+ }
+
+ if (result->field2)
+ {
+ cout << " Field2 = " << *(result->field2) << endl;
+ }
+ else
+ {
+ cout << " Field2 = <nil>" << endl;
+ }
+ }
+
+ delete input;
+ delete result;
+ bSuccess = true;
- returnValue = 0; // Success
+ returnValue = 0; // Success
- } catch(AxisException &e) {
- bool bSilent = false;
-
- if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
- {
- if( iRetryIterationCount > 0)
- {
- bSilent = true;
- }
- }
- else
- {
- iRetryIterationCount = 0;
- }
-
- if( !bSilent)
- {
- cout << e.what() << endl;
- }
- } catch(exception& exception){
-
- cout << "Exception on clean up of ws : " << exception.what()<<endl;
-
- } catch(...) {
-
- cout << "Unknown Exception occured" << endl;
- }
-
- // Samisa : clean up memory allocated for stub
- try
- {
- delete ws;
}
- catch(exception& exception)
- {
- cout << "Exception on clean up of ws : " << exception.what()<<endl;
- }
- catch(...)
- {
- cout << "Unknown exception on clean up of ws : " << endl;
+ catch(AxisException &e)
+ {
+ bool bSilent = false;
+
+ if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if( iRetryIterationCount > 0)
+ {
+ bSilent = true;
+ }
+ }
+ else
+ {
+ iRetryIterationCount = 0;
+ }
+
+ if( !bSilent)
+ {
+ cout << "AxisException : " << e.what() << endl;
+ }
+ }
+ catch(exception& exception)
+ {
+ cout << "Unexpected exception : " << exception.what()<<endl;
}
+ catch(...)
+ {
+ cout << "Unknown Exception occured" << endl;
+ }
+
+ // Samisa : clean up memory allocated for stub
+ try
+ {
+ delete ws;
+ }
+ catch(exception& exception)
+ {
+ cout << "Exception on clean up of ws : " << exception.what()<<endl;
+ }
+ catch(...)
+ {
+ cout << "Unknown exception on clean up of ws : " << endl;
+ }
- iRetryIterationCount--;
+ iRetryIterationCount--;
- } while( iRetryIterationCount > 0 && !bSuccess);
+ } while( iRetryIterationCount > 0 && !bSuccess);
if(endpoint_set)
- free(endpoint);
+ {
+ free(endpoint);
+ }
- cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
+ cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
- return returnValue;
+ return returnValue;
}
/* Spin through args list and check for -e -p and -s options.
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll.cpp.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll.cpp.out?rev=370835&r1=370834&r2=370835&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll.cpp.out (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll.cpp.out Fri Jan 20 06:53:31 2006
@@ -1,3 +1,4 @@
-<nil>
-I'm still here!
+result is not NULL
+ Field1 = <nil>
+ Field2 = I
---------------------- TEST COMPLETE -----------------------------
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_Request.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_Request.expected?rev=370835&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_Request.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_Request.expected Fri Jan 20 06:53:31 2006
@@ -0,0 +1,17 @@
+POST /axis/ComplexTypeNillableAll HTTP/1.1
+Host: 127.0.0.1:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "http://complextype.test.apache.org"
+Content-Length: 468
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:myOperation xmlns:ns1="http://complextype.test.apache.org">
+<ns1:aType><ns1:field1 xsi:nil="true"></ns1:field1>
+<ns1:field2>I'm still here!</ns1:field2>
+</ns1:aType>
+</ns1:myOperation>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_ServerResponse.expected?rev=370835&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_ServerResponse.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeNillableAll_ServerResponse.expected Fri Jan 20 06:53:31 2006
@@ -0,0 +1,9 @@
+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
+
+1f5
+<?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><myOperationResponse xmlns="http://complextype.test.apache.org"><result><field1 xsi:nil="true"/><field2>I'm still here!</field2></result></myOperationResponse></soapenv:Body></soapenv:Envelope>
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeNillableAll.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeNillableAll.xml?rev=370835&r1=370834&r2=370835&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeNillableAll.xml (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeNillableAll.xml Fri Jan 20 06:53:31 2006
@@ -9,11 +9,11 @@
ComplexTypeNillableAll.cpp.out
</output>
<request>
- ComplexTypeNillableAll.request
+ ComplexTypeNillableAll_Request.expected
</request>
- <serverReponse>
+ <serverResponse>
ComplexTypeNillableAll_ServerResponse.expected
- </serverReponse>
+ </serverResponse>
</expected>
<endpoint>-e http://localhost:80/axis/ComplexTypeNillableAll</endpoint>
</test>
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list?rev=370835&r1=370834&r2=370835&view=diff
==============================================================================
Binary files - no diff available.