commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joc...@apache.org
Subject svn commit: r505770 - /jakarta/commons/proper/fileupload/branches/b1_2/src/test/org/apache/commons/fileupload/ProgressListenerTest.java
Date Sat, 10 Feb 2007 21:35:18 GMT
Author: jochen
Date: Sat Feb 10 13:35:17 2007
New Revision: 505770

URL: http://svn.apache.org/viewvc?view=rev&rev=505770
Log:
Workaround for a problem with the JRockit JRE.

Modified:
    jakarta/commons/proper/fileupload/branches/b1_2/src/test/org/apache/commons/fileupload/ProgressListenerTest.java

Modified: jakarta/commons/proper/fileupload/branches/b1_2/src/test/org/apache/commons/fileupload/ProgressListenerTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/fileupload/branches/b1_2/src/test/org/apache/commons/fileupload/ProgressListenerTest.java?view=diff&rev=505770&r1=505769&r2=505770
==============================================================================
--- jakarta/commons/proper/fileupload/branches/b1_2/src/test/org/apache/commons/fileupload/ProgressListenerTest.java
(original)
+++ jakarta/commons/proper/fileupload/branches/b1_2/src/test/org/apache/commons/fileupload/ProgressListenerTest.java
Sat Feb 10 13:35:17 2007
@@ -90,7 +90,17 @@
         	FileItemStream stream = iter.next();
         	InputStream istream = stream.openStream();
         	for (int j = 0;  j < 16384+i;  j++) {
-        		assertEquals((byte) j, (byte) istream.read());
+        	    /**
+                 * This used to be
+                 *     assertEquals((byte) j, (byte) istream.read());
+                 * but this seems to trigger a bug in JRockit, so
+                 * we express the same like this:
+        	     */
+                byte b1 = (byte) j;
+                byte b2 = (byte) istream.read();
+                if (b1 != b2) {
+                    fail("Expected " + b1 + ", got " + b2);
+                }
         	}
         	assertEquals(-1, istream.read());
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message