poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1722695 - in /poi/trunk/src: ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java
Date Sun, 03 Jan 2016 01:26:29 GMT
Author: onealj
Date: Sun Jan  3 01:26:29 2016
New Revision: 1722695

URL: http://svn.apache.org/viewvc?rev=1722695&view=rev
Log:
test XSLF SlideShowFactory creation methods individually for more granular unit test results

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java
    poi/trunk/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java?rev=1722695&r1=1722694&r2=1722695&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShowFactory.java
Sun Jan  3 01:26:29 2016
@@ -36,13 +36,46 @@ import org.junit.Test;
 
 public final class TestXSLFSlideShowFactory extends BaseTestSlideShowFactory {
     private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance();
-    
+    private static final String filename = "SampleShow.pptx";
+    private static final String password = "opensesame";
+
+    @Test
+    public void testFactoryFromFile() throws Exception {
+        testFactoryFromFile(filename);
+    }
+
+    @Test
+    public void testFactoryFromStream() throws Exception {
+        testFactoryFromStream(filename);
+    }
+
+    @Test
+    public void testFactoryFromNative() throws Exception {
+        testFactoryFromNative(filename);
+    }
+
     @Test
-    public void testFactory() throws Exception {
-        File pFile = createProtected("SampleShow.pptx", "foobaa");
-        testFactory("SampleShow.pptx", pFile.getAbsolutePath(), "foobaa");
+    public void testFactoryFromProtectedFile() throws Exception {
+        File pFile = createProtected();
+        testFactoryFromProtectedFile(pFile.getAbsolutePath(), password);
     }
-    
+
+    @Test
+    public void testFactoryFromProtectedStream() throws Exception {
+        File pFile = createProtected();
+        testFactoryFromProtectedStream(pFile.getAbsolutePath(), password);
+    }
+
+    @Test
+    public void testFactoryFromProtectedNative() throws Exception {
+        File pFile = createProtected();
+        testFactoryFromProtectedNative(pFile.getAbsolutePath(), password);
+    }
+
+    private static File createProtected() throws IOException, GeneralSecurityException {
+        return createProtected(filename, password);
+    }
+
     private static File createProtected(String basefile, String password)
     throws IOException, GeneralSecurityException {
         NPOIFSFileSystem fs = new NPOIFSFileSystem();

Modified: poi/trunk/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java?rev=1722695&r1=1722694&r2=1722695&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShowFactory.java Sun
Jan  3 01:26:29 2016
@@ -30,7 +30,7 @@ import org.apache.poi.poifs.filesystem.N
 public class BaseTestSlideShowFactory {
     private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance();
 
-    private static void testFactoryFromFile(String file) throws Exception {
+    protected static void testFactoryFromFile(String file) throws Exception {
         SlideShow<?,?> ss;
         // from file
         ss = SlideShowFactory.create(fromFile(file));
@@ -38,7 +38,7 @@ public class BaseTestSlideShowFactory {
         ss.close();
     }
 
-    private static void testFactoryFromStream(String file) throws Exception {
+    protected static void testFactoryFromStream(String file) throws Exception {
         SlideShow<?,?> ss;
         // from stream
         ss = SlideShowFactory.create(fromStream(file));
@@ -46,7 +46,7 @@ public class BaseTestSlideShowFactory {
         ss.close();
     }
 
-    private static void testFactoryFromNative(String file) throws Exception {
+    protected static void testFactoryFromNative(String file) throws Exception {
         SlideShow<?,?> ss;
         // from NPOIFS
         if (!file.contains("pptx")) {
@@ -58,7 +58,7 @@ public class BaseTestSlideShowFactory {
         }
     }
 
-    private static void testFactoryFromProtectedFile(String protectedFile, String password)
throws Exception {
+    protected static void testFactoryFromProtectedFile(String protectedFile, String password)
throws Exception {
         SlideShow<?,?> ss;
         // from protected file 
         ss = SlideShowFactory.create(fromFile(protectedFile), password);
@@ -66,7 +66,7 @@ public class BaseTestSlideShowFactory {
         ss.close();
     }
 
-    private static void testFactoryFromProtectedStream(String protectedFile, String password)
throws Exception {
+    protected static void testFactoryFromProtectedStream(String protectedFile, String password)
throws Exception {
         SlideShow<?,?> ss;
         // from protected stream
         ss = SlideShowFactory.create(fromStream(protectedFile), password);
@@ -74,7 +74,7 @@ public class BaseTestSlideShowFactory {
         ss.close();
     }
 
-    private static void testFactoryFromProtectedNative(String protectedFile, String password)
throws Exception {
+    protected static void testFactoryFromProtectedNative(String protectedFile, String password)
throws Exception {
         SlideShow<?,?> ss;
         // from protected NPOIFS
         NPOIFSFileSystem npoifs = new NPOIFSFileSystem(fromFile(protectedFile));



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message