]> source.dussan.org Git - poi.git/commitdiff
Assert on the contents of the byte-array to see if the problem happens during writing...
authorDominik Stadler <centic@apache.org>
Tue, 1 Aug 2017 06:26:44 +0000 (06:26 +0000)
committerDominik Stadler <centic@apache.org>
Tue, 1 Aug 2017 06:26:44 +0000 (06:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803614 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java

index bfe4124a8d7a7e960dc9e8a6a33eeb7a0fc1d688..7494ea83cd2442e9fb108483ff76d07cb0c13aeb 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.poi.hpsf.SummaryInformation;
 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);