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/17 20:36:23 UTC

cvs commit: ws-axis/c/tests/utils/monitor/org/apache/test TestClientListener.java TestClientThread.java

perryan     2005/02/17 11:36:23

  Modified:    c/build  buildTest.xml executeTest.xml
               c        test.xml
               c/tests/utils/monitor/org/apache/test
                        TestClientListener.java TestClientThread.java
  Added:       c/build  buildLibrary.xml
  Log:
  Added support to compile the generated stubs as a library and link the client code to it.
  Changed TCP monitor program not to loop with a timeout.
  
  Revision  Changes    Path
  1.6       +38 -2     ws-axis/c/build/buildTest.xml
  
  Index: buildTest.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/buildTest.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- buildTest.xml	25 Jan 2005 16:33:45 -0000	1.5
  +++ buildTest.xml	17 Feb 2005 19:36:22 -0000	1.6
  @@ -43,7 +43,9 @@
   	  -->
   	<target name="getClient" depends="copyStubClient, copyDynamicClient"/>
   
  -	<target name="copyStubClient" depends="generateStubs" unless="test.dynamicCode">
  +	<target name="copyStubClient" depends="generateStubs, copyClientCode" unless="test.dynamicCode"/>
  +
  +	<target name="copyClientCode" unless="test.dynamicCode">
   		<copy file="${client.code}" todir="${test.directory}"/>
   	</target>
   
  @@ -59,7 +61,17 @@
   	<!--
   	  Compile test client
   	  -->
  -	<target name="compileClient" depends="getClient">
  +	<target name="compileClient" depends="callCompileStaticClient, callCompileLinkedClient"/>
  +
  +	<target name="callCompileStaticClient" unless="test.stubAsLibrary">
  +		<antcall target="compileStaticClient" inheritall="true"/>
  +	</target>
  +	<target name="callCompileLinkedClient" if="test.stubAsLibrary">
  +		<property name="libraryName" value="${testName}"/>
  +		<antcall target="compileLinkedClient" inheritall="true"/>
  +	</target>
  +
  +	<target name="compileStaticClient" depends="getClient">
   		<cc failonerror="false" incremental="false" outfile="${test.directory}/${testName}"
   		 objdir="${test.directory}" exceptions="true"
   		 outtype="executable" subsystem="console">
  @@ -81,5 +93,29 @@
   		</cc>
   	</target>
   
  +	<target name="compileLinkedClient" depends="generateStubs, compileLibrary, copyClientCode">
  +		<basename file="${client.code}" property="client.source"/>
  +		<cc failonerror="false" incremental="false" outfile="${test.directory}/${testName}"
  +		 objdir="${test.directory}" exceptions="true"
  +		 outtype="executable" subsystem="console">
  +		 	<!-- Compilers -->
  +			<compiler refid="VisualC++"/>
  +			<compiler refid="Linuxgcc"/>
  +			<compiler refid="AIXxlc"/>
  +			<!-- Linkers -->
  +			<linker refid="VisualC++Linker"/>
  +			<linker refid="LinuxLinker"/>
  +			<linker refid="AIXExecutableLinker"/>
  +			<!-- Axis Client .lib file location, or UNIX shared object -->
  +			<libset dir="${dir.lib}" libs="${clientLibraryName}"/>
  +			<libset dir="${test.directory}" libs="${libraryName}"/>
  +			<!-- Files to be compiled -->
  +			<includepath path="${dir.include}"/>
  +			<fileset dir="${test.directory}">
  +				<include name="${client.source}"/>
  +			</fileset>
  +		</cc>
  +	</target>
  +
   </project>
   
  
  
  
  1.18      +5 -4      ws-axis/c/build/executeTest.xml
  
  Index: executeTest.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/build/executeTest.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- executeTest.xml	16 Feb 2005 15:11:13 -0000	1.17
  +++ executeTest.xml	17 Feb 2005 19:36:22 -0000	1.18
  @@ -73,7 +73,7 @@
   	<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">
  +		<java classname="org.apache.test.TCPMonitor" fork="true" outputproperty="mon.out">
   			<arg line="-l ${monitorPort}"/>
   			<arg line="-p ${testPort}"/>
   			<arg line="-h ${testHost}"/>
  @@ -83,6 +83,7 @@
   				<pathelement location="${basedir}/tests/utils/monitor/monitor.jar"/>
   			</classpath>
   		</java>
  +		<echo message="MONITOR OUTPUT=${mon.out}"/>
   	</target>
   	<target name="stopMonitor" unless="test.nomonitor">
   		<java classname="org.apache.test.StopTCPMonitor">
  @@ -116,9 +117,9 @@
   						 output="${results.stdout}" error="${results.stderr}"
   						 failifexecutionfails="false" vmlauncher="false">
   							<arg line="${clientArgs}"/>
  -							<env key="PATH" path="${java.library.path}${path.separator}${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.eay.dir}"/>
  -							<env key="LD_LIBRARY_PATH" path="${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.dir}/lib"/>
  -							<env key="LIBPATH" path="${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.dir}/lib"/>
  +							<env key="PATH" path="${java.library.path}${path.separator}${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.eay.dir}${path.separator}${test.directory}"/>
  +							<env key="LD_LIBRARY_PATH" path="${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.dir}/lib${path.separator}${test.directory}"/>
  +							<env key="LIBPATH" path="${dir.libraries}${path.separator}${dir.xmlParser}${path.separator}${HTTP.SSLChannel.dir}/lib${path.separator}${test.directory}"/>
   							<env key="AXISCPP_DEPLOY" value="${axiscpp_deploy}"/>
   						</exec>
   
  
  
  
  1.1                  ws-axis/c/build/buildLibrary.xml
  
  Index: buildLibrary.xml
  ===================================================================
  <project name="buildLibrary" default="compileLibrary" basedir="..">
  
  	<target name="compileLibrary">
  
  		<if>
  		<not>
  			<isset property="aix"/>
  		</not>
  		<then>
  			<cc outfile="${test.directory}/${libraryName}" objdir="${test.directory}"
  				exceptions="true" outtype="shared" multithreaded="true">
  				<!-- Compilers -->
  				<compiler refid="SolarisCC"/>
  				<compiler refid="Linuxgcc"/>
  				<compiler extends="VisualC++"/>
  				<defineset>
  					<define name="ENABLE_AXISTRACE" if="trace"/>
  					<define name="AXISTRACE_LIBRARY"/>
  				</defineset>
  				<compiler refid="OS400icc"/>
  				<!-- Linkers -->
  				<linker refid="SolarisLinker"/>
  				<linker refid="LinuxLinker"/>
  				<linker refid="VisualC++Linker"/>
  				<linker refid="OS400Linker"/>
  
  				<!-- Files to compile -->
  				<fileset dir="${test.directory}">
  					<include name="*.cpp"/>
  				</fileset>
  			</cc>
  		</then>
  		<else>
  			<cc outfile="${test.directory}/${libraryPrefix}${libraryName}${librarySuffix}" objdir="${test.directory}"
  				exceptions="true" multithreaded="true">
  				<!-- Compilers -->
  				<compiler refid="AIXxlc"/>
  				<defineset>
  					<define name="ENABLE_AXISTRACE" if="trace"/>
  					<define name="AXISTRACE_LIBRARY"/>
  				</defineset>
  
  				<!-- Linkers -->
  				<linker refid="AIXLinker"/>
  				<!-- Files to compile -->
  				<fileset dir="${test.directory}">
  					<include name="*.cpp"/>
  				</fileset>
  			</cc>
  		</else>
  		</if>
  	</target>
  
  </project>
  
  
  
  
  1.26      +1 -0      ws-axis/c/test.xml
  
  Index: test.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/test.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- test.xml	8 Feb 2005 15:24:19 -0000	1.25
  +++ test.xml	17 Feb 2005 19:36:22 -0000	1.26
  @@ -7,6 +7,7 @@
   	<import file="${basedir}/build/buildHandler.xml"/>
   	<import file="${basedir}/build/executeTest.xml"/>
   	<import file="${basedir}/build/buildMonitor.xml"/>
  +	<import file="${basedir}/build/buildLibrary.xml"/>
   
   
   	<!--
  
  
  
  1.2       +3 -3      ws-axis/c/tests/utils/monitor/org/apache/test/TestClientListener.java
  
  Index: TestClientListener.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/utils/monitor/org/apache/test/TestClientListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestClientListener.java	20 Oct 2004 13:24:29 -0000	1.1
  +++ TestClientListener.java	17 Feb 2005 19:36:23 -0000	1.2
  @@ -69,8 +69,9 @@
   			TestClientThread requestReader = null;
   			TestClientThread responseReader = null;
   			while (stayAlive == true) {
  -				server.setSoTimeout(500);
  +				//server.setSoTimeout(500);
   				try {
  +					clientSocket = server.accept();
   					try {
   						serviceSocket = new Socket(serviceHost, servicePort);
   					} catch (Exception se) {
  @@ -78,7 +79,6 @@
   						stayAlive = false;
   						continue;
   					}
  -					clientSocket = server.accept();
   					requestReader = new TestClientThread(clientSocket, serviceSocket, CAPTURE_REQUEST);
   					responseReader = new TestClientThread(clientSocket, serviceSocket, CAPTURE_RESPONSE);
   					requestReader.start();
  @@ -122,7 +122,7 @@
   				serviceSocket.close();
   			server.close();
   		} catch (IOException ioe) {
  -			ioe.printStackTrace(System.err);
  +			//ioe.printStackTrace(System.err);
   		}
   		server = null;
   		stayAlive = false;
  
  
  
  1.2       +1 -2      ws-axis/c/tests/utils/monitor/org/apache/test/TestClientThread.java
  
  Index: TestClientThread.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/utils/monitor/org/apache/test/TestClientThread.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestClientThread.java	20 Oct 2004 13:24:29 -0000	1.1
  +++ TestClientThread.java	17 Feb 2005 19:36:23 -0000	1.2
  @@ -68,7 +68,6 @@
   				dos = new BufferedWriter(new OutputStreamWriter(clientSocket.getOutputStream()));
   				dis = new BufferedReader(new InputStreamReader(serviceSocket.getInputStream()));
   			}
  -
   			int readReturn = 0;
   			while( (readReturn = dis.read(buffer, 0, 4096)) != -1 ){
   				String inputLine = new String(buffer, 0 , readReturn);
  @@ -90,7 +89,7 @@
   				dos.flush();
   			}
   
  -		} catch (EOFException e) {
  +		} catch (EOFException eof) {
   		} catch (IOException e) {
   		} finally {
   			try {