commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1660182 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
Date Mon, 16 Feb 2015 19:16:49 GMT
Author: sebb
Date: Mon Feb 16 19:16:49 2015
New Revision: 1660182

URL: http://svn.apache.org/r1660182
Log:
Add tests for IllegalStateException

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

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java?rev=1660182&r1=1660181&r2=1660182&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java
Mon Feb 16 19:16:49 2015
@@ -115,6 +115,31 @@ public final class DetectCompressorTestC
         }
     }
 
+    public void testOverride() {
+        CompressorStreamFactory fac = new CompressorStreamFactory();
+        assertFalse(fac.getDecompressConcatenated());
+        fac.setDecompressConcatenated(true);
+        assertTrue(fac.getDecompressConcatenated());
+
+        fac = new CompressorStreamFactory(false);
+        assertFalse(fac.getDecompressConcatenated());
+        try {
+            fac.setDecompressConcatenated(true);
+            fail("Expected IllegalStateException");
+        } catch (IllegalStateException ise) {
+            // expected
+        }
+
+        fac = new CompressorStreamFactory(true);
+        assertTrue(fac.getDecompressConcatenated());
+        try {
+            fac.setDecompressConcatenated(true);
+            fail("Expected IllegalStateException");
+        } catch (IllegalStateException ise) {
+            // expected
+        }
+    }
+
     public void testMutiples() throws Exception {
         for(int i=0; i <tests.length; i++) {
             TestData test = tests[i];



Mime
View raw message