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 pe...@apache.org on 2005/02/08 10:59:28 UTC
cvs commit: ws-axis/c/tests/auto_build/testcases/output TestSetEndpoint.request TestSetEndpoint.expected
perryan 2005/02/08 01:59:27
Modified: c/tests/auto_build/testcases/client/cpp
TestSetEndpointClient.cpp
c/tests/auto_build/testcases/tests TestSetEndpoint.xml
Added: c/tests/auto_build/testcases/output TestSetEndpoint.request
Removed: c/tests/auto_build/testcases/output TestSetEndpoint.expected
Log:
Updated the test to make more sense.
Construct stub with a bogus endpoint before setting the correct endpoint
delete the stub when finished
check the request on-the-wire as the endpoint gets adjusted to the test endpoint before comparison
Revision Changes Path
1.2 +13 -12 ws-axis/c/tests/auto_build/testcases/client/cpp/TestSetEndpointClient.cpp
Index: TestSetEndpointClient.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/client/cpp/TestSetEndpointClient.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestSetEndpointClient.cpp 3 Feb 2005 10:24:49 -0000 1.1
+++ TestSetEndpointClient.cpp 8 Feb 2005 09:59:27 -0000 1.2
@@ -3,39 +3,40 @@
*/
#include "Calculator.hpp"
+#include <iostream>
int main(int argc, char* argv[])
{
char endpoint[256];
+ const char* bogus_url="http://no-one.home/rubbish";
const char* url="http://localhost:80/axis/Calculator";
int iResult;
- url = argv[1];
+ if(argc>1)
+ url = argv[1];
try
{
- sprintf(endpoint, "%s", url);
- Calculator ws;
- printf("EndPointURI is = %s \n", url);
- ws.setEndPoint(url);
+ Calculator* ws = new Calculator(bogus_url);
+ ws->setEndPoint(url);
- iResult = ws.add(2,3);
- printf("%d\n", iResult);
+ iResult = ws->add(2,3);
+ cout << iResult << endl;;
+ delete ws;
}
catch(AxisException& e)
{
- printf("in AxisException block \n");
- printf("Exception : %s\n", e.what());
+ cout << e.what() << endl;
}
catch(exception& e)
{
- printf("Unknown exception has occured\n" );
+ cout << "Unknown exception has occured" << endl;
}
catch(...)
{
- printf("Unpecified exception has occured \n" );
+ cout << "Unpecified exception has occured" << endl;
}
-
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
return 0;
}
1.2 +4 -1 ws-axis/c/tests/auto_build/testcases/tests/TestSetEndpoint.xml
Index: TestSetEndpoint.xml
===================================================================
RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/tests/TestSetEndpoint.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestSetEndpoint.xml 3 Feb 2005 10:24:49 -0000 1.1
+++ TestSetEndpoint.xml 8 Feb 2005 09:59:27 -0000 1.2
@@ -6,8 +6,11 @@
<wsdl>CalculatorDoc.wsdl</wsdl>
<expected>
<output>
- TestSetEndpoint.expected
+ CalculatorDoc.cpp.out
</output>
+ <request>
+ TestSetEndpoint.request
+ </request>
</expected>
<endpoint>http://localhost:80/Calculator/services/Calculator</endpoint>
</test>
1.1 ws-axis/c/tests/auto_build/testcases/output/TestSetEndpoint.request
Index: TestSetEndpoint.request
===================================================================
POST /Calculator/services/Calculator HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: "Calculator#add"
Content-Length: 397
<?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:add xmlns:ns1="http://localhost/axis/Calculator">
<ns1:arg_0_0>2</ns1:arg_0_0>
<ns1:arg_1_0>3</ns1:arg_1_0>
</ns1:add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>