You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2009/03/28 02:45:17 UTC
Re: svn commit: r759352 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
On 27/03/2009, tcurdt@apache.org <tc...@apache.org> wrote:
> Author: tcurdt
> Date: Fri Mar 27 21:08:27 2009
> New Revision: 759352
>
> URL: http://svn.apache.org/viewvc?rev=759352&view=rev
> Log:
> tracked down the problem of https://issues.apache.org/jira/browse/COMPRESS-11
>
>
>
> Modified:
> commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
>
> Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
> URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java?rev=759352&r1=759351&r2=759352&view=diff
> ==============================================================================
> --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java (original)
> +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java Fri Mar 27 21:08:27 2009
> @@ -107,10 +107,16 @@
> out.close();
> }
>
> + assertEquals(282, output.length());
I get 293 bytes on Windows.
Is that perhaps a problem with line endings?
> final File output2 = new File(dir, "bla2.ar");
>
> + int copied = 0;
> + int deleted = 0;
> +
> {
> // remove all but one file
> +
> final InputStream is = new FileInputStream(output);
> final OutputStream os = new FileOutputStream(output2);
> final ArchiveOutputStream aos = new ArchiveStreamFactory().createArchiveOutputStream("ar", os);
> @@ -124,8 +130,11 @@
> if ("test1.xml".equals(entry.getName())) {
> aos.putArchiveEntry(entry);
> IOUtils.copy(ais, aos);
> + aos.closeArchiveEntry();
> + copied++;
> } else {
> IOUtils.copy(ais, new ByteArrayOutputStream());
> + deleted++;
> }
>
> }
> @@ -135,7 +144,11 @@
> os.close();
> }
>
> + assertEquals(1, copied);
> + assertEquals(1, deleted);
> + assertEquals(144, output2.length());
>
> + long files = 0;
> long sum = 0;
>
> {
> @@ -150,11 +163,13 @@
> IOUtils.copy(ais, new ByteArrayOutputStream());
>
> sum += entry.getLength();
> + files++;
> }
> ais.close();
> is.close();
> }
>
> + assertEquals(1, files);
> assertEquals(76, sum);
>
> }
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org