]> source.dussan.org Git - poi.git/commitdiff
add more classes for LinkVideoToPptx example
authorAndreas Beeker <kiwiwings@apache.org>
Fri, 4 Dec 2020 16:12:47 +0000 (16:12 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Fri, 4 Dec 2020 16:12:47 +0000 (16:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884099 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xslf/TestNecessaryOOXMLClasses.java

index 40c2dc52533552ffa6f06eaf3805fd5919564aba..1572d8c34b119de5e970afaac5bb7206a33b809b 100644 (file)
 
 package org.apache.poi.xslf;
 
-import org.junit.Assert;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Supplier;
+
+import org.apache.xmlbeans.XmlObject;
 import org.junit.Test;
-import org.openxmlformats.schemas.presentationml.x2006.main.*;
 
 // aim is to get these classes loaded and included in poi-ooxml-schemas.jar
 public class TestNecessaryOOXMLClasses {
 
     @Test
     public void testProblemClasses() {
-        STPlaceholderSize stPlaceholderSize = STPlaceholderSize.Factory.newInstance();
-        Assert.assertNotNull(stPlaceholderSize);
-        CTHeaderFooter ctHeaderFooter = CTHeaderFooter.Factory.newInstance();
-        Assert.assertNotNull(ctHeaderFooter);
-        //the following are used in LinkVideoToPptx example
-        STTLTimeIndefinite sttlTimeIndefinite = STTLTimeIndefinite.Factory.newInstance();
-        Assert.assertNotNull(sttlTimeIndefinite);
-        STTLTimeNodeFillType sttlTimeNodeFillType = STTLTimeNodeFillType.Factory.newInstance();
-        Assert.assertNotNull(sttlTimeNodeFillType);
-        STTLTimeNodeRestartType sttlTimeNodeRestartType = STTLTimeNodeRestartType.Factory.newInstance();
-        Assert.assertNotNull(sttlTimeNodeRestartType);
-        STTLTimeNodeType sttlTimeNodeType = STTLTimeNodeType.Factory.newInstance();
-        Assert.assertNotNull(sttlTimeNodeType);
-        CTExtension ctExtension = CTExtension.Factory.newInstance();
-        Assert.assertNotNull(ctExtension);
-        CTTLCommonMediaNodeData cttlCommonMediaNodeData = CTTLCommonMediaNodeData.Factory.newInstance();
-        Assert.assertNotNull(cttlCommonMediaNodeData);
-        CTTLCommonTimeNodeData cttlCommonTimeNodeData = CTTLCommonTimeNodeData.Factory.newInstance();
-        Assert.assertNotNull(cttlCommonTimeNodeData);
-        CTTimeNodeList ctTimeNodeList = CTTimeNodeList.Factory.newInstance();
-        Assert.assertNotNull(ctTimeNodeList);
+        List<Supplier<XmlObject>> sup = Arrays.asList(
+            org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderSize.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTHeaderFooter.Factory::newInstance,
+            //the following are used in LinkVideoToPptx example
+            org.openxmlformats.schemas.drawingml.x2006.main.CTVideoFile.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeIndefinite.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeFillType.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeRestartType.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeType.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTExtension.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonMediaNodeData.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonTimeNodeData.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTTimeNodeList.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionList.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTSlideTiming.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTTLMediaNodeVideo.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTTLTimeConditionList.Factory::newInstance,
+            org.openxmlformats.schemas.presentationml.x2006.main.CTTLTimeTargetElement.Factory::newInstance
+        );
+
+        for (Supplier<XmlObject> xo : sup) {
+            assertNotNull(xo.get());
+        }
     }
 }