You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2016/02/05 20:42:57 UTC
[2/2] commons-compress git commit: COMPRESS-334 unit tests with more
than one entry
COMPRESS-334 unit tests with more than one entry
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/9431b16c
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/9431b16c
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/9431b16c
Branch: refs/heads/master
Commit: 9431b16c58a3fbb320cf13af80cb36430f2aea79
Parents: b4805bb
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Feb 5 20:42:31 2016 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Feb 5 20:42:31 2016 +0100
----------------------------------------------------------------------
.../compress/archivers/ar/ArArchiveInputStreamTest.java | 6 ++++++
src/test/resources/longfile_bsd.ar | 2 ++
src/test/resources/longfile_gnu.ar | 7 +++++--
3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9431b16c/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
index ae09d63..d62d3a0 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
@@ -51,6 +51,12 @@ public class ArArchiveInputStreamTest extends AbstractTestCase {
byte[] hello = new byte[14];
s.read(hello);
assertEquals("Hello, world!\n", ArchiveUtils.toAsciiString(hello));
+ e = s.getNextEntry();
+ assertEquals("this_is_a_long_file_name_as_well.txt", e.getName());
+ assertEquals(4, e.getSize());
+ byte[] bye = new byte[4];
+ s.read(bye);
+ assertEquals("Bye\n", ArchiveUtils.toAsciiString(bye));
assertNull(s.getNextEntry());
} finally {
if (s != null) {
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9431b16c/src/test/resources/longfile_bsd.ar
----------------------------------------------------------------------
diff --git a/src/test/resources/longfile_bsd.ar b/src/test/resources/longfile_bsd.ar
index 7b0fd51..f7c3682 100644
--- a/src/test/resources/longfile_bsd.ar
+++ b/src/test/resources/longfile_bsd.ar
@@ -1,3 +1,5 @@
!<arch>
#1/28 1311256511 1000 1000 100644 42 `
this_is_a_long_file_name.txtHello, world!
+#1/36 1454694016 1000 1000 100664 40 `
+this_is_a_long_file_name_as_well.txtBye
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9431b16c/src/test/resources/longfile_gnu.ar
----------------------------------------------------------------------
diff --git a/src/test/resources/longfile_gnu.ar b/src/test/resources/longfile_gnu.ar
index 22d4c03..12799a0 100644
--- a/src/test/resources/longfile_gnu.ar
+++ b/src/test/resources/longfile_gnu.ar
@@ -1,5 +1,8 @@
!<arch>
-// 30 `
+// 68 `
this_is_a_long_file_name.txt/
-/0 1311256511 1000 1000 100644 14 `
+this_is_a_long_file_name_as_well.txt/
+/0 1454693980 1000 1000 100664 14 `
Hello, world!
+/30 1454694016 1000 1000 100664 4 `
+Bye