harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r738871 - /harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java
Date Thu, 29 Jan 2009 14:53:39 GMT
Author: sjanuary
Date: Thu Jan 29 14:53:38 2009
New Revision: 738871

URL: http://svn.apache.org/viewvc?rev=738871&view=rev
Log:
Unpack200 - add test for correct compression being used in output Jar files

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java?rev=738871&r1=738870&r2=738871&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java
Thu Jan 29 14:53:38 2009
@@ -71,8 +71,16 @@
         JarFile jarFile = new JarFile(file);
         file.deleteOnExit();
 
-        JarFile jarFile2 = new JarFile(new File(Archive.class.getResource(
-                "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
+        File compareFile = new File(Archive.class.getResource(
+                "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI());
+
+        JarFile jarFile2 = new JarFile(compareFile);
+
+        long differenceInJarSizes = Math.abs(compareFile.length()
+                - file.length());
+
+        assertTrue("Expected jar files to be a similar size, difference was "
+                + differenceInJarSizes + " bytes", differenceInJarSizes < 100);
 
         Enumeration entries = jarFile.entries();
         Enumeration entries2 = jarFile2.entries();



Mime
View raw message