You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2009/01/29 13:44:35 UTC

svn commit: r738842 [7/7] - in /poi/trunk: ./ legal/ maven/ src/documentation/content/xdocs/ src/documentation/content/xdocs/oxml4j/ src/documentation/content/xdocs/spreadsheet/ src/examples/src/org/apache/poi/xssf/eventusermodel/examples/ src/ooxml/ja...

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,273 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackageAccess;
+import org.apache.poi.openxml4j.opc.PackagePart;
+import org.apache.poi.openxml4j.opc.PackagePartName;
+import org.apache.poi.openxml4j.opc.PackageRelationship;
+import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
+import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.TargetMode;
+
+import org.apache.poi.openxml4j.TestCore;
+
+
+public class TestRelationships extends TestCase {
+	public static final String HYPERLINK_REL_TYPE =
+		"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
+	public static final String COMMENTS_REL_TYPE =
+		"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
+	public static final String SHEET_WITH_COMMENTS =
+		"/xl/worksheets/sheet1.xml";
+
+    TestCore testCore = new TestCore(this.getClass());
+
+    /**
+     * Test relationships are correctly loaded. This at the moment fails (as of r499)
+     * whenever a document is loaded before its correspondig .rels file has been found.
+     * The code in this case assumes there are no relationships defined, but it should
+     * really look also for not yet loaded parts.
+     */
+    public void testLoadRelationships() throws Exception {
+        String filepath = System.getProperty("openxml4j.testdata.input") + File.separator
+            + "sample.xlsx";
+        Package pkg = Package.open(filepath, PackageAccess.READ);
+        TestCore.getLogger().debug("1: " + pkg);
+        PackageRelationshipCollection rels = pkg.getRelationshipsByType(PackageRelationshipTypes.CORE_DOCUMENT);
+        PackageRelationship coreDocRelationship = rels.getRelationship(0);
+        PackagePart corePart = pkg.getPart(coreDocRelationship);
+        String relIds[] = { "rId1", "rId2", "rId3" };
+        for (String relId : relIds) {
+            PackageRelationship rel = corePart.getRelationship(relId);
+            assertNotNull(rel);
+            PackagePartName relName = PackagingURIHelper.createPartName(rel.getTargetURI());
+            PackagePart sheetPart = pkg.getPart(relName);
+            assertEquals("Number of relationships1 for " + sheetPart.getPartName(), 1, sheetPart.getRelationships().size());
+        }
+    }
+    
+    /**
+     * Checks that we can fetch a collection of relations by
+     *  type, then grab from within there by id
+     */
+    public void testFetchFromCollection() throws Exception {
+        String filepath = System.getProperty("openxml4j.testdata.input") + File.separator
+        	+ "ExcelWithHyperlinks.xlsx";
+    	
+        Package pkg = Package.open(filepath, PackageAccess.READ);
+        PackagePart sheet = pkg.getPart(
+        		PackagingURIHelper.createPartName(SHEET_WITH_COMMENTS));
+        assertNotNull(sheet);
+        
+        assertTrue(sheet.hasRelationships());
+        assertEquals(6, sheet.getRelationships().size());
+        
+        // Should have three hyperlinks, and one comment
+        PackageRelationshipCollection hyperlinks =
+        	sheet.getRelationshipsByType(HYPERLINK_REL_TYPE);
+        PackageRelationshipCollection comments =
+        	sheet.getRelationshipsByType(COMMENTS_REL_TYPE);
+        assertEquals(3, hyperlinks.size());
+        assertEquals(1, comments.size());
+        
+        // Check we can get bits out by id
+        // Hyperlinks are rId1, rId2 and rId3
+        // Comment is rId6
+        assertNotNull(hyperlinks.getRelationshipByID("rId1"));
+        assertNotNull(hyperlinks.getRelationshipByID("rId2"));
+        assertNotNull(hyperlinks.getRelationshipByID("rId3"));
+        assertNull(hyperlinks.getRelationshipByID("rId6"));
+        
+        assertNull(comments.getRelationshipByID("rId1"));
+        assertNull(comments.getRelationshipByID("rId2"));
+        assertNull(comments.getRelationshipByID("rId3"));
+        assertNotNull(comments.getRelationshipByID("rId6"));
+        
+        assertNotNull(sheet.getRelationship("rId1"));
+        assertNotNull(sheet.getRelationship("rId2"));
+        assertNotNull(sheet.getRelationship("rId3"));
+        assertNotNull(sheet.getRelationship("rId6"));
+    }
+    
+    /**
+     * Excel uses relations on sheets to store the details of 
+     *  external hyperlinks. Check we can load these ok.
+     */
+    public void testLoadExcelHyperlinkRelations() throws Exception {
+        String filepath = System.getProperty("openxml4j.testdata.input") + File.separator
+	    	+ "ExcelWithHyperlinks.xlsx";
+		
+	    Package pkg = Package.open(filepath, PackageAccess.READ);
+	    PackagePart sheet = pkg.getPart(
+	    		PackagingURIHelper.createPartName(SHEET_WITH_COMMENTS));
+	    assertNotNull(sheet);
+
+	    // rId1 is url
+	    PackageRelationship url = sheet.getRelationship("rId1");
+	    assertNotNull(url);
+	    assertEquals("rId1", url.getId());
+	    assertEquals("/xl/worksheets/sheet1.xml", url.getSourceURI().toString());
+	    assertEquals("http://poi.apache.org/", url.getTargetURI().toString());
+	    
+	    // rId2 is file
+	    PackageRelationship file = sheet.getRelationship("rId2");
+	    assertNotNull(file);
+	    assertEquals("rId2", file.getId());
+	    assertEquals("/xl/worksheets/sheet1.xml", file.getSourceURI().toString());
+	    assertEquals("WithVariousData.xlsx", file.getTargetURI().toString());
+	    
+	    // rId3 is mailto
+	    PackageRelationship mailto = sheet.getRelationship("rId3");
+	    assertNotNull(mailto);
+	    assertEquals("rId3", mailto.getId());
+	    assertEquals("/xl/worksheets/sheet1.xml", mailto.getSourceURI().toString());
+	    assertEquals("mailto:dev@poi.apache.org?subject=XSSF%20Hyperlinks", mailto.getTargetURI().toString());
+    }
+    
+    /*
+     * Excel uses relations on sheets to store the details of 
+     *  external hyperlinks. Check we can create these ok, 
+     *  then still read them later
+     */
+    public void testCreateExcelHyperlinkRelations() throws Exception {
+        String filepath = System.getProperty("openxml4j.testdata.input") + File.separator
+	    	+ "ExcelWithHyperlinks.xlsx";
+		
+	    Package pkg = Package.open(filepath, PackageAccess.READ_WRITE);
+	    PackagePart sheet = pkg.getPart(
+	    		PackagingURIHelper.createPartName(SHEET_WITH_COMMENTS));
+	    assertNotNull(sheet);
+	    
+	    assertEquals(3, sheet.getRelationshipsByType(HYPERLINK_REL_TYPE).size());
+	    
+	    // Add three new ones
+	    PackageRelationship openxml4j =
+	    	sheet.addExternalRelationship("http://www.openxml4j.org/", HYPERLINK_REL_TYPE);
+	    PackageRelationship sf =
+	    	sheet.addExternalRelationship("http://openxml4j.sf.net/", HYPERLINK_REL_TYPE);
+	    PackageRelationship file =
+	    	sheet.addExternalRelationship("MyDocument.docx", HYPERLINK_REL_TYPE);
+	    
+	    // Check they were added properly
+	    assertNotNull(openxml4j);
+	    assertNotNull(sf);
+	    assertNotNull(file);
+	    
+	    assertEquals(6, sheet.getRelationshipsByType(HYPERLINK_REL_TYPE).size());
+	    
+	    assertEquals("http://www.openxml4j.org/", openxml4j.getTargetURI().toString());
+	    assertEquals("/xl/worksheets/sheet1.xml", openxml4j.getSourceURI().toString());
+	    assertEquals(HYPERLINK_REL_TYPE, openxml4j.getRelationshipType());
+	    
+	    assertEquals("http://openxml4j.sf.net/", sf.getTargetURI().toString());
+	    assertEquals("/xl/worksheets/sheet1.xml", sf.getSourceURI().toString());
+	    assertEquals(HYPERLINK_REL_TYPE, sf.getRelationshipType());
+	    
+	    assertEquals("MyDocument.docx", file.getTargetURI().toString());
+	    assertEquals("/xl/worksheets/sheet1.xml", file.getSourceURI().toString());
+	    assertEquals(HYPERLINK_REL_TYPE, file.getRelationshipType());
+	    
+	    // Will get ids 7, 8 and 9, as we already have 1-6
+	    assertEquals("rId7", openxml4j.getId());
+	    assertEquals("rId8", sf.getId());
+	    assertEquals("rId9", file.getId());
+	    
+	    
+	    // Write out and re-load
+	    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+	    pkg.save(baos);
+	    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+	    pkg = Package.open(bais);
+	    
+	    // Check again
+	    sheet = pkg.getPart(
+	    		PackagingURIHelper.createPartName(SHEET_WITH_COMMENTS));
+	    
+	    assertEquals(6, sheet.getRelationshipsByType(HYPERLINK_REL_TYPE).size());
+	    
+	    assertEquals("http://poi.apache.org/",
+	    		sheet.getRelationship("rId1").getTargetURI().toString());
+	    assertEquals("mailto:dev@poi.apache.org?subject=XSSF%20Hyperlinks",
+	    		sheet.getRelationship("rId3").getTargetURI().toString());
+	    
+	    assertEquals("http://www.openxml4j.org/",
+	    		sheet.getRelationship("rId7").getTargetURI().toString());
+	    assertEquals("http://openxml4j.sf.net/",
+	    		sheet.getRelationship("rId8").getTargetURI().toString());
+	    assertEquals("MyDocument.docx",
+	    		sheet.getRelationship("rId9").getTargetURI().toString());
+    }
+
+    public void testCreateRelationsFromScratch() throws Exception {
+    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    	Package pkg = Package.create(baos);
+    	
+    	PackagePart partA =
+    		pkg.createPart(PackagingURIHelper.createPartName("/partA"), "text/plain");
+    	PackagePart partB =
+    		pkg.createPart(PackagingURIHelper.createPartName("/partB"), "image/png");
+    	assertNotNull(partA);
+    	assertNotNull(partB);
+    	
+    	// Internal
+    	partA.addRelationship(partB.getPartName(), TargetMode.INTERNAL, "http://example/Rel");
+    	
+    	// External
+    	partA.addExternalRelationship("http://poi.apache.org/", "http://example/poi");
+    	partB.addExternalRelationship("http://poi.apache.org/ss/", "http://example/poi/ss");
+
+    	// Check as expected currently
+    	assertEquals("/partB", partA.getRelationship("rId1").getTargetURI().toString());
+    	assertEquals("http://poi.apache.org/", 
+    			partA.getRelationship("rId2").getTargetURI().toString());
+    	assertEquals("http://poi.apache.org/ss/", 
+    			partB.getRelationship("rId1").getTargetURI().toString());
+    	
+    	
+    	// Save, and re-load
+    	pkg.close();
+    	ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+    	pkg = Package.open(bais);
+    	
+    	partA = pkg.getPart(PackagingURIHelper.createPartName("/partA"));
+    	partB = pkg.getPart(PackagingURIHelper.createPartName("/partB"));
+    	
+    	
+    	// Check the relations
+    	assertEquals(2, partA.getRelationships().size());
+    	assertEquals(1, partB.getRelationships().size());
+    	
+    	assertEquals("/partB", partA.getRelationship("rId1").getTargetURI().toString());
+    	assertEquals("http://poi.apache.org/", 
+    			partA.getRelationship("rId2").getTargetURI().toString());
+    	assertEquals("http://poi.apache.org/ss/", 
+    			partB.getRelationship("rId1").getTargetURI().toString());
+    	// Check core too
+    	assertEquals("/docProps/core.xml",
+    			pkg.getRelationshipsByType("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties").getRelationship(0).getTargetURI().toString());
+    }
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java
------------------------------------------------------------------------------
    svn:executable = *

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/AllTests.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/AllTests.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/AllTests.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/AllTests.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,36 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.compliance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+				"Test for test.org.apache.poi.openxml4j.opc.compliance");
+		// $JUnit-BEGIN$
+		suite.addTestSuite(OPCCompliance_PartName.class);
+		suite.addTestSuite(OPCCompliance_CoreProperties.class);
+		suite.addTestSuite(OPCCompliance_PackageModel.class);
+		// $JUnit-END$
+		return suite;
+	}
+
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/AllTests.java
------------------------------------------------------------------------------
    svn:executable = *

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_NotPresentFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_NotPresentFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_NotPresentFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_NotPresentFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_SUCCESS.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_SUCCESS.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_SUCCESS.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_SUCCESS.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_UnauthorizedXMLLangAttributeFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_UnauthorizedXMLLangAttributeFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_UnauthorizedXMLLangAttributeFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_CoreProperties_UnauthorizedXMLLangAttributeFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_DerivedPartNameFAIL.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_DerivedPartNameFAIL.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_DerivedPartNameFAIL.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/INPUT/OPCCompliance_DerivedPartNameFAIL.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_CoreProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_CoreProperties.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_CoreProperties.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_CoreProperties.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,258 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.compliance;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
+import org.apache.poi.openxml4j.opc.ContentTypes;
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.TargetMode;
+
+import org.apache.poi.openxml4j.TestCore;
+import junit.framework.TestCase;
+
+/**
+ * Test core properties Open Packaging Convention compliance.
+ * 
+ * M4.1: The format designer shall specify and the format producer shall create
+ * at most one core properties relationship for a package. A format consumer
+ * shall consider more than one core properties relationship for a package to be
+ * an error. If present, the relationship shall target the Core Properties part.
+ * 
+ * M4.2: The format designer shall not specify and the format producer shall not
+ * create Core Properties that use the Markup Compatibility namespace as defined
+ * in Annex F, "Standard Namespaces and Content Types". A format consumer shall
+ * consider the use of the Markup Compatibility namespace to be an error.
+ * 
+ * M4.3: Producers shall not create a document element that contains refinements
+ * to the Dublin Core elements, except for the two specified in the schema:
+ * <dcterms:created> and <dcterms:modified> Consumers shall consider a document
+ * element that violates this constraint to be an error.
+ * 
+ * M4.4: Producers shall not create a document element that contains the
+ * xml:lang attribute. Consumers shall consider a document element that violates
+ * this constraint to be an error.
+ * 
+ * M4.5: Producers shall not create a document element that contains the
+ * xsi:type attribute, except for a <dcterms:created> or <dcterms:modified>
+ * element where the xsi:type attribute shall be present and shall hold the
+ * value dcterms:W3CDTF, where dcterms is the namespace prefix of the Dublin
+ * Core namespace. Consumers shall consider a document element that violates
+ * this constraint to be an error.
+ * 
+ * @author Julien Chable
+ * @version 1.0
+ */
+public class OPCCompliance_CoreProperties extends TestCase {
+
+	TestCore testCore = new TestCore(this.getClass());
+
+	public void testCorePropertiesPart() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+		} catch (InvalidFormatException e) {
+			fail("OPC compliance failure: the core properties is considered as invalid than it's not !");
+		} finally {
+			pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.1 rule.
+	 */
+	public void testOnlyOneCorePropertiesPart() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_OnlyOneCorePropertiesPartFAIL.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.1 -> A format consumer shall consider more than one core properties relationship for a package to be an error.");
+		} catch (InvalidFormatException e) {
+			// DO nothing, it's the normal behavior
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.1 rule.
+	 */
+	public void testOnlyOneCorePropertiesPart_AddRelationship() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.testdata.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx";
+			pkg = Package.open(filepath);
+			pkg.addRelationship(PackagingURIHelper.createPartName(new URI(
+					"/docProps/core2.xml")), TargetMode.INTERNAL,
+					PackageRelationshipTypes.CORE_PROPERTIES);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.1 -> A format consumer shall consider more than one core properties relationship for a package to be an error.");
+		} catch (InvalidOperationException e) {
+			// Do nothing, it's the normal behavior
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} catch (URISyntaxException e) {
+			// Should never happen
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.1 rule.
+	 */
+	public void testOnlyOneCorePropertiesPart_AddPart() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.testdata.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_OnlyOneCorePropertiesPart.docx";
+			pkg = Package.open(filepath);
+			pkg.createPart(PackagingURIHelper.createPartName(new URI(
+					"/docProps/core2.xml")), ContentTypes.CORE_PROPERTIES_PART);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.1 -> A format consumer shall consider more than one core properties relationship for a package to be an error.");
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} catch (InvalidOperationException e) {
+			// Do nothing, it's the normal behavior
+		} catch (URISyntaxException e) {
+			// Should never happen
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.2 rule.
+	 */
+	public void testDoNotUseCompatibilityMarkup() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.2 -> A format consumer shall consider the use of the Markup Compatibility namespace to be an error.");
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.3 rule.
+	 */
+	public void testDCTermsNamespaceLimitedUse() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.3 -> Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.");
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.4 rule.
+	 */
+	public void testUnauthorizedXMLLangAttribute() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_UnauthorizedXMLLangAttributeFAIL.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.4 -> Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.");
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.5 rule.
+	 */
+	public void testLimitedXSITypeAttribute_NotPresent() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_LimitedXSITypeAttribute_NotPresentFAIL.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.5 -> Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.");
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+
+	/**
+	 * Test M4.5 rule.
+	 */
+	public void testLimitedXSITypeAttribute_PresentWithUnauthorizedValue() {
+		Package pkg = null;
+		try {
+			String filepath = System.getProperty("openxml4j.compliance.input")
+					+ File.separator
+					+ "OPCCompliance_CoreProperties_LimitedXSITypeAttribute_PresentWithUnauthorizedValueFAIL.docx";
+			pkg = Package.open(filepath);
+			// Normally must thrown an InvalidFormatException exception.
+			fail("OPC compliance failure: M4.5 -> Producers shall not create a document element that contains refinements to the Dublin Core elements, except for the two specified in the schema: <dcterms:created> and <dcterms:modified> Consumers shall consider a document element that violates this constraint to be an error.");
+		} catch (InvalidFormatException e) {
+			// Do nothing, it's the normal behavior
+		} finally {
+			if (pkg != null)
+				pkg.revert();
+		}
+	}
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_CoreProperties.java
------------------------------------------------------------------------------
    svn:executable = *

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PackageModel.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PackageModel.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PackageModel.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PackageModel.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,167 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.compliance;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
+import org.apache.poi.openxml4j.opc.ContentTypes;
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackagePartName;
+import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.TargetMode;
+
+import org.apache.poi.openxml4j.TestCore;
+
+/**
+ * Test Open Packaging Convention package model compliance.
+ * 
+ * M1.11 : A package implementer shall neither create nor recognize a part with
+ * a part name derived from another part name by appending segments to it.
+ * 
+ * @author Julien Chable
+ */
+public class OPCCompliance_PackageModel extends TestCase {
+
+	TestCore testCore = new TestCore(this.getClass());
+
+	public OPCCompliance_PackageModel(String name) {
+		super(name);
+	}
+
+	/**
+	 * A package implementer shall neither create nor recognize a part with a
+	 * part name derived from another part name by appending segments to it.
+	 * [M1.11]
+	 */
+	public void testPartNameDerivationAdditionFailure() {
+		Package pkg = null;
+		try {
+			pkg = Package.create("TODELETEIFEXIST.docx");
+			PackagePartName name = PackagingURIHelper
+					.createPartName("/word/document.xml");
+			PackagePartName nameDerived = PackagingURIHelper
+					.createPartName("/word/document.xml/image1.gif");
+			pkg.createPart(name, ContentTypes.XML);
+			pkg.createPart(nameDerived, ContentTypes.EXTENSION_GIF);
+		} catch (InvalidOperationException e) {
+			pkg.revert();
+			return;
+		} catch (InvalidFormatException e) {
+			fail(e.getMessage());
+		}
+		fail("A package implementer shall neither create nor recognize a part with a"
+				+ " part name derived from another part name by appending segments to it."
+				+ " [M1.11]");
+	}
+
+	/**
+	 * A package implementer shall neither create nor recognize a part with a
+	 * part name derived from another part name by appending segments to it.
+	 * [M1.11]
+	 */
+	public void testPartNameDerivationReadingFailure() {
+		String filepath = System.getProperty("openxml4j.compliance.input")
+				+ File.separator + "OPCCompliance_DerivedPartNameFAIL.docx";
+		try {
+			Package.open(filepath);
+		} catch (InvalidFormatException e) {
+			return;
+		}
+		fail("A package implementer shall neither create nor recognize a part with a"
+				+ " part name derived from another part name by appending segments to it."
+				+ " [M1.11]");
+	}
+
+	/**
+	 * Rule M1.12 : Packages shall not contain equivalent part names and package
+	 * implementers shall neither create nor recognize packages with equivalent
+	 * part names.
+	 */
+	public void testAddPackageAlreadyAddFailure() throws Exception {
+		Package pkg = Package.create("DELETEIFEXISTS.docx");
+		PackagePartName name1 = null;
+		PackagePartName name2 = null;
+		try {
+			name1 = PackagingURIHelper.createPartName("/word/document.xml");
+			name2 = PackagingURIHelper.createPartName("/word/document.xml");
+		} catch (InvalidFormatException e) {
+			throw new Exception(e.getMessage());
+		}
+		pkg.createPart(name1, ContentTypes.XML);
+		try {
+			pkg.createPart(name2, ContentTypes.XML);
+		} catch (InvalidOperationException e) {
+			return;
+		}
+		fail("Packages shall not contain equivalent part names and package implementers shall neither create nor recognize packages with equivalent part names. [M1.12]");
+	}
+
+	/**
+	 * Rule M1.12 : Packages shall not contain equivalent part names and package
+	 * implementers shall neither create nor recognize packages with equivalent
+	 * part names.
+	 */
+	public void testAddPackageAlreadyAddFailure2() throws Exception {
+		Package pkg = Package.create("DELETEIFEXISTS.docx");
+		PackagePartName partName = null;
+		try {
+			partName = PackagingURIHelper.createPartName("/word/document.xml");
+		} catch (InvalidFormatException e) {
+			throw new Exception(e.getMessage());
+		}
+		pkg.createPart(partName, ContentTypes.XML);
+		try {
+			pkg.createPart(partName, ContentTypes.XML);
+		} catch (InvalidOperationException e) {
+			return;
+		}
+		fail("Packages shall not contain equivalent part names and package implementers shall neither create nor recognize packages with equivalent part names. [M1.12]");
+	}
+
+	/**
+	 * Try to add a relationship to a relationship part.
+	 * 
+	 * Check rule M1.25: The Relationships part shall not have relationships to
+	 * any other part. Package implementers shall enforce this requirement upon
+	 * the attempt to create such a relationship and shall treat any such
+	 * relationship as invalid.
+	 */
+	public void testAddRelationshipRelationshipsPartFailure() {
+		Package pkg = Package.create("DELETEIFEXISTS.docx");
+		PackagePartName name1 = null;
+		try {
+			name1 = PackagingURIHelper
+					.createPartName("/test/_rels/document.xml.rels");
+		} catch (InvalidFormatException e) {
+			fail("This exception should never happen !");
+		}
+
+		try {
+			pkg.addRelationship(name1, TargetMode.INTERNAL,
+					PackageRelationshipTypes.CORE_DOCUMENT);
+		} catch (InvalidOperationException e) {
+			return;
+		}
+		fail("Fail test -> M1.25: The Relationships part shall not have relationships to any other part");
+	}
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PackageModel.java
------------------------------------------------------------------------------
    svn:executable = *

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PartName.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PartName.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PartName.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PartName.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,253 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.compliance;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import junit.framework.TestCase;
+
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.opc.PackagePartName;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+
+/**
+ * Test part name Open Packaging Convention compliance.
+ * 
+ * (Open Packaging Convention 8.1.1 Part names) :
+ * 
+ * The part name grammar is defined as follows:
+ * 
+ * part_name = 1*( "/" segment )
+ * 
+ * segment = 1*( pchar )
+ * 
+ * pchar is defined in RFC 3986.
+ * 
+ * The part name grammar implies the following constraints. The package
+ * implementer shall neither create any part that violates these constraints nor
+ * retrieve any data from a package as a part if the purported part name
+ * violates these constraints.
+ * 
+ * A part name shall not be empty. [M1.1]
+ * 
+ * A part name shall not have empty segments. [M1.3]
+ * 
+ * A part name shall start with a forward slash ("/") character. [M1.4]
+ * 
+ * A part name shall not have a forward slash as the last character. [M1.5]
+ * 
+ * A segment shall not hold any characters other than pchar characters. [M1.6]
+ * 
+ * Part segments have the following additional constraints. The package
+ * implementer shall neither create any part with a part name comprised of a
+ * segment that violates these constraints nor retrieve any data from a package
+ * as a part if the purported part name contains a segment that violates these
+ * constraints.
+ * 
+ * A segment shall not contain percent-encoded forward slash ("/"), or backward
+ * slash ("\") characters. [M1.7]
+ * 
+ * A segment shall not contain percent-encoded unreserved characters. [M1.8]
+ * 
+ * A segment shall not end with a dot (".") character. [M1.9]
+ * 
+ * A segment shall include at least one non-dot character. [M1.10]
+ * 
+ * A package implementer shall neither create nor recognize a part with a part
+ * name derived from another part name by appending segments to it. [M1.11]
+ * 
+ * Part name equivalence is determined by comparing part names as
+ * case-insensitive ASCII strings. [M1.12]
+ * 
+ * @author Julien Chable
+ * @version 1.0
+ */
+public class OPCCompliance_PartName extends TestCase {
+
+	public OPCCompliance_PartName(String name) {
+		super(name);
+	}
+
+	/**
+	 * Test some common invalid names.
+	 * 
+	 * A segment shall not contain percent-encoded unreserved characters. [M1.8]
+	 */
+	public void testInvalidPartNames() {
+		String[] invalidNames = { "/", "/xml./doc.xml", "[Content_Types].xml", "//xml/." };
+		for (String s : invalidNames) {
+			URI uri = null;
+			try {
+				uri = new URI(s);
+			} catch (URISyntaxException e) {
+				assertTrue(s == "[Content_Types].xml");
+				continue;
+			}
+			assertFalse("This part name SHOULD NOT be valid: " + s,
+					PackagingURIHelper.isValidPartName(uri));
+		}
+	}
+
+	/**
+	 * Test some common valid names.
+	 */
+	public void testValidPartNames() throws URISyntaxException {
+		String[] validNames = { "/xml/item1.xml", "/document.xml",
+				"/a/%D1%86.xml" };
+		for (String s : validNames)
+			assertTrue("This part name SHOULD be valid: " + s,
+					PackagingURIHelper.isValidPartName(new URI(s)));
+	}
+
+	/**
+	 * A part name shall not be empty. [M1.1]
+	 */
+	public void testEmptyPartNameFailure() throws URISyntaxException {
+		try {
+			PackagingURIHelper.createPartName(new URI(""));
+			fail("A part name shall not be empty. [M1.1]");
+		} catch (InvalidFormatException e) {
+			// Normal behaviour
+		}
+	}
+
+	/**
+	 * A part name shall not have empty segments. [M1.3]
+	 * 
+	 * A segment shall not end with a dot ('.') character. [M1.9]
+	 * 
+	 * A segment shall include at least one non-dot character. [M1.10]
+	 */
+	public void testPartNameWithInvalidSegmentsFailure() {
+		String[] invalidNames = { "//document.xml", "//word/document.xml",
+				"/word//document.rels", "/word//rels//document.rels",
+				"/xml./doc.xml", "/document.", "/./document.xml",
+				"/word/./doc.rels", "/%2F/document.xml" };
+		try {
+			for (String s : invalidNames)
+				assertFalse(
+						"A part name shall not have empty segments. [M1.3]",
+						PackagingURIHelper.isValidPartName(new URI(s)));
+		} catch (URISyntaxException e) {
+			fail();
+		}
+	}
+
+	/**
+	 * A segment shall not hold any characters other than pchar characters.
+	 * [M1.6].
+	 */
+	public void testPartNameWithNonPCharCharacters() {
+		String[] invalidNames = { "/doc�&.xml" };
+		try {
+			for (String s : invalidNames)
+				assertTrue(
+						"A segment shall not contain non pchar characters [M1.6] : "
+								+ s, PackagingURIHelper
+								.isValidPartName(new URI(s)));
+		} catch (URISyntaxException e) {
+			fail();
+		}
+	}
+
+	/**
+	 * A segment shall not contain percent-encoded unreserved characters [M1.8].
+	 */
+	public void testPartNameWithUnreservedEncodedCharactersFailure() {
+		String[] invalidNames = { "/a/docum%65nt.xml" };
+		try {
+			for (String s : invalidNames)
+				assertFalse(
+						"A segment shall not contain percent-encoded unreserved characters [M1.8] : "
+								+ s, PackagingURIHelper
+								.isValidPartName(new URI(s)));
+		} catch (URISyntaxException e) {
+			fail();
+		}
+	}
+
+	/**
+	 * A part name shall start with a forward slash ('/') character. [M1.4]
+	 */
+	public void testPartNameStartsWithAForwardSlashFailure()
+			throws URISyntaxException {
+		try {
+			PackagingURIHelper.createPartName(new URI("document.xml"));
+			fail("A part name shall start with a forward slash ('/') character. [M1.4]");
+		} catch (InvalidFormatException e) {
+			// Normal behaviour
+		}
+	}
+
+	/**
+	 * A part name shall not have a forward slash as the last character. [M1.5]
+	 */
+	public void testPartNameEndsWithAForwardSlashFailure()
+			throws URISyntaxException {
+		try {
+			PackagingURIHelper.createPartName(new URI("/document.xml/"));
+			fail("A part name shall not have a forward slash as the last character. [M1.5]");
+		} catch (InvalidFormatException e) {
+			// Normal behaviour
+		}
+
+	}
+
+	/**
+	 * Part name equivalence is determined by comparing part names as
+	 * case-insensitive ASCII strings. [M1.12]
+	 */
+	public void testPartNameComparaison() throws Exception {
+		String[] partName1 = { "/word/document.xml", "/docProps/core.xml",
+				"/rels/.rels" };
+		String[] partName2 = { "/WORD/DocUment.XML", "/docProps/core.xml",
+				"/rels/.rels" };
+		for (int i = 0; i < partName1.length || i < partName2.length; ++i) {
+			PackagePartName p1 = PackagingURIHelper
+					.createPartName(partName1[i]);
+			PackagePartName p2 = PackagingURIHelper
+					.createPartName(partName2[i]);
+			assertTrue(p1.equals(p2));
+			assertTrue(p1.compareTo(p2) == 0);
+			assertTrue(p1.hashCode() == p2.hashCode());
+		}
+	}
+
+	/**
+	 * Part name equivalence is determined by comparing part names as
+	 * case-insensitive ASCII strings. [M1.12].
+	 * 
+	 * All the comparaisons MUST FAIL !
+	 */
+	public void testPartNameComparaisonFailure() throws Exception {
+		String[] partName1 = { "/word/document.xml", "/docProps/core.xml",
+				"/rels/.rels" };
+		String[] partName2 = { "/WORD/DocUment.XML2", "/docProp/core.xml",
+				"/rels/rels" };
+		for (int i = 0; i < partName1.length || i < partName2.length; ++i) {
+			PackagePartName p1 = PackagingURIHelper
+					.createPartName(partName1[i]);
+			PackagePartName p2 = PackagingURIHelper
+					.createPartName(partName2[i]);
+			assertFalse(p1.equals(p2));
+			assertFalse(p1.compareTo(p2) == 0);
+			assertFalse(p1.hashCode() == p2.hashCode());
+		}
+	}
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/compliance/OPCCompliance_PartName.java
------------------------------------------------------------------------------
    svn:executable = *

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/AllTests.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/AllTests.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/AllTests.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/AllTests.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,33 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.internal;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+				"Test for test.org.apache.poi.openxml4j.opc.internal");
+		//$JUnit-BEGIN$
+		suite.addTestSuite(TestContentTypeManager.class);
+		//$JUnit-END$
+		return suite;
+	}
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/AllTests.java
------------------------------------------------------------------------------
    svn:executable = *

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/INPUT/sample.docx
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/INPUT/sample.docx?rev=738842&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/INPUT/sample.docx
------------------------------------------------------------------------------
    svn:executable = *

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/INPUT/sample.docx
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java?rev=738842&view=auto
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java (added)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java Thu Jan 29 12:44:31 2009
@@ -0,0 +1,122 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.internal;
+
+import junit.framework.TestCase;
+
+import org.apache.poi.openxml4j.opc.PackagePartName;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.internal.ContentTypeManager;
+import org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager;
+
+import org.apache.poi.openxml4j.TestCore;
+
+public class TestContentTypeManager extends TestCase {
+
+	TestCore testCore = new TestCore(this.getClass());
+
+	/**
+	 * Test the properties part content parsing.
+	 */
+	public void testContentType() throws Exception {
+		// File originalFile = new File(testCore.getTestRootPath() +
+		// File.separator +
+		// "sample.docx");
+		//
+		// // Retrieves core properties part
+		// Package p = Package.open(originalFile.getAbsolutePath(),
+		// PackageAccess.READ);
+		// PackageRelationship corePropertiesRelationship = p
+		// .getRelationshipsByType(
+		// PackageRelationshipTypes.CORE_PROPERTIES)
+		// .getRelationship(0);
+		// PackagePart coreDocument = p.getPart(corePropertiesRelationship);
+		//
+		// ContentTypeManager ctm = new ZipContentTypeManager(coreDocument
+		// .getInputStream());
+		//
+		// // TODO
+		//fail();
+	}
+
+	/**
+	 * Test the addition of several default and override content types.
+	 */
+	public void testContentTypeAddition() throws Exception {
+		ContentTypeManager ctm = new ZipContentTypeManager(null, null);
+
+		PackagePartName name1 = PackagingURIHelper
+				.createPartName("/foo/foo.XML");
+		PackagePartName name2 = PackagingURIHelper
+				.createPartName("/foo/foo2.xml");
+		PackagePartName name3 = PackagingURIHelper
+				.createPartName("/foo/doc.rels");
+		PackagePartName name4 = PackagingURIHelper
+				.createPartName("/foo/doc.RELS");
+
+		// Add content types
+		ctm.addContentType(name1, "foo-type1");
+		ctm.addContentType(name2, "foo-type2");
+		ctm.addContentType(name3, "text/xml+rel");
+		ctm.addContentType(name4, "text/xml+rel");
+
+		assertEquals(ctm.getContentType(name1), "foo-type1");
+		assertEquals(ctm.getContentType(name2), "foo-type2");
+		assertEquals(ctm.getContentType(name3), "text/xml+rel");
+		assertEquals(ctm.getContentType(name3), "text/xml+rel");
+	}
+
+	/**
+	 * Test the addition then removal of content types.
+	 */
+	public void testContentTypeRemoval() throws Exception {
+		ContentTypeManager ctm = new ZipContentTypeManager(null, null);
+
+		PackagePartName name1 = PackagingURIHelper
+				.createPartName("/foo/foo.xml");
+		PackagePartName name2 = PackagingURIHelper
+				.createPartName("/foo/foo2.xml");
+		PackagePartName name3 = PackagingURIHelper
+				.createPartName("/foo/doc.rels");
+		PackagePartName name4 = PackagingURIHelper
+				.createPartName("/foo/doc.RELS");
+
+		// Add content types
+		ctm.addContentType(name1, "foo-type1");
+		ctm.addContentType(name2, "foo-type2");
+		ctm.addContentType(name3, "text/xml+rel");
+		ctm.addContentType(name4, "text/xml+rel");
+		ctm.removeContentType(name2);
+		ctm.removeContentType(name3);
+
+		assertEquals(ctm.getContentType(name1), "foo-type1");
+		assertEquals(ctm.getContentType(name2), "foo-type1");
+		assertEquals(ctm.getContentType(name3), null);
+
+		ctm.removeContentType(name1);
+		assertEquals(ctm.getContentType(name1), null);
+		assertEquals(ctm.getContentType(name2), null);
+	}
+
+	/**
+	 * Test the addition then removal of content types in a package.
+	 */
+	public void testContentTypeRemovalPackage() throws Exception {
+		// TODO
+	}
+}

Propchange: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/internal/TestContentTypeManager.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/ss/TestWorkbookFactory.java Thu Jan 29 12:44:31 2009
@@ -24,7 +24,7 @@
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.usermodel.WorkbookFactory;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.Package;
 
 import junit.framework.TestCase;
 

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFSlideShow.java Thu Jan 29 12:44:31 2009
@@ -19,8 +19,8 @@
 import java.io.File;
 
 import org.apache.poi.POIXMLDocument;
-import org.openxml4j.opc.Package;
-import org.openxml4j.opc.PackagePart;
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackagePart;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdListEntry;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideMasterIdListEntry;
 

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFTestDataSamples.java Thu Jan 29 12:44:31 2009
@@ -23,8 +23,8 @@
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.openxml4j.exceptions.InvalidFormatException;
-import org.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.opc.Package;
 
 /**
  * Centralises logic for finding/opening sample files in the src/testcases/org/apache/poi/hssf/hssf/data folder. 

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/eventusermodel/TestXSSFReader.java Thu Jan 29 12:44:31 2009
@@ -25,7 +25,7 @@
 
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.usermodel.XSSFRichTextString;
-import org.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.Package;
 
 /**
  * Tests for XSSFReader

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java Thu Jan 29 12:44:31 2009
@@ -20,7 +20,6 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.util.List;
 
 import org.apache.poi.ss.usermodel.Cell;
@@ -33,9 +32,7 @@
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 import org.apache.poi.POIXMLDocumentPart;
-import org.openxml4j.opc.Package;
-import org.openxml4j.opc.PackagePart;
-import org.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.Package;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
 
 import junit.framework.TestCase;

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java Thu Jan 29 12:44:31 2009
@@ -32,7 +32,7 @@
 import org.apache.poi.ss.usermodel.FormulaEvaluator;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
-import org.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.Package;
 
 /**
  * Performs much the same role as {@link TestFormulasFromSpreadsheet},

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Thu Jan 29 12:44:31 2009
@@ -21,9 +21,9 @@
 
 import junit.framework.TestCase;
 
-import org.openxml4j.opc.Package;
-import org.openxml4j.opc.PackagePart;
-import org.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackagePart;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 
 public class TestXSSFBugs extends TestCase {

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDrawing.java Thu Jan 29 12:44:31 2009
@@ -19,10 +19,8 @@
 import junit.framework.TestCase;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 import org.apache.poi.POIXMLDocumentPart;
-import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing;
 
 import java.util.List;
-import java.io.IOException;
 
 /**
  * @author Yegor Kozlov
@@ -73,7 +71,7 @@
             XSSFSheet sheet = wb.createSheet();
             XSSFDrawing drawing = sheet.createDrawingPatriarch();
         }
-        org.openxml4j.opc.Package pkg = wb.getPackage();
+        org.apache.poi.openxml4j.opc.Package pkg = wb.getPackage();
         assertEquals(3, pkg.getPartsByContentType(XSSFRelation.DRAWINGS.getContentType()).size());
     }
 }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFHyperlink.java Thu Jan 29 12:44:31 2009
@@ -26,7 +26,6 @@
 import org.apache.poi.ss.usermodel.Hyperlink;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.xssf.XSSFTestDataSamples;
-import org.openxml4j.opc.Package;
 
 public class TestXSSFHyperlink extends TestCase {
     public TestXSSFHyperlink(String name) {

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java Thu Jan 29 12:44:31 2009
@@ -28,10 +28,10 @@
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 import org.apache.poi.xssf.model.StylesTable;
-import org.openxml4j.opc.ContentTypes;
-import org.openxml4j.opc.Package;
-import org.openxml4j.opc.PackagePart;
-import org.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.ContentTypes;
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackagePart;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook;
 

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFDocument.java?rev=738842&r1=738841&r2=738842&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFDocument.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFDocument.java Thu Jan 29 12:44:31 2009
@@ -21,8 +21,8 @@
 import org.apache.poi.POIXMLDocument;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFRelation;
-import org.openxml4j.opc.Package;
-import org.openxml4j.opc.PackagePart;
+import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.PackagePart;
 
 import junit.framework.TestCase;
 



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