You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by st...@apache.org on 2012/08/28 13:32:44 UTC
svn commit: r1378082 - in /maven/shared/trunk/maven-shared-utils/src:
main/java/org/apache/maven/shared/utils/io/IOUtil.java
test/java/org/apache/maven/shared/utils/io/
test/java/org/apache/maven/shared/utils/io/IOUtilTest.java
Author: struberg
Date: Tue Aug 28 11:32:43 2012
New Revision: 1378082
URL: http://svn.apache.org/viewvc?rev=1378082&view=rev
Log:
MSHARED-236 move IOUtil from verifier and test from sandbox pu
* IOUtil originally from ant, copied over from maven-verifier
* IOUtilTest written by stephenc
Added:
maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
- copied, changed from r1378054, maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/util/IOUtil.java
maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/
maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/IOUtilTest.java
- copied, changed from r1195967, maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java
Copied: maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java (from r1378054, maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/util/IOUtil.java)
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java?p2=maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java&p1=maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/util/IOUtil.java&r1=1378054&r2=1378082&rev=1378082&view=diff
==============================================================================
--- maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/util/IOUtil.java (original)
+++ maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java Tue Aug 28 11:32:43 2012
@@ -1,4 +1,4 @@
-package org.apache.maven.it.util;
+package org.apache.maven.shared.utils.io;
/*
* Licensed to the Apache Software Foundation (ASF) under one
Copied: maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/IOUtilTest.java (from r1195967, maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java)
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/IOUtilTest.java?p2=maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/IOUtilTest.java&p1=maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java&r1=1195967&r2=1378082&rev=1378082&view=diff
==============================================================================
--- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java (original)
+++ maven/shared/trunk/maven-shared-utils/src/test/java/org/apache/maven/shared/utils/io/IOUtilTest.java Tue Aug 28 11:32:43 2012
@@ -1,4 +1,4 @@
-package org.codehaus.plexus.util;
+package org.apache.maven.shared.utils.io;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,10 +19,6 @@ package org.codehaus.plexus.util;
* under the License.
*/
-import org.apache.maven.tck.FixPlexusBugs;
-import org.apache.maven.tck.ReproducesPlexusBug;
-import org.apache.maven.tck.Task;
-import org.junit.Rule;
import org.junit.Test;
import java.io.BufferedInputStream;
@@ -41,26 +37,15 @@ import java.io.UnsupportedEncodingExcept
import java.io.Writer;
import java.util.concurrent.atomic.AtomicBoolean;
-import static org.apache.maven.tck.TckMatchers.isUtilityClass;
-import static org.apache.maven.tck.TckMatchers.runsForLongerThan;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class IOUtilTest
{
- @Rule
- public FixPlexusBugs fixPlexusBugs = new FixPlexusBugs();
private static final long INFINITE_LOOP_TIMEOUT = 500;
@Test
- public void isAUtilityClass()
- throws Exception
- {
- assertThat( IOUtil.class, isUtilityClass() );
- }
-
- @Test
public void closeReaderWithNull()
throws Exception
{
@@ -401,37 +386,6 @@ public class IOUtilTest
IOUtil.toString( nullByteArray(), 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringEmptyByteArrayZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toString( emptyByteArray(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringByteArrayZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toString( probe.getBytes(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void toStringNullByteArrayPosBufSz()
throws Exception
@@ -639,37 +593,6 @@ public class IOUtilTest
IOUtil.toString( nullByteArray(), "utf-16", 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringEmptyByteArrayValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toString( emptyByteArray(), "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringByteArrayValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toString( probe.getBytes(), "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
/*
* copy(byte[],OutputStream)
*/
@@ -933,24 +856,6 @@ public class IOUtilTest
{
IOUtil.copy( new DontCloseByteArrayInputStream( emptyByteArray() ), new DontCloseByteArrayOutputStream(), 0 );
}
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyInputStreamValidOutputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- ByteArrayOutputStream outputStream = new DontCloseByteArrayOutputStream();
- byte[] input = { 1, 2, 3, 4, 5, 6 };
- IOUtil.copy( new DontCloseByteArrayInputStream( input ), outputStream, 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class, timeout = INFINITE_LOOP_TIMEOUT )
public void copyNullInputStreamNullOutputStreamPosBufSz()
throws Exception
@@ -1041,37 +946,6 @@ public class IOUtilTest
IOUtil.toString( nullInputStream(), 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringEmptyInputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toString( emptyInputStream(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringInputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void toStringNullInputStreamPosBufSz()
throws Exception
@@ -1288,37 +1162,6 @@ public class IOUtilTest
IOUtil.toString( nullInputStream(), "utf-16", 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringEmptyInputStreamValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toString( emptyInputStream(), "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringInputStreamValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = IOException.class )
public void bufferedCopyNullInputStreamNullOutputStream()
throws Exception
@@ -1467,38 +1310,6 @@ public class IOUtilTest
IOUtil.copy( emptyInputStream(), nullWriter(), 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyInputStreamValidWriterZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.copy( emptyInputStream(), new DontCloseStringWriter(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyInputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- StringWriter writer = new DontCloseStringWriter();
- IOUtil.copy( new ByteArrayInputStream( probe.getBytes() ), writer, 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void copyNullInputStreamNullWriterPosBufSz()
throws Exception
@@ -1933,38 +1744,6 @@ public class IOUtilTest
IOUtil.copy( nullInputStream(), new DontCloseStringWriter(), "utf-16", 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyInputStreamValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.copy( emptyInputStream(), new DontCloseStringWriter(), "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyInputStreamValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.copy( new ByteArrayInputStream( probe.getBytes() ), new DontCloseStringWriter(),
- "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
/*
* copy(String,Writer)
*/
@@ -2133,50 +1912,6 @@ public class IOUtilTest
{
IOUtil.copy( nullString(), new DontCloseByteArrayOutputStream(), 0 );
}
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyStringValidOutputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- ByteArrayOutputStream OutputStream = new DontCloseByteArrayOutputStream();
- IOUtil.copy( emptyString(), OutputStream, 0 );
- assertThat( OutputStream.toByteArray(), is( emptyString().getBytes() ) );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( expected = NullPointerException.class, timeout = INFINITE_LOOP_TIMEOUT )
- public void copyStringNullOutputStreamZeroBufSz()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.copy( probe, nullOutputStream(), 0 );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyStringValidOutputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- ByteArrayOutputStream OutputStream = new DontCloseByteArrayOutputStream();
- IOUtil.copy( probe, OutputStream, 0 );
- assertThat( OutputStream.toByteArray(), is( probe.getBytes() ) );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void copyNullStringNullOutputStreamPosBufSz()
throws Exception
@@ -2346,47 +2081,6 @@ public class IOUtilTest
IOUtil.copy( nullReader(), new DontCloseStringWriter(), 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyReaderValidWriterZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- StringWriter writer = new DontCloseStringWriter();
- IOUtil.copy( emptyReader(), writer, 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( expected = NullPointerException.class, timeout = INFINITE_LOOP_TIMEOUT )
- public void copyReaderNullWriterZeroBufSz()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.copy( new StringReader( probe ), nullWriter(), 0 );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyReaderValidWriterZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- StringWriter writer = new DontCloseStringWriter();
- IOUtil.copy( new StringReader( probe ), writer, 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void copyNullReaderNullWriterPosBufSz()
throws Exception
@@ -2455,38 +2149,6 @@ public class IOUtilTest
IOUtil.toByteArray( nullInputStream(), -1 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toByteArrayFromInputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toByteArray( new DontCloseByteArrayInputStream( IOUtil.toByteArray( probe ) ), 0 );
- }
- }, runsForLongerThan( 100 ) );
-
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toByteArrayNullInputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toByteArray( nullInputStream(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test
public void toByteArrayFromInputStreamPosBufSz()
throws Exception
@@ -2523,38 +2185,6 @@ public class IOUtilTest
IOUtil.toByteArray( nullReader(), -1 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toByteArrayFromReaderZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toByteArray( new DontCloseStringReader( probe ), 0 );
- }
- }, runsForLongerThan( 100 ) );
-
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toByteArrayNullReaderZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toByteArray( nullReader(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test
public void toByteArrayFromReaderPosBufSz()
throws Exception
@@ -2590,38 +2220,6 @@ public class IOUtilTest
IOUtil.toByteArray( nullString(), -1 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toByteArrayFromStringZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toByteArray( probe, 0 );
- }
- }, runsForLongerThan( 100 ) );
-
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toByteArrayNullStringZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toByteArray( nullString(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test
public void toByteArrayFromStringPosBufSz()
throws Exception
@@ -2657,38 +2255,6 @@ public class IOUtilTest
IOUtil.toString( nullReader(), -1 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringFromReaderZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.toString( new DontCloseStringReader( probe ), 0 );
- }
- }, runsForLongerThan( 100 ) );
-
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void toStringNullReaderZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.toString( nullReader(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test
public void toStringFromReaderPosBufSz()
throws Exception
@@ -2810,38 +2376,6 @@ public class IOUtilTest
IOUtil.copy( emptyReader(), nullOutputStream(), 0 );
}
- @Test(timeout = INFINITE_LOOP_TIMEOUT)
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyReaderValidOutputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.copy( emptyReader(), new DontCloseByteArrayOutputStream(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test(timeout = INFINITE_LOOP_TIMEOUT)
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyReaderValidOutputStreamZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- ByteArrayOutputStream outputStream = new DontCloseByteArrayOutputStream();
- String probe = "A string \u2345\u00ef";
- IOUtil.copy( new DontCloseStringReader( probe ), outputStream, 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void copyNullReaderNullOutputStreamPosBufSz()
throws Exception
@@ -3004,38 +2538,6 @@ public class IOUtilTest
IOUtil.copy( emptyByteArray(), nullWriter(), 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyByteArrayValidWriterZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.copy( emptyByteArray(), new DontCloseStringWriter(), 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyByteArrayZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- StringWriter writer = new DontCloseStringWriter();
- IOUtil.copy( probe.getBytes(), writer, 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
@Test( expected = NullPointerException.class )
public void copyNullByteArrayNullWriterPosBufSz()
throws Exception
@@ -3470,38 +2972,6 @@ public class IOUtilTest
IOUtil.copy( nullByteArray(), new DontCloseStringWriter(), "utf-16", 0 );
}
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyEmptyByteArrayValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- IOUtil.copy( emptyByteArray(), new DontCloseStringWriter(), "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
- @Test( timeout = INFINITE_LOOP_TIMEOUT )
- @ReproducesPlexusBug( "Should not infinite loop" )
- public void copyByteArrayValidEncodingZeroBufSz()
- throws Exception
- {
- assertThat( "We have an infinite loop", new Task()
- {
- public void task()
- throws Exception
- {
- String probe = "A string \u2345\u00ef";
- IOUtil.copy( probe.getBytes(), new DontCloseStringWriter(),
- "utf-16", 0 );
- }
- }, runsForLongerThan( 100 ) );
- }
-
/*
* Utility methods
*/