You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ha...@apache.org on 2005/11/10 15:03:10 UTC
svn commit: r332295 - in
/webservices/axis/trunk/c/tests/auto_build/testcases:
client/cpp/ConnectionCloseClient.cpp output/ConnectionClose.cpp.out
output/ConnectionClose_ServerResponse.expected tests/ConnectionClose.xml
Author: hawkeye
Date: Thu Nov 10 06:03:04 2005
New Revision: 332295
URL: http://svn.apache.org/viewcvs?rev=332295&view=rev
Log:
Added a test for JIRA http://issues.apache.org/jira/browse/AXISCPP-868
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ConnectionCloseClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose.cpp.out
webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose_ServerResponse.expected
webservices/axis/trunk/c/tests/auto_build/testcases/tests/ConnectionClose.xml
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ConnectionCloseClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ConnectionCloseClient.cpp?rev=332295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ConnectionCloseClient.cpp (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ConnectionCloseClient.cpp Thu Nov 10 06:03:04 2005
@@ -0,0 +1,103 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+//
+// 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 "Calculator.hpp"
+#include <axis/AxisException.hpp>
+#include <ctype.h>
+#include <iostream>
+#include <signal.h>
+
+void sig_handler(int);
+void PrintUsage();
+bool IsNumber(const char* p);
+
+int main(int argc, char* argv[])
+{
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/Calculator";
+ const char* op = 0;
+ int i1=0, i2=0;
+ int iResult;
+
+ signal(SIGILL, sig_handler);
+ signal(SIGABRT, sig_handler);
+ signal(SIGSEGV, sig_handler);
+ //signal(SIGQUIT, sig_handler);
+ //signal(SIGBUS, sig_handler);
+ signal(SIGFPE, sig_handler);
+
+ url = argv[1];
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ Calculator ws(endpoint);
+
+ op = "add";
+ i1 = 2;
+ i2 = 3;
+
+ if (strcmp(op, "add") == 0)
+ {
+ iResult = ws.add(i1, i2);
+ cout << iResult << endl;
+ bSuccess = true;
+ }
+ }
+ catch(AxisException& e)
+ {
+ cout << "Exception : " << e.what() << endl;
+ }
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ catch(...)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+
+ return 0;
+}
+
+void PrintUsage()
+{
+ printf("Usage :\n Calculator <url>\n\n");
+ exit(1);
+}
+
+bool IsNumber(const char* p)
+{
+ for (int x=0; x < strlen(p); x++)
+ {
+ if (!isdigit(p[x])) return false;
+ }
+ return true;
+}
+
+void sig_handler(int sig) {
+ signal(sig, sig_handler);
+ cout << "SIGNAL RECEIVED " << sig << endl;
+ exit(1);
+}
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose.cpp.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose.cpp.out?rev=332295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose.cpp.out (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose.cpp.out Thu Nov 10 06:03:04 2005
@@ -0,0 +1,4 @@
+5
+5
+5
+---------------------- TEST COMPLETE -----------------------------
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose_ServerResponse.expected?rev=332295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose_ServerResponse.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ConnectionClose_ServerResponse.expected Thu Nov 10 06:03:04 2005
@@ -0,0 +1,34 @@
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-US
+Transfer-Encoding: chunked
+
+1ad
+<?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><addResponse xmlns="http://localhost/axis/Calculator"><addReturn>5</addReturn></addResponse></soapenv:Body></soapenv:Envelope>
+0
+
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-US
+Transfer-Encoding: chunked
+Connection: Close
+
+1ad
+<?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><addResponse xmlns="http://localhost/axis/Calculator"><addReturn>5</addReturn></addResponse></soapenv:Body></soapenv:Envelope>
+0
+
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-US
+Transfer-Encoding: chunked
+
+1ad
+<?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><addResponse xmlns="http://localhost/axis/Calculator"><addReturn>5</addReturn></addResponse></soapenv:Body></soapenv:Envelope>
+0
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/ConnectionClose.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/ConnectionClose.xml?rev=332295&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/ConnectionClose.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/ConnectionClose.xml Thu Nov 10 06:03:04 2005
@@ -0,0 +1,14 @@
+<test>
+ <name>ConnectionClose</name>
+ <description>Test whether a Connection:Close is handled properly</description>
+ <clientLang>cpp</clientLang>
+ <clientCode>ConnectionCloseClient.cpp</clientCode>
+ <wsdl>CalculatorDoc.wsdl</wsdl>
+ <expected>
+ <output>
+ ConnectionClose.cpp.out
+ </output>
+ <serverResponse>ConnectionClose_ServerResponse.expected</serverResponse>
+ </expected>
+ <endpoint>http://localhost:80/axis/CalculatorDoc</endpoint>
+</test>