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 2011/05/25 10:36:28 UTC

svn commit: r1127429 - in /maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util: Base64Test.java IOUtilTest.java

Author: stephenc
Date: Wed May 25 08:36:27 2011
New Revision: 1127429

URL: http://svn.apache.org/viewvc?rev=1127429&view=rev
Log:
reformat

Modified:
    maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/Base64Test.java
    maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java

Modified: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/Base64Test.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/Base64Test.java?rev=1127429&r1=1127428&r2=1127429&view=diff
==============================================================================
--- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/Base64Test.java (original)
+++ maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/Base64Test.java Wed May 25 08:36:27 2011
@@ -19,17 +19,16 @@ package org.codehaus.plexus.util;
  * under the License.
  */
 
+import org.junit.Test;
+
 import static org.apache.maven.tck.TckMatchers.hasDefaultConstructor;
 import static org.apache.maven.tck.TckMatchers.isFinalClass;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.*;
-
-import org.junit.Assert;
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
 
-public class Base64Test {
+public class Base64Test
+{
 
 
     @Test
@@ -55,7 +54,7 @@ public class Base64Test {
 
     @Test
     public void encodeBase64()
-            throws Exception
+        throws Exception
     {
         assertThat( new String( Base64.encodeBase64( "test".getBytes() ) ), is( "dGVzdA==" ) );
         assertThat( new String( Base64.encodeBase64( "test".getBytes(), false ) ), is( "dGVzdA==" ) );
@@ -63,7 +62,7 @@ public class Base64Test {
 
     @Test
     public void encodeBase64Chunked()
-            throws Exception
+        throws Exception
     {
         assertThat( new String( Base64.encodeBase64(
             "some long long long long long long long long long long long long long long text".getBytes(), true ) ),
@@ -83,7 +82,7 @@ public class Base64Test {
         throws Exception
     {
         String valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-        assertTrue( Base64.isArrayByteBase64( valid.getBytes() ) );
+        assertThat( Base64.isArrayByteBase64( valid.getBytes() ), is( true ) );
     }
 
 }

Modified: 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/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java?rev=1127429&r1=1127428&r2=1127429&view=diff
==============================================================================
--- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java (original)
+++ maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/IOUtilTest.java Wed May 25 08:36:27 2011
@@ -286,38 +286,32 @@ public class IOUtilTest
     public void contentEqualEmptyEmpty()
         throws Exception
     {
-        assertThat(
-            IOUtil.contentEquals( new DontCloseByteArrayInputStream( emptyByteArray() ), new DontCloseByteArrayInputStream(
-                emptyByteArray() ) ),
-            is( true ) );
+        assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( emptyByteArray() ),
+                                          new DontCloseByteArrayInputStream( emptyByteArray() ) ), is( true ) );
     }
 
     @Test
     public void contentEqualNonEmptyEmpty()
         throws Exception
     {
-        assertThat(
-            IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[1] ), new DontCloseByteArrayInputStream(
-                emptyByteArray() ) ),
-            is( false ) );
+        assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[1] ),
+                                          new DontCloseByteArrayInputStream( emptyByteArray() ) ), is( false ) );
     }
 
     @Test
     public void contentEqualEmptyNonEmpty()
         throws Exception
     {
-        assertThat(
-            IOUtil.contentEquals( new DontCloseByteArrayInputStream( emptyByteArray() ), new DontCloseByteArrayInputStream( new byte[1] ) ),
-            is( false ) );
+        assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( emptyByteArray() ),
+                                          new DontCloseByteArrayInputStream( new byte[1] ) ), is( false ) );
     }
 
     @Test
     public void contentEqualNonEmptyNonEmpty()
         throws Exception
     {
-        assertThat(
-            IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[1] ), new DontCloseByteArrayInputStream( new byte[1] ) ),
-            is( true ) );
+        assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[1] ),
+                                          new DontCloseByteArrayInputStream( new byte[1] ) ), is( true ) );
     }
 
     @Test
@@ -325,7 +319,8 @@ public class IOUtilTest
         throws Exception
     {
         assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[]{ 1, 2, 3, 4, 5, 6 } ),
-                                          new DontCloseByteArrayInputStream( new byte[]{ 1, 2, 3, 4, 5, 7 } ) ), is( false ) );
+                                          new DontCloseByteArrayInputStream( new byte[]{ 1, 2, 3, 4, 5, 7 } ) ),
+                    is( false ) );
     }
 
     @Test
