You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/02/21 19:06:20 UTC

svn commit: r1291944 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java

Author: sebb
Date: Tue Feb 21 18:06:20 2012
New Revision: 1291944

URL: http://svn.apache.org/viewvc?rev=1291944&view=rev
Log:
Don't use default encoding

Modified:
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java?rev=1291944&r1=1291943&r2=1291944&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java (original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/tar/TarUtilsTest.java Tue Feb 21 18:06:20 2012
@@ -142,16 +142,16 @@ public class TarUtilsTest extends TestCa
         assertEquals('3', buffer[buffer.length-3]); // end of number
     }
     
-    public void testNegative() {
+    public void testNegative() throws Exception {
         byte [] buffer = new byte[22];
         TarUtils.formatUnsignedOctalString(-1, buffer, 0, buffer.length);
-        assertEquals("1777777777777777777777", new String(buffer));
+        assertEquals("1777777777777777777777", new String(buffer, "UTF-8"));
     }
 
-    public void testOverflow() {
+    public void testOverflow() throws Exception {
         byte [] buffer = new byte[8-1]; // a lot of the numbers have 8-byte buffers (nul term)
         TarUtils.formatUnsignedOctalString(07777777L, buffer, 0, buffer.length);
-        assertEquals("7777777", new String(buffer));        
+        assertEquals("7777777", new String(buffer, "UTF-8"));        
         try {
             TarUtils.formatUnsignedOctalString(017777777L, buffer, 0, buffer.length);
             fail("Should have cause IllegalArgumentException");