Share

Search Java Code Snippets


  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.commons.compress.compressors.CompressorStreamFactory

    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 (final IllegalStateException ise) {

}



fac = new CompressorStreamFactory(true);

assertTrue(fac.getDecompressConcatenated());

try {

fac.setDecompressConcatenated(true);

fail("Expected IllegalStateException");

} catch (final IllegalStateException ise) {

}

}


   Like      Feedback      org.apache.commons.compress.compressors.CompressorStreamFactory



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus