chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r917573 - in /incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework: AbstractCmisTestCase.java AbstractSimpleReadWriteTests.java
Date Mon, 01 Mar 2010 16:33:15 GMT
Author: dcaruana
Date: Mon Mar  1 16:33:15 2010
New Revision: 917573

URL: http://svn.apache.org/viewvc?rev=917573&view=rev
Log:
OpenCMIS provider tests take into account mimetype parameters when comparing mimetypes

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractCmisTestCase.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractSimpleReadWriteTests.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractCmisTestCase.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractCmisTestCase.java?rev=917573&r1=917572&r2=917573&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractCmisTestCase.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractCmisTestCase.java
Mon Mar  1 16:33:15 2010
@@ -1218,6 +1218,19 @@
     }
   }
 
+  protected void assertMimeType(String expected, String actual)
+  {
+      assertNotNull(expected);
+      assertNotNull(actual);
+      
+      int paramIdx = actual.indexOf(';');
+      if (paramIdx != -1) {
+          actual = actual.substring(0, paramIdx);
+      }
+      
+      assertEquals(expected, actual);
+  }
+  
   protected void assertEqualLists(List<?> expected, List<?> actual) {
     if ((expected == null) && (actual == null)) {
       return;

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractSimpleReadWriteTests.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractSimpleReadWriteTests.java?rev=917573&r1=917572&r2=917573&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractSimpleReadWriteTests.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/framework/AbstractSimpleReadWriteTests.java
Mon Mar  1 16:33:15 2010
@@ -23,7 +23,6 @@
 import java.util.List;
 
 import org.apache.opencmis.commons.PropertyIds;
-import org.apache.opencmis.commons.enums.AclPropagation;
 import org.apache.opencmis.commons.enums.CapabilityContentStreamUpdates;
 import org.apache.opencmis.commons.enums.UnfileObjects;
 import org.apache.opencmis.commons.enums.VersioningState;
@@ -105,7 +104,7 @@
 
     // read and assert content
     ContentStreamData contentStream2 = getContent(docId, null);
-    assertEquals(CONTENT_TYPE, contentStream2.getMimeType());
+    assertMimeType(CONTENT_TYPE, contentStream2.getMimeType());
     if (contentStream2.getLength() != null) {
       assertEquals(CONTENT.length, contentStream2.getLength().intValue());
     }
@@ -233,7 +232,7 @@
       docId = docIdHolder.getValue();
     }
     ContentStreamData contentStream3 = getContent(docId, null);
-    assertEquals(CONTENT_TYPE, contentStream3.getMimeType());
+    assertMimeType(CONTENT_TYPE, contentStream3.getMimeType());
     if (contentStream3.getLength() != null) {
       assertEquals(CONTENT2.length, contentStream3.getLength().intValue());
     }



Mime
View raw message