You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2009/02/19 14:43:22 UTC

svn commit: r745859 - in /ant/core/trunk: CONTRIBUTORS contributors.xml src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java

Author: bodewig
Date: Thu Feb 19 13:43:22 2009
New Revision: 745859

URL: http://svn.apache.org/viewvc?rev=745859&view=rev
Log:
TestCase for new Unicode extra fields, based on submission by Wolfgang Glas.  Merge from commons-compress

Added:
    ant/core/trunk/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java
      - copied, changed from r745855, commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/contributors.xml

Modified: ant/core/trunk/CONTRIBUTORS
URL: http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?rev=745859&r1=745858&r2=745859&view=diff
==============================================================================
Binary files - no diff available.

Modified: ant/core/trunk/contributors.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/contributors.xml?rev=745859&r1=745858&r2=745859&view=diff
==============================================================================
--- ant/core/trunk/contributors.xml (original)
+++ ant/core/trunk/contributors.xml Thu Feb 19 13:43:22 2009
@@ -1253,6 +1253,10 @@
   </name>
   <name>
     <first>Wolfgang</first>
+    <last>Glas</last>
+  </name>
+  <name>
+    <first>Wolfgang</first>
     <last>Werner</last>
   </name>
   <name>

Copied: ant/core/trunk/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java (from r745855, commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java)
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java?p2=ant/core/trunk/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java&p1=commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java&r1=745855&r2=745859&rev=745859&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java (original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/zip/UTF8ZipFilesTest.java Thu Feb 19 13:43:22 2009
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.commons.compress.archivers.zip;
+package org.apache.tools.zip;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -74,12 +74,12 @@
     private static void createTestFile(File file, String encoding)
         throws UnsupportedEncodingException, IOException {
 
-        ZipArchiveOutputStream zos = null;
+        ZipOutputStream zos = null;
         try {
-            zos = new ZipArchiveOutputStream(file);
+            zos = new ZipOutputStream(file);
             zos.setEncoding(encoding);
 
-            ZipArchiveEntry ze = new ZipArchiveEntry(OIL_BARREL_TXT);
+            ZipEntry ze = new ZipEntry(OIL_BARREL_TXT);
             if (!ZipEncodingHelper.canEncodeName(ze.getName(),
                                                  zos.getEncoding())) {
                 ze.addExtraField(new UnicodePathExtraField(ze.getName(),
@@ -90,7 +90,7 @@
             zos.write("Hello, world!".getBytes("US-ASCII"));
             zos.closeEntry();
 
-            ze = new ZipArchiveEntry(EURO_FOR_DOLLAR_TXT);
+            ze = new ZipEntry(EURO_FOR_DOLLAR_TXT);
             if (!ZipEncodingHelper.canEncodeName(ze.getName(),
                                                  zos.getEncoding())) {
                 ze.addExtraField(new UnicodePathExtraField(ze.getName(),
@@ -101,7 +101,7 @@
             zos.write("Give me your money!".getBytes("US-ASCII"));
             zos.closeEntry();
 
-            ze = new ZipArchiveEntry(ASCII_TXT);
+            ze = new ZipEntry(ASCII_TXT);
 
             if (!ZipEncodingHelper.canEncodeName(ze.getName(),
                                                  zos.getEncoding())) {
@@ -129,7 +129,7 @@
 
             Enumeration e = zf.getEntries();
             while (e.hasMoreElements()) {
-                ZipArchiveEntry ze = (ZipArchiveEntry) e.nextElement();
+                ZipEntry ze = (ZipEntry) e.nextElement();
 
                 if (ze.getName().endsWith("sser.txt")) {
                     assertUnicodeName(ze, OIL_BARREL_TXT, encoding);
@@ -146,7 +146,7 @@
         }
     }
 
-    private static UnicodePathExtraField findUniCodePath(ZipArchiveEntry ze) {
+    private static UnicodePathExtraField findUniCodePath(ZipEntry ze) {
 
         ZipExtraField[] efs = ze.getExtraFields();
         for (int i = 0; i < efs.length; ++i) {
@@ -157,7 +157,7 @@
         return null;
     }
 
-    private static void assertUnicodeName(ZipArchiveEntry ze,
+    private static void assertUnicodeName(ZipEntry ze,
                                           String expectedName,
                                           String encoding)
         throws IOException {