commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r761090 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Date Wed, 01 Apr 2009 22:21:19 GMT
Author: sebb
Date: Wed Apr  1 22:21:19 2009
New Revision: 761090

URL: http://svn.apache.org/viewvc?rev=761090&view=rev
Log:
Allow comparison string to be overriden when processing archive content

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

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java?rev=761090&r1=761089&r2=761090&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Wed Apr  1 22:21:19 2009
@@ -292,7 +292,7 @@
                 if (!outfile.exists()) {
                     fail("extraction failed: " + entry.getName());
                 }
-                if (expected != null && !expected.remove(entry.getName())) {
+                if (expected != null && !expected.remove(getExpectedString(entry)))
{
                     fail("unexpected entry: " + entry.getName());
                 }
             }
@@ -310,4 +310,15 @@
             rmdir(result);
         }
     }
+
+    /**
+     * Override this method to change what is to be compared in the List.
+     * For example, size + name instead of just name.
+     * 
+     * @param entry
+     * @return returns the entry name
+     */
+    protected String getExpectedString(ArchiveEntry entry) {
+        return entry.getName();
+    }
 }



Mime
View raw message