diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2020-08-15 00:18:42 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2020-08-15 00:18:42 +0000 |
commit | 60303201dcb715a7738cd5bff3a85ffb424a2a90 (patch) | |
tree | 1154b264901ee5e32e7001175063d64b81f8b73f /src/ooxml/testcases/org/apache/poi/ss/tests | |
parent | e68bd7bd7ded6948a3289c6a6e3ad37453d12c42 (diff) | |
download | poi-60303201dcb715a7738cd5bff3a85ffb424a2a90.tar.gz poi-60303201dcb715a7738cd5bff3a85ffb424a2a90.zip |
use the forbidden-apis policies corresponding to the JRE
fix the forbidden apis issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1880866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/ss/tests')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/TestEmbedOLEPackage.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/TestEmbedOLEPackage.java b/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/TestEmbedOLEPackage.java index f184b01516..28c1bcc06a 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/TestEmbedOLEPackage.java +++ b/src/ooxml/testcases/org/apache/poi/ss/tests/usermodel/TestEmbedOLEPackage.java @@ -50,6 +50,7 @@ import org.apache.poi.sl.usermodel.AutoShape; import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.sl.usermodel.Slide; import org.apache.poi.sl.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.SlideShowFactory; import org.apache.poi.ss.extractor.EmbeddedData; import org.apache.poi.ss.extractor.EmbeddedExtractor; import org.apache.poi.ss.usermodel.ClientAnchor; @@ -58,7 +59,6 @@ import org.apache.poi.ss.usermodel.ObjectData; import org.apache.poi.ss.usermodel.Shape; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xssf.XSSFTestDataSamples; import org.apache.poi.xssf.usermodel.XSSFObjectData; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -71,7 +71,7 @@ public class TestEmbedOLEPackage { private static final POIDataSamples ssamples = POIDataSamples.getSpreadSheetInstance(); @BeforeClass - public static void init() throws IOException, ReflectiveOperationException { + public static void init() throws IOException { samplePPT = getSamplePPT(false); samplePPTX = getSamplePPT(true); samplePNG = ssamples.readFile("logoKarmokar4.png"); @@ -83,7 +83,6 @@ public class TestEmbedOLEPackage { XSSFWorkbook wb = new XSSFWorkbook(is)) { List<XSSFObjectData> oleShapes = new ArrayList<>(); List<Ole10Native> ole10s = new ArrayList<>(); - List<String> digests = new ArrayList<>(); final boolean digestMatch = wb.getSheetAt(0).getDrawingPatriarch().getShapes().stream() @@ -212,9 +211,8 @@ public class TestEmbedOLEPackage { pat2.createObjectData(anchor2, oleIdx2, picIdx); } - static byte[] getSamplePPT(boolean ooxml) throws IOException, ReflectiveOperationException { - SlideShow<?,?> ppt = (ooxml) ? new XMLSlideShow() - : (SlideShow<?,?>)Class.forName("org.apache.poi.hslf.usermodel.HSLFSlideShow").newInstance(); + static byte[] getSamplePPT(boolean ooxml) throws IOException { + SlideShow<?,?> ppt = SlideShowFactory.create(ooxml); Slide<?,?> slide = ppt.createSlide(); AutoShape<?,?> sh1 = slide.createAutoShape(); |