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/06/10 14:44:54 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/client/cpp TestTransportProxyClient.cpp

hawkeye     2005/06/10 05:44:54

  Modified:    c/build  build.Linux.properties build.Win32.properties
                        executeTest.xml build.SunOS.properties
                        build.OS400.properties
               c/tests/auto_build/testcases/tests TestTransportProxy.xml
               c/tests/auto_build/testcases/client/cpp
                        TestTransportProxyClient.cpp
  Log:
  Made the HTTP proxy configurable in the test suite rather than hardcoded in the proxy tests
  
  Revision  Changes    Path
  1.26      +5 -1      ws-axis/c/build/build.Linux.properties
  
  Index: build.Linux.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/build.Linux.properties,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- build.Linux.properties	10 May 2005 14:02:28 -0000	1.25
  +++ build.Linux.properties	10 Jun 2005 12:44:54 -0000	1.26
  @@ -268,6 +268,10 @@
   
   # Details of server to be used for testing clients
   testHost = localhost
  -testPort = 8080
  +test.port = 8080
   monitorPort = 13260
   
  +# details of HTTP proxy for any proxy tests
  +proxy.host=myProxy
  +proxy.port=8080
  +
  
  
  
  1.21      +5 -1      ws-axis/c/build/build.Win32.properties
  
  Index: build.Win32.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/build.Win32.properties,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- build.Win32.properties	4 May 2005 07:40:45 -0000	1.20
  +++ build.Win32.properties	10 Jun 2005 12:44:54 -0000	1.21
  @@ -273,6 +273,10 @@
   
   # Details of server to be used for testing clients
   testHost = localhost
  -testPort = 9080
  +test.port = 9080
   monitorPort = 13260
   
  +
  +# details of HTTP proxy for any proxy tests
  +proxy.host=myProxy
  +proxy.port=8080
  \ No newline at end of file
  
  
  
  1.28      +12 -4     ws-axis/c/build/executeTest.xml
  
  Index: executeTest.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/executeTest.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- executeTest.xml	9 Jun 2005 12:45:56 -0000	1.27
  +++ executeTest.xml	10 Jun 2005 12:44:54 -0000	1.28
  @@ -58,7 +58,7 @@
   
   
   	<target name="setTestArgs"
  -		depends="setEndpoint, setForMonitor, setForNoMonitor" />
  +		depends="setEndpoint, setForMonitor, setForNoMonitor, setProxyArgs" />
   
   	<target name="setEndpoint" unless="test.endpoint">
   		<property name="clientArgs" value="" />
  @@ -93,7 +93,15 @@
   		<property name="clientArgs"
   			value="${protocol}://${testHost}:${test.port}/${context}" />
   	</target>
  -
  +	<target name="setProxyArgs">
  +		<if>
  +			<equals arg1="${test.proxyRequired}" arg2="true"/>
  +			<then>
  +				<propertyregex property="clientArgs" regexp="(${clientArgs})(.*)" replace="\1 ${proxy.host} ${proxy.port}" input="${clientArgs}" override="true"/>
  +			</then>
  +		</if>
  +	</target>
  +	
   	<target name="setVerbatim" if="test.verbatim">
   		<property name="clientArgs"
   			value="${testHost} ${test.port} ${test.endpoint}" />
  @@ -120,12 +128,12 @@
   		</if>
   
   		<echo
  -			message="Starting monitor forwarding to ${actualTestHost}:${testPort}" />
  +			message="Starting monitor forwarding to ${actualTestHost}:${test.port}" />
   		<!-- Run Monitor utility to allow validation of message across the wire -->
   		<java classname="org.apache.test.TCPMonitor"
   			outputproperty="mon.out">
   			<arg line="-l ${monitorPort}" />
  -			<arg line="-p ${testPort}" />
  +			<arg line="-p ${test.port}" />
   			<arg line="-h ${actualTestHost}" />
   			<arg line="-o &quot;${test.directory}/tcpm.req&quot;" />
   			<arg line="-r &quot;${test.directory}/tcpm.res&quot;" />
  
  
  
  1.21      +5 -1      ws-axis/c/build/build.SunOS.properties
  
  Index: build.SunOS.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/build.SunOS.properties,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- build.SunOS.properties	4 May 2005 07:40:45 -0000	1.20
  +++ build.SunOS.properties	10 Jun 2005 12:44:54 -0000	1.21
  @@ -268,6 +268,10 @@
   
   # Details of server to be used for testing clients
   testHost = localhost
  -testPort = 9080
  +test.port = 9080
   monitorPort = 13260
   
  +# details of HTTP proxy for any proxy tests
  +proxy.host=myProxy
  +proxy.port=8080
  +
  
  
  
  1.21      +5 -1      ws-axis/c/build/build.OS400.properties
  
  Index: build.OS400.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/build.OS400.properties,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- build.OS400.properties	17 May 2005 19:23:10 -0000	1.20
  +++ build.OS400.properties	10 Jun 2005 12:44:54 -0000	1.21
  @@ -267,5 +267,9 @@
   
   # Details of server to be used for testing clients
   testHost = localhost
  -testPort = 9080
  +test.port = 9080
   monitorPort = 13260
  +
  +# details of HTTP proxy for any proxy tests
  +proxy.host=myProxy
  +proxy.port=8080
  \ No newline at end of file
  
  
  
  1.3       +1 -0      ws-axis/c/tests/auto_build/testcases/tests/TestTransportProxy.xml
  
  Index: TestTransportProxy.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/tests/TestTransportProxy.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestTransportProxy.xml	7 Apr 2005 11:40:14 -0000	1.2
  +++ TestTransportProxy.xml	10 Jun 2005 12:44:54 -0000	1.3
  @@ -4,6 +4,7 @@
       <clientLang>cpp</clientLang>
       <clientCode>TestTransportProxyClient.cpp</clientCode>
       <wsdl>CalculatorDoc.wsdl</wsdl>
  +	<proxyRequired>true</proxyRequired>
       <expected>
           <output>
               TestTransportProxy.expected
  
  
  
  1.5       +26 -1     ws-axis/c/tests/auto_build/testcases/client/cpp/TestTransportProxyClient.cpp
  
  Index: TestTransportProxyClient.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/auto_build/testcases/client/cpp/TestTransportProxyClient.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestTransportProxyClient.cpp	30 Mar 2005 14:14:38 -0000	1.4
  +++ TestTransportProxyClient.cpp	10 Jun 2005 12:44:54 -0000	1.5
  @@ -15,6 +15,8 @@
   
   /*
    * This client tests setProxy() method in Stub class.
  + * NOTE: To run this you must set all three input args -
  + * <endpoint> <proxy> <proxy port>
    * 
    */
   
  @@ -25,11 +27,33 @@
   int main(int argc, char* argv[])
   {
           char endpoint[256];
  +        char proxy[256];
  +        int proxyPort;
           const char* url="http://localhost:80/axis/Calculator";
           int iResult;
           int rc=1;
   
           if(argc>1) url = argv[1];
  +        if(argc>2)
  +        { 
  +            sprintf(proxy, "%s", argv[2]);
  +        }
  +        else
  +        {
  +            cerr << "this test needs to set a url, proxy host and proxy port: TestTransportProxy <url> <proxy hostname> <proxy port>"<<endl;
  +            exit(-1);
  +        }
  +        if(argc>3)
  +        {
  +          proxyPort=atoi(argv[3]);
  +        }
  +        else
  +        {
  +            cerr << "this test needs to set a url, proxy host and proxy port: TestTransportProxy <url> <proxy hostname> <proxy port>"<<endl;
  +            exit(-1);
  +        }
  +        
  +        
   
   		bool bSuccess = false;
   		int	iRetryIterationCount = 3;
  @@ -40,7 +64,7 @@
           {
                   sprintf(endpoint, "%s", url);
                   Calculator ws(endpoint);
  -                ws.setProxy("proxy.in.ibm.com",80);
  +                ws.setProxy(proxy, proxyPort);
                   iResult = ws.add(2,3);
                   cout<<  iResult << endl;
                   rc=0;
  @@ -56,6 +80,7 @@
   				{
   					bSilent = true;
   				}
  +				
   			}
   			else
   			{