commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kinow <...@git.apache.org>
Subject [GitHub] commons-compress pull request #20: COMPRESS-382
Date Sat, 22 Apr 2017 13:58:30 GMT
Github user kinow commented on a diff in the pull request:

    https://github.com/apache/commons-compress/pull/20#discussion_r112810239
  
    --- 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 --
    
    Maybe instead we could let the CompressorMemoryLimitException happen, and declare in the
@Test annotation the expected exception.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message