Author: centic
Date: Tue Aug  1 06:26:44 2017
New Revision: 1803614

URL: http://svn.apache.org/viewvc?rev=1803614&view=rev
Log:
Assert on the contents of the byte-array to see if the problem happens during 
writing the data or reading it back in

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

Modified: 
poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java?rev=1803614&r1=1803613&r2=1803614&view=diff
==============================================================================
--- 
poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java 
(original)
+++ 
poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java 
Tue Aug  1 06:26:44 2017
@@ -32,6 +32,7 @@ import org.apache.poi.hpsf.SummaryInform
 import org.apache.poi.hpsf.WritingNotSupportedException;
 import org.apache.poi.hssf.HSSFTestDataSamples;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.util.HexDump;
 import org.junit.Test;
 
 /**
@@ -104,6 +105,10 @@ public class TestPOIFSProperties {
     }
 
     private void checkFromByteArray(byte[] bytes) throws IOException, 
NoPropertySetStreamException, MarkUnsupportedException {
+        // on some environments in CI we see strange failures, let's verify 
that the size is exactly right
+        // this can be removed again after the problem is identified
+        assertEquals("Had: " + HexDump.toHex(bytes), 5120, bytes.length);
+
         POIFSFileSystem fs2 = new POIFSFileSystem(new 
ByteArrayInputStream(bytes));
         SummaryInformation summary2 = (SummaryInformation) 
PropertySetFactory.create(fs2.createDocumentInputStream(SummaryInformation.DEFAULT_STREAM_NAME));
         assertNotNull(summary2);



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to