poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1637548 - /poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java
Date Sat, 08 Nov 2014 12:21:27 GMT
Author: nick
Date: Sat Nov  8 12:21:27 2014
New Revision: 1637548

URL: http://svn.apache.org/r1637548
Log:
Test from Tim to include PropertyList in poi-ooxml-schemas

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java?rev=1637548&r1=1637547&r2=1637548&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java
Sat Nov  8 12:21:27 2014
@@ -29,6 +29,7 @@ import java.util.TimeZone;
 
 import junit.framework.TestCase;
 
+import org.apache.poi.POIDataSamples;
 import org.apache.poi.openxml4j.OpenXML4JTestDataSamples;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
@@ -36,6 +37,8 @@ import org.apache.poi.openxml4j.opc.inte
 import org.apache.poi.openxml4j.util.Nullable;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty;
 
 public final class TestPackageCoreProperties extends TestCase {
     private static final POILogger logger = POILogFactory.getLogger(TestPackageCoreProperties.class);
@@ -226,4 +229,20 @@ public final class TestPackageCoreProper
         // Check
         assertEquals("Stefan Kopf", props.getCreatorProperty().getValue());
     }
+    
+    public void testListOfCustomProperties() throws Exception {
+        File inp = POIDataSamples.getSpreadSheetInstance().getFile("ExcelWithAttachments.xlsm");
+        OPCPackage pkg = OPCPackage.open(inp, PackageAccess.READ);
+        XSSFWorkbook wb = new XSSFWorkbook(pkg);
+        
+        assertNotNull(wb.getProperties());
+        assertNotNull(wb.getProperties().getCustomProperties());
+        
+        for (CTProperty prop : wb.getProperties().getCustomProperties().getUnderlyingProperties().getPropertyList())
{
+            assertNotNull(prop);
+        }
+        
+        wb.close();
+        pkg.close();
+    }
 }



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


Mime
View raw message