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 pe...@apache.org on 2005/02/08 16:24:19 UTC

cvs commit: ws-axis/c test.xml

perryan     2005/02/08 07:24:19

  Modified:    c/build  executeTest.xml testInitialize.xml
               c/docs   anttest-guide.html
               c        test.xml
  Log:
  Added support for SSL testing into the Ant test framework.
  Updated test guide to reflect changes made.
  
  Revision  Changes    Path
  1.13      +54 -21    ws-axis/c/build/executeTest.xml
  
  Index: executeTest.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/executeTest.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- executeTest.xml	7 Feb 2005 12:58:13 -0000	1.12
  +++ executeTest.xml	8 Feb 2005 15:24:19 -0000	1.13
  @@ -31,13 +31,13 @@
   		<replaceregexp file="${r_expected.file}" match="Host: localhost:[0-9]*" replace="Host: localhost:${monitorPort}" byline="true"/>
   	</target>
   
  -	<target name="setTestArgs" depends="setEndpoint, setForMonitor"/>
  +	<target name="setTestArgs" depends="setEndpoint, setForMonitor, setForNoMonitor"/>
   
   	<target name="setEndpoint" unless="test.endpoint">
   		<property name="clientArgs" value="" />
   	</target>
   
  -	<target name="setForMonitor" if="test.endpoint">
  +	<target name="setForMonitor" if="test.endpoint" unless="test.nomonitor">
   		<propertyregex property="protocol" input="${test.endpoint}"
   			           regexp="(.*)://" select="\1"/>
   
  @@ -50,6 +50,50 @@
   		<property name="clientArgs" value="${protocol}://localhost:${monitorPort}/${context}"/>
   	</target>
   
  +	<target name="setForNoMonitor" depends="checkIfEndpointSet" if="endpoint.ok">
  +		<propertyregex property="protocol" input="${test.endpoint}"
  +			           regexp="(.*)://" select="\1"/>
  +
  +        <propertyregex property="restOfURL" input="${test.endpoint}"
  +                       regexp="://(.*)" select="\1"/>
  +
  +        <propertyregex property="context" input="${restOfURL}"
  +                       regexp="/(.*)" select="\1"/>
  +
  +		<property name="clientArgs" value="${protocol}://${testHost}:${testPort}/${context}"/>
  +	</target>
  +
  +	<target name="checkIfEndpointSet">
  +		<condition property="endpoint.ok">
  +			<isset property="test.endpoint"/>
  +		</condition>
  +		<fail message="Endpoint not specified" unless="endpoint.ok"/>
  +	</target>
  +
  +	<target name="startMonitor" unless="test.nomonitor">
  +		<echo message="Starting monitor forwarding to ${testHost}:${testPort}"/>
  +		<!-- Run Monitor utility to allow validation of message across the wire -->
  +		<java classname="org.apache.test.TCPMonitor" fork="true">
  +			<arg line="-l ${monitorPort}"/>
  +			<arg line="-p ${testPort}"/>
  +			<arg line="-h ${testHost}"/>
  +			<arg line="-o ${test.directory}/tcpm.req"/>
  +			<arg line="-r ${test.directory}/tcpm.res"/>
  +			<classpath>
  +				<pathelement location="${basedir}/tests/utils/monitor/monitor.jar"/>
  +			</classpath>
  +		</java>
  +	</target>
  +	<target name="stopMonitor" unless="test.nomonitor">
  +		<java classname="org.apache.test.StopTCPMonitor">
  +			<arg line="-p ${monitorPort}"/>
  +			<arg line="-h localhost"/>
  +			<classpath>
  +				<pathelement location="${basedir}/tests/utils/monitor/monitor.jar"/>
  +			</classpath>
  +		</java>
  +	</target>
  +
   	<!--
   	  Execute the test
   	  -->
  @@ -58,18 +102,8 @@
   		<trycatch>
   			<try>
   				<parallel timeout="60000" failonany="false">
  -					<echo message="Starting monitor forwarding to ${testHost}:${testPort}"/>
  -					<!-- Run Monitor utility to allow validation of message across the wire -->
  -					<java classname="org.apache.test.TCPMonitor" fork="true">
  -						<arg line="-l ${monitorPort}"/>
  -						<arg line="-p ${testPort}"/>
  -						<arg line="-h ${testHost}"/>
  -						<arg line="-o ${test.directory}/tcpm.req"/>
  -						<arg line="-r ${test.directory}/tcpm.res"/>
  -						<classpath>
  -							<pathelement location="${basedir}/tests/utils/monitor/monitor.jar"/>
  -						</classpath>
  -					</java>
  +
  +					<antcall target="startMonitor" inheritall="true"/>
   		
   					<sequential>
   						<!-- Wait for jvm to start monitor program -->
  @@ -87,22 +121,21 @@
   							<env key="LIBPATH" path="${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.dir}/lib"/>
   							<env key="AXISCPP_DEPLOY" value="${axiscpp_deploy}"/>
   						</exec>
  +
   						<stopwatch name="${testName}.timer" action="total"/>
   						<propertycopy property="timer1" from="${testName}.timer"/>
    						<echo file="${results.log}" append="true"
    		 				      message="${testName} - Execution Time - ${timer1}${line.separator}"/>
   						<echo message="${testName} - Execution Time - ${timer1}"/>
  -						<java classname="org.apache.test.StopTCPMonitor">
  -							<arg line="-p ${monitorPort}"/>
  -							<arg line="-h localhost"/>
  -							<classpath>
  -								<pathelement location="${basedir}/tests/utils/monitor/monitor.jar"/>
  -							</classpath>
  -						</java>
  +
  +						<antcall target="stopMonitor" inheritall="true"/>
  +
   					</sequential>
   				</parallel>
   			</try>
   			<catch>
  +				<echo message="Exception in Ant try/catch block"/>
  +				<antcall target="stopMonitor" inheritall="true"/>
   			</catch>
   			<finally>
   				<sleep seconds="1"/>
  
  
  
  1.2       +4 -1      ws-axis/c/build/testInitialize.xml
  
  Index: testInitialize.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/testInitialize.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testInitialize.xml	11 Dec 2004 15:26:14 -0000	1.1
  +++ testInitialize.xml	8 Feb 2005 15:24:19 -0000	1.2
  @@ -27,7 +27,7 @@
   	<!--
   	  Load the xml properties file for test and derive required properties
   	  -->
  -	<target name="setPropertiesForTest" depends="loadXMLProperties,setTestName,setTestDesc,setTestCode,setClientLang,setTestWsdl,setTestEndpoint,setTestExpected,setTestExpectedRequest,setHandlerDirectory,setHandlerService,setHandlersPresent"/>
  +	<target name="setPropertiesForTest" depends="loadXMLProperties,setTestName,setTestDesc,setTestCode,setClientLang,setTestWsdl,setTestEndpoint,setTestExpected,setTestExpectedRequest,setHandlerDirectory,setHandlerService,setHandlersPresent,setTestPort"/>
   
   	<target name="loadXMLProperties">
   		<echo message="Loading XML file ${test_property}"/>
  @@ -63,6 +63,9 @@
   	<target name="setHandlerService" if="test.handler.service">
   		<propertycopy property="serviceName" from="test.handler.service"/>
   	</target>
  +	<target name="setTestPort" if="test.port">
  +		<propertycopy property="testPort" from="test.port" override="true"/>
  +	</target>
   	<!--
   	  Only set HandlersPresent if all info available
   	  -->
  
  
  
  1.3       +49 -8     ws-axis/c/docs/anttest-guide.html
  
  Index: anttest-guide.html
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/docs/anttest-guide.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- anttest-guide.html	25 Jan 2005 16:33:45 -0000	1.2
  +++ anttest-guide.html	8 Feb 2005 15:24:19 -0000	1.3
  @@ -274,7 +274,6 @@
   
       <p>
       The optional tags shown in example 2 are detailed below.
  -    </p>
   
       <DL>
           <DT>&lt;request&gt;</DT>
  @@ -294,9 +293,51 @@
               match the service portion of the SOAPAction of the request being 
               sent to the service.</DD>
       </DL>
  +    </p>
  +
  +
  +
  +	 <p>
  +	 The example 3 shows all the additional tags that are available for tests.
  +    </p>
  +
  +    <div class="example">
  +    <pre>
  +
  +     &lt;test&gt;
  +        &lt;name&gt;CalculatorDocSSL&lt;/name&gt;
  +		  &lt;description&gt;CalculatorDoc using SSL&lt;/description&gt;
  +        &lt;clientLang&gt;cpp&lt;/clientLang&gt;
  +        &lt;clientCode&gt;CalculatorDocSSLClient.cpp&lt;/clientCode&gt;
  +        &lt;wsdl&gt;CalculatorDoc.wsdl&lt;/wsdl&gt;
  +        &lt;expected&gt;
  +            &lt;output&gt;
  +                CalculatorDoc.cpp.out
  +            &lt;/output&gt;
  +        &lt;/expected&gt;
  +        &lt;endpoint&gt;https://localhost:80/Calculator/services/Calculator&lt;/endpoint&gt;
  +        &lt;nomonitor&gt;true&lt;/nomonitor&gt;
  +        &lt;port&gt;9443&lt;/port&gt;
  +    &lt;/test&gt;
  +    </pre>
  +    </div>
  +    <p class="example">example 3</p>
  +
  +    <p>
  +    The optional tags shown in example 3 are detailed below.
  +
  +    <DL>
  +		  <DT>&lt;nomonitor&gt;</DT>
  +		  <DD>This tells the framework not to invoke the <a href="#monitor">TCP monitor utility</a> when sending a request. This means that the message on-the-wire will not be checked. This is required for SSL tests as the monitor cannot operate over SSL</DD>
  +
  +        <DT>&lt;port&gt;</DT>
  +		  <DD>This is the port to send the request to. This will override the testPort property specified in the main Ant properties files or on the command line. This is used so that SSL tests can specify the SSL port of the service without having to do 2 tests runs.</DD>
  +
  +    </DL>
  +    </p>
   
   	 <p>
  -	 The example 3 shows all the optional tags that are available for dynamic client tests <a href="#dynamic">(See Dynamic Clients)</a>.
  +	 The example 4 shows all the optional tags that are available for dynamic client tests <a href="#dynamic">(See Dynamic Clients)</a>.
       </p>
   
       <div class="example">
  @@ -318,10 +359,10 @@
       &lt;/test&gt;
       </pre>
       </div>
  -    <p class="example">example 3</p>
  +    <p class="example">example 4</p>
   
       <p>
  -    The optional tags shown in example 3 are detailed below.
  +    The optional tags shown in example 4 are detailed below.
       </p>
   
       <DL>
  @@ -349,7 +390,7 @@
   <br/>
   e.g.
   <br/>
  -In example 2 above a directory of handler_chain was specified. This directory is the parent of the library directories, but a sub directory of the ws-axis/c/tests/auto_build/testcases/handlers/ directory. The handler_chain directory structure is shown in example 4
  +In example 2 above a directory of handler_chain was specified. This directory is the parent of the library directories, but a sub directory of the ws-axis/c/tests/auto_build/testcases/handlers/ directory. The handler_chain directory structure is shown in example 5
   </p>
   <div class="example">
   	<pre>
  @@ -365,7 +406,7 @@
   	</code>
   	</pre>
   </div>
  -    <p class="example">example 4</p>
  +    <p class="example">example 5</p>
   
   <p>
   When built this will produce 2 libraries in the test output directory called libtesthandler.so and libtesthandler2.so on Linux and testhandler.dll and testhandler2.dll on Windows.
  @@ -382,7 +423,7 @@
   <br/>
   e.g.
   <br/>
  -In example 3 above a dynamicCodeDirectory of Test01 was specified. This directory is a sub directory of the ws-axis/c/tests/auto_build/testcases/dynamic directory. This directory structure is shown in example 5.
  +In example 5 above a dynamicCodeDirectory of Test01 was specified. This directory is a sub directory of the ws-axis/c/tests/auto_build/testcases/dynamic directory. This directory structure is shown in example 6.
   </p>
   <div class="example">
   	<pre>
  @@ -392,7 +433,7 @@
   	</code>
   	</pre>
   </div>
  -    <p class="example">example 5</p>
  +    <p class="example">example 6</p>
   
   
   <h2 id="monitor">TCP Monitor Utility</h2>
  
  
  
  1.25      +1 -1      ws-axis/c/test.xml
  
  Index: test.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/test.xml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- test.xml	13 Dec 2004 15:43:24 -0000	1.24
  +++ test.xml	8 Feb 2005 15:24:19 -0000	1.25
  @@ -99,7 +99,7 @@
   		<property name="results.stderr" value="${test.directory}/${testName}.err"/>
   	</target>
   
  -	<target name="checkIfRequestFile" if="testExpectedRequest">
  +	<target name="checkIfRequestFile" if="testExpectedRequest" unless="test.nomonitor">
   		<available file="${dir.autotests}/output/${testExpectedRequest}" property="requestFileExists"/>
   	</target>