From acb1772d4b351e9a87138aca9fa10b0b55388eef Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 23 Sep 2017 07:44:09 +0000 Subject: [PATCH] Tried to enable this test, but it is broken since a long time and I am not sure how this is expected to behave... git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809372 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/TestPOIXMLProperties.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java b/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java index db3219f80..c0e51802f 100644 --- a/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java +++ b/src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java @@ -229,6 +229,7 @@ public final class TestPOIXMLProperties { return utcString.equals(dateTimeUtcString); } + //@Test public void testThumbnails() throws Exception { POIXMLProperties noThumbProps = sampleNoThumb.getProperties(); @@ -241,19 +242,23 @@ public final class TestPOIXMLProperties { assertNotNull(_props.getThumbnailImage()); assertNull(noThumbProps.getThumbnailImage()); - assertEquals("thumbnail.jpeg", _props.getThumbnailFilename()); + assertEquals("/thumbnail.jpeg", _props.getThumbnailFilename()); // Adding / changing - noThumbProps.setThumbnail("Testing.png", new ByteArrayInputStream(new byte[1])); + ByteArrayInputStream imageData = new ByteArrayInputStream(new byte[1]); + assertEquals(1, imageData.available()); + noThumbProps.setThumbnail("Testing.png", imageData); assertNotNull(noThumbProps.getThumbnailPart()); - assertEquals("Testing.png", noThumbProps.getThumbnailFilename()); + assertEquals("/Testing.png", noThumbProps.getThumbnailFilename()); assertNotNull(noThumbProps.getThumbnailImage()); assertEquals(1, noThumbProps.getThumbnailImage().available()); - noThumbProps.setThumbnail("Testing2.png", new ByteArrayInputStream(new byte[2])); + imageData = new ByteArrayInputStream(new byte[2]); + assertEquals(2, imageData.available()); + noThumbProps.setThumbnail("Testing2.png", imageData); assertNotNull(noThumbProps.getThumbnailPart()); - assertEquals("Testing.png", noThumbProps.getThumbnailFilename()); + assertEquals("/Testing.png", noThumbProps.getThumbnailFilename()); assertNotNull(noThumbProps.getThumbnailImage()); assertEquals(2, noThumbProps.getThumbnailImage().available()); }