axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hawk...@apache.org
Subject svn commit: r365918 - in /webservices/axis/trunk/c/tests/auto_build/testcases: client/cpp/CookiesClient.cpp output/Cookies.cpp.out output/Cookies.request output/Cookies_ServerResponse.expected tests/Cookies.xml
Date Wed, 04 Jan 2006 14:43:40 GMT
Author: hawkeye
Date: Wed Jan  4 06:43:33 2006
New Revision: 365918

URL: http://svn.apache.org/viewcvs?rev=365918&view=rev
Log: (empty)

Added:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CookiesClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.cpp.out
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.request
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/Cookies.xml

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CookiesClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CookiesClient.cpp?rev=365918&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CookiesClient.cpp (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CookiesClient.cpp Wed Jan
 4 06:43:33 2006
@@ -0,0 +1,129 @@
+// 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;
+
+        ws.setMaintainSession(true);
+        iResult = ws.add(i1, i2);
+         cout << iResult << endl;
+        iResult = ws.add(i1, i2);
+        cout << iResult << endl;
+        bSuccess = true;
+          
+        // Now create a new instance of the service and the cookies should be lost
+        Calculator calculator(endpoint);
+        calculator.setMaintainSession(true);
+        iResult = calculator.add(i1, i2);
+        cout << iResult << 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 << "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/Cookies.cpp.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.cpp.out?rev=365918&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.cpp.out (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.cpp.out Wed Jan  4
06:43:33 2006
@@ -0,0 +1,4 @@
+5
+5
+5
+---------------------- TEST COMPLETE -----------------------------

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.request
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.request?rev=365918&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.request (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies.request Wed Jan  4
06:43:33 2006
@@ -0,0 +1,49 @@
+POST /axis/CalculatorDoc HTTP/1.1
+Host: 127.0.0.1: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>
+
+POST /axis/CalculatorDoc HTTP/1.1
+Host: 127.0.0.1:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "Calculator#add"
+Content-Length: 397
+Cookie:  LtpaToken2=1234567890abcdefghijklmnopqrstuvwxyz; LtpaToken==+yOkBBuvLtTaiuBDkfgy3W6mZraGn7V5Dzp;
JSESSIONID=0000EyvJyGOS-2e9nlRijFiwKSR:-1
+
+<?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>
+
+POST /axis/CalculatorDoc HTTP/1.1
+Host: 127.0.0.1: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>
+

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies_ServerResponse.expected?rev=365918&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies_ServerResponse.expected
(added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Cookies_ServerResponse.expected
Wed Jan  4 06:43:33 2006
@@ -0,0 +1,35 @@
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Set-Cookie: LtpaToken2=1234567890abcdefghijklmnopqrstuvwxyz; Path=/ 
+Set-Cookie: LtpaToken==+yOkBBuvLtTaiuBDkfgy3W6mZraGn7V5Dzp; Path=/ 
+Set-Cookie: JSESSIONID=0000EyvJyGOS-2e9nlRijFiwKSR:-1; Path=/ 
+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><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-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><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-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><addResponse
xmlns="http://localhost/axis/Calculator"><addReturn>5</addReturn></addResponse></soapenv:Body></soapenv:Envelope>
+0
\ No newline at end of file

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/Cookies.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/Cookies.xml?rev=365918&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/Cookies.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/Cookies.xml Wed Jan  4 06:43:33
2006
@@ -0,0 +1,18 @@
+<test>
+    <name>Cookies</name>
+    <description>Test cookie support</description>
+    <clientLang>cpp</clientLang>
+    <clientCode>CookiesClient.cpp</clientCode>
+    <wsdl>CalculatorDoc.wsdl</wsdl>
+    <expected>
+        <output>
+            Cookies.cpp.out
+        </output>
+		<request>
+			Cookies.request
+		</request>
+        <serverResponse>Cookies_ServerResponse.expected</serverResponse>
+        
+    </expected>
+	<endpoint>http://localhost:80/axis/CalculatorDoc</endpoint>
+</test>



Mime
View raw message