@@ -342,8 +337,8 @@ public class IOUtilTest
     {
         byte[] buf = new byte[8192];
         buf[8191] = 1;
-        assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[8192] ), new DontCloseByteArrayInputStream( buf ) ),
-                    is( false ) );
+        assertThat( IOUtil.contentEquals( new DontCloseByteArrayInputStream( new byte[8192] ),
+                                          new DontCloseByteArrayInputStream( buf ) ), is( false ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -739,7 +734,7 @@ public class IOUtilTest
     public void copyEmptyByteArrayValidOutputStream()
         throws Exception
     {
-        IOUtil.copy( emptyByteArray(), new DontCloseByteArrayOutputStream());
+        IOUtil.copy( emptyByteArray(), new DontCloseByteArrayOutputStream() );
     }
 
     @Test
@@ -865,6 +860,7 @@ public class IOUtilTest
         IOUtil.copy( input, outputStream, 1 );
         assertThat( outputStream.toByteArray(), is( input ) );
     }
+
     @Test( expected = NullPointerException.class )
     public void copyNullInputStreamNullOutputStream()
         throws Exception
@@ -924,14 +920,14 @@ public class IOUtilTest
         IOUtil.copy( new DontCloseByteArrayInputStream( emptyByteArray() ), nullOutputStream(), -1 );
     }
 
-    @Test(expected = NegativeArraySizeException.class)
+    @Test( expected = NegativeArraySizeException.class )
     public void copyEmptyInputStreamValidOutputStreamNegBufSz()
         throws Exception
     {
         IOUtil.copy( new DontCloseByteArrayInputStream( emptyByteArray() ), new DontCloseByteArrayOutputStream(), -1 );
     }
 
-    @Test(expected = NegativeArraySizeException.class)
+    @Test( expected = NegativeArraySizeException.class )
     public void copyInputStreamValidOutputStreamNegBufSz()
         throws Exception
     {
@@ -983,7 +979,7 @@ public class IOUtilTest
                 {
                     ByteArrayOutputStream outputStream = new DontCloseByteArrayOutputStream();
                     byte[] input = { 1, 2, 3, 4, 5, 6 };
-                    IOUtil.copy( new DontCloseByteArrayInputStream( input), outputStream, 0 );
+                    IOUtil.copy( new DontCloseByteArrayInputStream( input ), outputStream, 0 );
                 }
                 catch ( IOException e )
                 {
@@ -1055,7 +1051,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ) ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ) ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1127,7 +1124,7 @@ public class IOUtilTest
                 try
                 {
                     String probe = "A string \u2345\u00ef";
-                    IOUtil.toString( new ByteArrayInputStream( probe.getBytes()) , 0 );
+                    IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), 0 );
                 }
                 catch ( IOException e )
                 {
@@ -1161,7 +1158,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes()), 1 ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), 1 ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1183,7 +1181,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), null ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), null ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1205,7 +1204,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes()), "junk" ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), "junk" ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1227,9 +1227,9 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes( "utf-16" )), "utf-16" ).getBytes(
-            "utf-8" ),
-                    is( probe.getBytes( "utf-8" ) ) );
+        assertThat(
+            IOUtil.toString( new ByteArrayInputStream( probe.getBytes( "utf-16" ) ), "utf-16" ).getBytes( "utf-8" ),
+            is( probe.getBytes( "utf-8" ) ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1251,7 +1251,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes()), null, -1 ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), null, -1 ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1273,7 +1274,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), "junk", -1 ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), "junk", -1 ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class )
@@ -1295,9 +1297,9 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes( "utf-16" ) ), "utf-16", -1 ).getBytes(
-            "utf-8" ),
-                    is( probe.getBytes( "utf-8" ) ) );
+        assertThat(
+            IOUtil.toString( new ByteArrayInputStream( probe.getBytes( "utf-16" ) ), "utf-16", -1 ).getBytes( "utf-8" ),
+            is( probe.getBytes( "utf-8" ) ) );
     }
 
     @Test( expected = NullPointerException.class, timeout = 150 )
@@ -1319,7 +1321,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), null, 0 ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), null, 0 ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class, timeout = 150 )
@@ -1341,7 +1344,8 @@ public class IOUtilTest
         throws Exception
     {
         String probe = "A string \u2345\u00ef";
-        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), "junk", 0 ).getBytes(), is( probe.getBytes() ) );
+        assertThat( IOUtil.toString( new ByteArrayInputStream( probe.getBytes() ), "junk", 0 ).getBytes(),
+                    is( probe.getBytes() ) );
     }
 
     @Test( expected = NullPointerException.class, timeout = 150 )
@@ -1431,7 +1435,8 @@ public class IOUtilTest
     public void bufferedCopyEmptyInputStreamValidOutputStream()
         throws Exception
     {
-        IOUtil.bufferedCopy( new DontCloseByteArrayInputStream( emptyByteArray() ), new DontCloseByteArrayOutputStream() );
+        IOUtil.bufferedCopy( new DontCloseByteArrayInputStream( emptyByteArray() ),
+                             new DontCloseByteArrayOutputStream() );
     }
 
     @Test