poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1516320 - /poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java
Date Wed, 21 Aug 2013 22:57:26 GMT
Author: centic
Date: Wed Aug 21 22:57:26 2013
New Revision: 1516320

URL: http://svn.apache.org/r1516320
Log:
Fix unit test for Bug 50298 some more

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java?rev=1516320&r1=1516319&r2=1516320&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java Wed Aug 21
22:57:26 2013
@@ -922,10 +922,7 @@ public final class TestHSSFWorkbook exte
 		assertEquals("Did not have the expected size when writing the workbook: written: " + written
+ ", but expected: " + expected,
 				expected, written);
 		
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-		wb.write(out);
-		
-		HSSFWorkbook read = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
+		HSSFWorkbook read = HSSFTestDataSamples.writeOutAndReadBack(wb);
 		assertSheetOrder(read, "Invoice", "Invoice1", "Digest", "Deferred", "Received");
 	}
 
@@ -965,11 +962,8 @@ public final class TestHSSFWorkbook exte
 		assertEquals("Did not have the expected size when writing the workbook: written: " + written
+ ", but expected: " + expected,
 				expected, written);
 		
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-		wb.write(out);
-		
-		HSSFWorkbook read = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
-		assertSheetOrder(wb, "Invoice", "Deferred", "Received", "Digest");
+		HSSFWorkbook read = HSSFTestDataSamples.writeOutAndReadBack(wb);
+		assertSheetOrder(read, "Invoice", "Deferred", "Received", "Digest");
 	}
 	
 	private void assertSheetOrder(HSSFWorkbook wb, String... sheets) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message