Author: sebb
Date: Wed Mar 23 13:41:26 2011
New Revision: 1084587
URL: http://svn.apache.org/viewvc?rev=1084587&view=rev
Log:
COMPRESS-117 Add some test cases
COMPRESS-117.tar created from bla.tar with the first lot of magic bytes nulled
out
Added:
commons/proper/compress/trunk/src/test/resources/COMPRESS-117.tar (with
props)
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java?rev=1084587&r1=1084586&r2=1084587&view=diff
==============================================================================
---
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
(original)
+++
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
Wed Mar 23 13:41:26 2011
@@ -38,6 +38,21 @@ public final class DetectArchiverTestCas
final ClassLoader classLoader = getClass().getClassLoader();
+ public void testDetectionNotArchive() throws FileNotFoundException {
+ try {
+ getStreamFor("test.txt");
+ fail("Expected ArchiveException");
+ } catch (ArchiveException e) {
+ // expected
+ }
+ }
+
+ public void testCOMPRESS117() throws Exception {
+ final ArchiveInputStream tar = getStreamFor("COMPRESS-117.tar");
+ assertNotNull(tar);
+ assertTrue(tar instanceof TarArchiveInputStream);
+ }
+
public void testDetection() throws Exception {
final ArchiveInputStream ar = getStreamFor("bla.ar");
Added: commons/proper/compress/trunk/src/test/resources/COMPRESS-117.tar
URL:
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/resources/COMPRESS-117.tar?rev=1084587&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/compress/trunk/src/test/resources/COMPRESS-117.tar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream