On Mon, Aug 18, 2008 at 2:24 AM,  <nextgens at freenetproject.org> wrote:
> Author: nextgens
> Date: 2008-08-17 18:24:10 +0000 (Sun, 17 Aug 2008)
> New Revision: 21976
>
> Added:
>   trunk/freenet/src/freenet/support/io/MockInputStream.java

Why extract it as top-level class?

MockInputStream is used only in the test cases..
Put it under trunk/freenet/test

> Modified:
>   trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java
> Log:
> bug #2501: fix the test
> Added: trunk/freenet/src/freenet/support/io/MockInputStream.java
> ===================================================================
> --- trunk/freenet/src/freenet/support/io/MockInputStream.java                 
>           (rev 0)
> +++ trunk/freenet/src/freenet/support/io/MockInputStream.java   2008-08-17 
> 18:24:10 UTC (rev 21976)
> @@ -0,0 +1,20 @@
> +/* This code is part of Freenet. It is distributed under the GNU General
> + * Public License, version 2 (or at your option any later version). See
> + * http://www.gnu.org/ for further details of the GPL. */
> +package freenet.support.io;
> +
> +import java.io.InputStream;
> +
> +public class MockInputStream extends InputStream {
> +
> +       public MockInputStream() {
> +       }
> +
> +       public int read() {
> +               return -1;
> +       }
> +
> +       public int read(byte[] data, int offset, int len) {
> +               return len;
> +       }
> +}
> \ No newline at end of file
>
> Modified: 
> trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java
> ===================================================================
> --- trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java     
>   2008-08-17 18:18:33 UTC (rev 21975)
> +++ trunk/freenet/test/freenet/support/io/LineReadingInputStreamTest.java     
>   2008-08-17 18:24:10 UTC (rev 21976)
> @@ -28,18 +28,6 @@
>        public static final int MAX_LENGTH = 128;
>        public static final int BUFFER_SIZE = 128;
>
> -       public class MockInputStream extends InputStream {
> -               public MockInputStream() {}
> -
> -               public int read() {
> -                       return -1;
> -               }
> -
> -               public int read(byte[] data, int offset, int len) {
> -                       return len;
> -               }
> -       }
> -
>        public void testReadLineWithoutMarking() throws Exception {
>                // try utf8
>                InputStream is = new 
> ByteArrayInputStream(STRESSED_LINE.getBytes("utf-8"));
>
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
>

Reply via email to