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 pr...@apache.org on 2006/02/24 15:54:37 UTC

svn commit: r380680 - /webservices/axis/trunk/c/tests/utils/monitor/org/apache/test/MockServerThread.java

Author: prestonf
Date: Fri Feb 24 06:54:35 2006
New Revision: 380680

URL: http://svn.apache.org/viewcvs?rev=380680&view=rev
Log:
Windows uses CR+LF but Unix uses only LF.  When calculating the size of a chunk, I had assumed that it would always have a CR+LF and so made adjustments for this.  Unix did not have these and so my Unit Test chunk sizes where wrong.  This fix should clear up this problem and make UT_AxisBench and UT_LargeReturningString work on Linux platforms :-)

Modified:
    webservices/axis/trunk/c/tests/utils/monitor/org/apache/test/MockServerThread.java

Modified: webservices/axis/trunk/c/tests/utils/monitor/org/apache/test/MockServerThread.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/utils/monitor/org/apache/test/MockServerThread.java?rev=380680&r1=380679&r2=380680&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/utils/monitor/org/apache/test/MockServerThread.java (original)
+++ webservices/axis/trunk/c/tests/utils/monitor/org/apache/test/MockServerThread.java Fri Feb 24 06:54:35 2006
@@ -332,9 +332,19 @@
 					    eom = true;
 				    }
 	
-					int chunkLength = hashPos - 4; // Take into account the CR LF that surround the chunk size, so subtract 4.
+					int chunkLength;
+					
+		            if( System.getProperty( "os.name").toLowerCase().startsWith( "windows"))
+		            {
+		                chunkLength = hashPos - 4; // Take into account the CR+LF's that surround the chunk size, so subtract 4.
+		            }
+		            else
+		            {
+		                chunkLength = hashPos - 2; // Take into account the LF's that surround the chunk size, so subtract 2.
+		            }
 	
 					// Add the next chunk length and data from the original to the new response.
+		                
 				    newResponse += Integer.toHexString( chunkLength) + orgResponse.substring( 0, hashPos);
 	
 				    // Remove the old chunk from the original response message.