From b3ad734de16f00af48e58f197c0f991f51bc8eb1 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Tue, 1 Aug 2017 06:26:44 +0000 Subject: [PATCH] Assert on the contents of the byte-array to see if the problem happens during writing the data or reading it back in git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803614 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/usermodel/TestPOIFSProperties.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java b/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java index bfe4124a8d..7494ea83cd 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java @@ -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); -- 2.39.5