Author: sebb
Date: Tue Apr 13 18:54:52 2010
New Revision: 933741
URL: http://svn.apache.org/viewvc?rev=933741&view=rev
Log:
Don't rely on default charset
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
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/TarTestCase.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java?rev=933741&r1=933740&r2=933741&view=diff
==============================================================================
---
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
(original)
+++
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
Tue Apr 13 18:54:52 2010
@@ -53,7 +53,7 @@ public final class TarTestCase extends A
public void testTarArchiveLongNameCreation() throws Exception {
String name =
"testdata/12345678901234567890123456789012345678901234567890123456789012345678901234567890123456.xml";
- byte[] bytes = name.getBytes();
+ byte[] bytes = name.getBytes("UTF-8");
assertEquals(bytes.length, 99);
final File output = new File(dir, "bla.tar");
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=933741&r1=933740&r2=933741&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 Apr 13 18:54:52 2010
@@ -39,14 +39,14 @@ public class TarUtilsTest extends TestCa
assertEquals(sb1, sb2);
}
- private void fillBuff(byte []buffer, String input){
+ private void fillBuff(byte []buffer, String input) throws Exception{
for(int i=0; i<buffer.length;i++){
buffer[i]=0;
}
-
System.arraycopy(input.getBytes(),0,buffer,0,Math.min(buffer.length,input.length()));
+
System.arraycopy(input.getBytes("UTF-8"),0,buffer,0,Math.min(buffer.length,input.length()));
}
- public void testParseOctal(){
+ public void testParseOctal() throws Exception{
byte [] buffer = new byte[20];
fillBuff(buffer,"777777777777 ");
long value;