This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new 3eefae5d Fix broken tests.
3eefae5d is described below

commit 3eefae5d0b9725179460043c0696ed2253862a47
Author: Gary Gregory <[email protected]>
AuthorDate: Thu May 5 14:54:03 2022 -0400

    Fix broken tests.
---
 .../zip/ParallelScatterZipCreatorTest.java         | 37 +++++++++++-----------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
 
b/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
index 6044450c..64723a4e 100644
--- 
a/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
+++ 
b/src/test/java/org/apache/commons/compress/archivers/zip/ParallelScatterZipCreatorTest.java
@@ -17,12 +17,13 @@
  */
 package org.apache.commons.compress.archivers.zip;
 
-import org.apache.commons.compress.parallel.FileBasedScatterGatherBackingStore;
-import org.apache.commons.compress.parallel.InputStreamSupplier;
-import org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier;
-import org.apache.commons.compress.utils.IOUtils;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
+import static org.apache.commons.compress.AbstractTestCase.getFile;
+import static org.apache.commons.compress.AbstractTestCase.tryHardToDelete;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
@@ -38,12 +39,12 @@ import java.util.concurrent.Executors;
 import java.util.zip.Deflater;
 import java.util.zip.ZipEntry;
 
-import static org.apache.commons.compress.AbstractTestCase.getFile;
-import static org.apache.commons.compress.AbstractTestCase.tryHardToDelete;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.apache.commons.compress.parallel.FileBasedScatterGatherBackingStore;
+import org.apache.commons.compress.parallel.InputStreamSupplier;
+import org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier;
+import org.apache.commons.compress.utils.IOUtils;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
 
 public class ParallelScatterZipCreatorTest {
 
@@ -92,18 +93,18 @@ public class ParallelScatterZipCreatorTest {
     public void throwsExceptionWithCompressionLevelTooBig() {
         final int compressLevelTooBig = Deflater.BEST_COMPRESSION + 1;
         final ExecutorService es = Executors.newFixedThreadPool(1);
-        final ScatterGatherBackingStoreSupplier supp = () -> new 
FileBasedScatterGatherBackingStore(tmp = File.createTempFile("parallelscatter", 
"n1"));
-
-        new ParallelScatterZipCreator(es, supp, compressLevelTooBig);
+        assertThrows(IllegalArgumentException.class, () -> new 
ParallelScatterZipCreator(es,
+            () -> new FileBasedScatterGatherBackingStore(tmp = 
File.createTempFile("parallelscatter", "n1")), compressLevelTooBig));
+        es.shutdownNow();
     }
 
     @Test
     public void throwsExceptionWithCompressionLevelTooSmall() {
         final int compressLevelTooSmall = Deflater.DEFAULT_COMPRESSION - 1;
         final ExecutorService es = Executors.newFixedThreadPool(1);
-        final ScatterGatherBackingStoreSupplier supp = () -> new 
FileBasedScatterGatherBackingStore(tmp = File.createTempFile("parallelscatter", 
"n1"));
-
-        new ParallelScatterZipCreator(es, supp, compressLevelTooSmall);
+        assertThrows(IllegalArgumentException.class, () -> new 
ParallelScatterZipCreator(es,
+            () -> new FileBasedScatterGatherBackingStore(tmp = 
File.createTempFile("parallelscatter", "n1")), compressLevelTooSmall));
+        es.shutdownNow();
     }
 
     @Test

Reply via email to