harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hindess <mark.hind...@googlemail.com>
Subject Re: svn commit: r413727 - /incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/SinkChannelTest.java
Date Mon, 12 Jun 2006 19:32:47 GMT

That's working much better now.  Thanks George.

-Mark.

On 12 June 2006 at 19:17, gharley@apache.org wrote:
> Author: gharley
> Date: Mon Jun 12 12:17:12 2006
> New Revision: 413727
> 
> URL: http://svn.apache.org/viewvc?rev=413727&view=rev
> Log:
> Another attempt at fixing the unstable (on Linux) unit test. Ensure we have r
> ead off all of the expected
> bytes before testing with JUnit assert. 
> 
> Modified:
>     incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/a
> pache/harmony/tests/java/nio/channels/SinkChannelTest.java
> 
> Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java
> /org/apache/harmony/tests/java/nio/channels/SinkChannelTest.java
> URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/m
> odules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/SinkChann
> elTest.java?rev=413727&r1=413726&r2=413727&view=diff
> =============================================================================
> =
> --- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/a
> pache/harmony/tests/java/nio/channels/SinkChannelTest.java (original)
> +++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/a
> pache/harmony/tests/java/nio/channels/SinkChannelTest.java Mon Jun 12 12:17:1
> 2 2006
> @@ -125,13 +125,21 @@
>              thread[i].join();
>          }
>          ByteBuffer readBuf = ByteBuffer.allocate(THREAD_NUM * BUFFER_SIZE);
> -        long readVal = source.read(readBuf);
> +        
> +        long totalCount = 0;
> +        do {
> +            long count = source.read(readBuf);
> +            if (count < 0) {
> +                break;
> +            }
> +            totalCount += count;
> +        } while (totalCount != (THREAD_NUM * BUFFER_SIZE));
> +        
>          StringBuffer buf = new StringBuffer();
>          for (int i = 0; i < THREAD_NUM; i++) {
>              buf.append("bytes");
>          }
>          String readString = buf.toString();
> -        assertEquals(readString.length(), readVal);
>          assertEquals(readString, new String(readBuf.array(), ISO8859_1));
>  	}
>  
> 



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message