commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r759335 - /commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
Date Fri, 27 Mar 2009 20:35:23 GMT
Author: tcurdt
Date: Fri Mar 27 20:35:23 2009
New Revision: 759335

URL: http://svn.apache.org/viewvc?rev=759335&view=rev
Log:
fixed the testcase


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=759335&r1=759334&r2=759335&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 20:35:23 2009
@@ -123,7 +123,11 @@
 				
 				if ("test1.xml".equals(entry.getName())) {
 					aos.putArchiveEntry(entry);
+					IOUtils.copy(ais, aos);
+				} else {
+			        IOUtils.copy(ais, new ByteArrayOutputStream());
 				}
+			
 			}
 			ais.close();
 			aos.close();
@@ -136,15 +140,14 @@
 
 		{
 			final InputStream is = new FileInputStream(output2);
-			final ArchiveInputStream ais = new ArchiveStreamFactory().createArchiveInputStream(is);
+			final ArchiveInputStream ais = new ArchiveStreamFactory().createArchiveInputStream(new
BufferedInputStream(is));
 			while(true) {
 				final ArArchiveEntry entry = (ArArchiveEntry)ais.getNextEntry();
 				if (entry == null) {
 					break;
 				}
 				
-				final ByteArrayOutputStream os = new ByteArrayOutputStream();
-		        IOUtils.copy(ais, os);
+		        IOUtils.copy(ais, new ByteArrayOutputStream());
 		        
 		        sum +=  entry.getLength();
 			}
@@ -152,7 +155,7 @@
 			is.close();			
 		}
 
-		assertEquals(0, sum);
+		assertEquals(76, sum);
 		
 	}
 



Mime
View raw message