Github user bodewig commented on a diff in the pull request: https://github.com/apache/commons-compress/pull/20#discussion_r112810573 --- Diff: src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCase.java --- @@ -167,6 +171,26 @@ private String detect(String testFileName) throws IOException, CompressorExcepti } @Test + public void testMemoryLimit() throws Exception { + testMemoryLimit("COMPRESS-382"); + testMemoryLimit("COMPRESS-386"); + } + + private void testMemoryLimit(String fileName) throws IOException, CompressorException { + CompressorStreamFactory fac = new CompressorStreamFactory(true, + 100); + try (InputStream is = new BufferedInputStream( + new FileInputStream(getFile(fileName)))) { + InputStream compressorInputStream = fac.createCompressorInputStream(is); + fail("Should have thrown CompressorMemoryLimitException"); --- End diff -- +1 and make it two tests :-)
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org