diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2020-08-14 19:08:42 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2020-08-14 19:08:42 +0000 |
commit | 5caf8e109b8fac9341091b7a7bc94a29db01c267 (patch) | |
tree | 7aba8c244b8e0a54e54582444942838e92414f82 /src/testcases | |
parent | 4e3008acdb1287325e93ce27de91e28d265be058 (diff) | |
download | poi-5caf8e109b8fac9341091b7a7bc94a29db01c267.tar.gz poi-5caf8e109b8fac9341091b7a7bc94a29db01c267.zip |
#64411 - Provide JigSaw modules
- use service locator for SlideShowFactory
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1880860 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r-- | src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java | 3 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java b/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java index 5d53b4bd62..6158c9de63 100644 --- a/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java +++ b/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java @@ -160,8 +160,9 @@ public abstract class BaseTestSlideShow< @Test public void shapeAndSlideName() throws IOException { final String file = "SampleShow.ppt"+(getClass().getSimpleName().contains("XML")?"x":""); + //noinspection unchecked try (final InputStream is = slTests.openResourceAsStream(file); - final SlideShow<S,P> ppt = SlideShowFactory.create(is)) { + final SlideShow<S,P> ppt = (SlideShow<S,P>)SlideShowFactory.create(is)) { final List<S> shapes1 = ppt.getSlides().get(0).getShapes(); assertEquals("The Title", shapes1.get(0).getShapeName()); assertEquals("Another Subtitle", shapes1.get(1).getShapeName()); diff --git a/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java b/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java index d62d787d94..345bb7906e 100644 --- a/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java +++ b/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java @@ -98,7 +98,7 @@ public abstract class BaseTestSlideShowFactory { // from protected POIFS if (protectedFile.endsWith(".ppt") || protectedFile.endsWith(".pptx")) { POIFSFileSystem poifs = new POIFSFileSystem(fromFile(protectedFile)); - ss = SlideShowFactory.create(poifs, password); + ss = SlideShowFactory.create(poifs.getRoot(), password); assertNotNull(ss); poifs.close(); assertCloseDoesNotModifyFile(protectedFile, ss); @@ -172,13 +172,13 @@ public abstract class BaseTestSlideShowFactory { assertArrayEquals(filename + " sample file was modified as a result of closing the slideshow", before, after); } catch (AssertionError e) { - // if the file after closing is different, then re-set - // the file to the state before in order to not have a dirty SCM + // if the file after closing is different, then re-set + // the file to the state before in order to not have a dirty SCM // working tree when running this test try (FileOutputStream str = new FileOutputStream(_slTests.getFile(filename))) { str.write(before); } - + throw e; } } |