You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/03/09 14:16:52 UTC
(commons-compress) branch master updated: Add disabled test for COMPRESS-651
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 29fe726bb Add disabled test for COMPRESS-651
29fe726bb is described below
commit 29fe726bb1983217a6b14af614f496ad9bbee474
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Mar 9 09:16:30 2024 -0500
Add disabled test for COMPRESS-651
https://issues.apache.org/jira/browse/COMPRESS-651
---
.../compressors/bzip2/BZip2Compress651Test.java | 54 +++++++++++++++++++++
src/test/resources/org/apache/commons/.DS_Store | Bin 0 -> 6148 bytes
.../commons/compress/COMPRESS-651/my10m.tar.bz2 | Bin 0 -> 6271204 bytes
3 files changed, 54 insertions(+)
diff --git a/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2Compress651Test.java b/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2Compress651Test.java
new file mode 100644
index 000000000..d5c7e17c9
--- /dev/null
+++ b/src/test/java/org/apache/commons/compress/compressors/bzip2/BZip2Compress651Test.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.commons.compress.compressors.bzip2;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests https://issues.apache.org/jira/browse/COMPRESS-651
+ */
+public class BZip2Compress651Test {
+
+ @Test
+ @Disabled
+ public void testCompress651() throws IOException {
+ final int buffersize = 102_400;
+ final Path pathIn = Paths.get("src/test/resources/org/apache/commons/compress/COMPRESS-651/my10m.tar.bz2");
+ final Path pathOut = Paths.get("target/COMPRESS-651/test.tar");
+ Files.createDirectories(pathOut.getParent());
+ try (BZip2CompressorInputStream inputStream = new BZip2CompressorInputStream(new BufferedInputStream(Files.newInputStream(pathIn)));
+ OutputStream outputStream = Files.newOutputStream(pathOut)) {
+ IOUtils.copy(inputStream, outputStream, buffersize);
+ }
+ // expected size confirmed locally on macOS
+ assertEquals(10_496_000, Files.size(pathOut));
+ }
+}
diff --git a/src/test/resources/org/apache/commons/.DS_Store b/src/test/resources/org/apache/commons/.DS_Store
new file mode 100644
index 000000000..2aa57ce21
Binary files /dev/null and b/src/test/resources/org/apache/commons/.DS_Store differ
diff --git a/src/test/resources/org/apache/commons/compress/COMPRESS-651/my10m.tar.bz2 b/src/test/resources/org/apache/commons/compress/COMPRESS-651/my10m.tar.bz2
new file mode 100644
index 000000000..d87b72c2f
Binary files /dev/null and b/src/test/resources/org/apache/commons/compress/COMPRESS-651/my10m.tar.bz2 differ