commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r753123 - /commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Date Fri, 13 Mar 2009 05:27:04 GMT
Author: bodewig
Date: Fri Mar 13 05:27:03 2009
New Revision: 753123

URL: http://svn.apache.org/viewvc?rev=753123&view=rev
Log:
copy-paste error in test.  Submitted by Christian Grobmeier.  SANDBOX-297

Modified:
    commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java

Modified: commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java?rev=753123&r1=753122&r2=753123&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
(original)
+++ commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Fri Mar 13 05:27:03 2009
@@ -83,7 +83,8 @@
             File temp = File.createTempFile("test", "." + archivename);
 
             final OutputStream stream = new FileOutputStream(temp);
-            out = new ArchiveStreamFactory().createArchiveOutputStream(archivename, stream);
+            out = new ArchiveStreamFactory().createArchiveOutputStream(
+                    archivename, stream);
 
             final File file1 = getFile("test1.xml");
             final File file2 = getFile("test2.xml");
@@ -99,49 +100,49 @@
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("testdata/test2.xml");
-            entry.setSize(file1.length());
+            entry.setSize(file2.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file2), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("test/test3.xml");
-            entry.setSize(file1.length());
+            entry.setSize(file3.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file3), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("bla/test4.xml");
-            entry.setSize(file1.length());
+            entry.setSize(file4.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file4), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("bla/test5.xml");
-            entry.setSize(file1.length());
+            entry.setSize(file4.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file4), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("bla/blubber/test6.xml");
-            entry.setSize(file1.length());
+            entry.setSize(file4.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file4), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("test.txt");
-            entry.setSize(file1.length());
+            entry.setSize(file5.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file5), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("something/bla");
-            entry.setSize(file1.length());
+            entry.setSize(file6.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file6), out);
             out.closeArchiveEntry();
 
             entry = new ZipArchiveEntry("test with spaces.txt");
-            entry.setSize(file1.length());
+            entry.setSize(file6.length());
             out.putArchiveEntry(entry);
             IOUtils.copy(new FileInputStream(file6), out);
             out.closeArchiveEntry();
@@ -163,16 +164,16 @@
      * @throws Exception
      */
     protected void checkArchiveContent(File archive, List expected)
-        throws Exception {
+            throws Exception {
         final InputStream is = new FileInputStream(archive);
         final BufferedInputStream buf = new BufferedInputStream(is);
         final ArchiveInputStream in = new ArchiveStreamFactory()
-            .createArchiveInputStream(buf);
+                .createArchiveInputStream(buf);
         this.checkArchiveContent(in, expected);
     }
 
     protected void checkArchiveContent(ArchiveInputStream in, List expected)
-        throws Exception {
+            throws Exception {
         File result = File.createTempFile("dir-result", "");
         result.delete();
         result.mkdir();
@@ -180,7 +181,7 @@
         ArchiveEntry entry = null;
         while ((entry = in.getNextEntry()) != null) {
             File outfile = new File(result.getCanonicalPath() + "/result/"
-                                    + entry.getName());
+                    + entry.getName());
             outfile.getParentFile().mkdirs();
             OutputStream out = new FileOutputStream(outfile);
             IOUtils.copy(in, out);



Mime
View raw message