File tree 1 file changed +18
-0
lines changed
src/test/java/org/codehaus/plexus/archiver/zip
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,24 @@ public void testZipOutputSizeException()
239
239
assertTrue ( ex .getMessage ().startsWith ( "Maximum output size limit reached" ) );
240
240
}
241
241
242
+ public void testZipMaxOutputSizeEqualToExtractedFileSize ()
243
+ throws Exception
244
+ {
245
+ long extractedFileSize = 11L ;
246
+ String s = "target/zip-size-tests" ;
247
+ File testZip = new File ( getBasedir (), "src/test/jars/test.zip" );
248
+ File outputDirectory = new File ( getBasedir (), s );
249
+
250
+ FileUtils .deleteDirectory ( outputDirectory );
251
+
252
+ ZipUnArchiver zu = getZipUnArchiver ( testZip );
253
+ zu .setMaxOutputSize ( extractedFileSize );
254
+ zu .extract ( "" , outputDirectory );
255
+
256
+ File extractedFile = new File ( outputDirectory , "test.sh" );
257
+ assertEquals ( extractedFileSize , extractedFile .length () );
258
+ }
259
+
242
260
private ZipArchiver getZipArchiver ()
243
261
{
244
262
try
You can’t perform that action at this time.
0 commit comments