chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1190701 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/ chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/...
Date Sat, 29 Oct 2011 00:15:26 GMT
Author: fmui
Date: Sat Oct 29 00:15:26 2011
New Revision: 1190701

URL: http://svn.apache.org/viewvc?rev=1190701&view=rev
Log:
code clean up and minor improvements

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java?rev=1190701&r1=1190700&r2=1190701&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisHttpCookie.java
Sat Oct 29 00:15:26 2011
@@ -362,6 +362,7 @@ public final class CmisHttpCookie implem
         });
 
         attributeSet.put("expires", new Setter() {
+            @SuppressWarnings("deprecation")
             @Override
             void setValue(String value, CmisHttpCookie cookie) {
                 cookie.setVersion(0);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java?rev=1190701&r1=1190700&r2=1190701&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
Sat Oct 29 00:15:26 2011
@@ -176,8 +176,10 @@ public class BrowserBindingUtils {
      */
     public static void prepareContext(CallContext context, CallUrl callUrl, CmisService service,
String repositoryId,
             String objectId, String transaction, HttpServletRequest request) {
+        CallContextImpl contextImpl = null;
         if (context instanceof CallContextImpl) {
-            ((CallContextImpl) context).put(CONTEXT_TRANSACTION, transaction);
+            contextImpl = (CallContextImpl) context;
+            contextImpl.put(CONTEXT_TRANSACTION, transaction);
         }
 
         if (callUrl != CallUrl.ROOT) {
@@ -194,12 +196,10 @@ public class BrowserBindingUtils {
                     "cmis:none", false, false, null);
         }
 
-        if (context instanceof CallContextImpl) {
-            ((CallContextImpl) context).put(CONTEXT_OBJECT_ID, object.getId());
-            ((CallContextImpl) context).put(CONTEXT_OBJECT_TYPE_ID,
-                    getProperty(object, PropertyIds.OBJECT_TYPE_ID, String.class));
-            ((CallContextImpl) context).put(CONTEXT_BASETYPE_ID,
-                    getProperty(object, PropertyIds.BASE_TYPE_ID, String.class));
+        if (contextImpl != null) {
+            contextImpl.put(CONTEXT_OBJECT_ID, object.getId());
+            contextImpl.put(CONTEXT_OBJECT_TYPE_ID, getProperty(object, PropertyIds.OBJECT_TYPE_ID,
String.class));
+            contextImpl.put(CONTEXT_BASETYPE_ID, getProperty(object, PropertyIds.BASE_TYPE_ID,
String.class));
         }
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java?rev=1190701&r1=1190700&r2=1190701&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java
Sat Oct 29 00:15:26 2011
@@ -46,10 +46,13 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.jaxb.VersioningServicePort;
 import org.apache.chemistry.opencmis.commons.server.CmisService;
 
+import com.sun.xml.ws.developer.StreamingAttachment;
+
 /**
  * CMIS Versioning Service.
  */
 @MTOM
+@StreamingAttachment(parseEagerly = true, memoryThreshold = 4 * 1024 * 1204)
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.VersioningServicePort")
 public class VersioningService extends AbstractService implements VersioningServicePort {
     @Resource

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java?rev=1190701&r1=1190700&r2=1190701&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-tck/src/main/java/org/apache/chemistry/opencmis/tck/tests/versioning/VersioingStateCreateTest.java
Sat Oct 29 00:15:26 2011
@@ -25,6 +25,7 @@ import static org.apache.chemistry.openc
 import java.io.ByteArrayInputStream;
 import java.math.BigInteger;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.api.Document;
@@ -73,6 +74,11 @@ public class VersioingStateCreateTest ex
             f = createResult(FAILURE, "Document should be major version.");
             addResult(assertIsTrue(docMajor.isMajorVersion(), null, f));
 
+            List<Document> versions = docMajor.getAllVersions();
+
+            f = createResult(FAILURE, "Version series should have one version but has " +
versions.size() + ".");
+            addResult(assertEquals(1, versions.size(), null, f));
+
             deleteObject(docMajor);
 
             // minor version
@@ -84,6 +90,11 @@ public class VersioingStateCreateTest ex
                 f = createResult(FAILURE, "Document should be minor version.");
                 addResult(assertIsFalse(docMinor.isMajorVersion(), null, f));
 
+                versions = docMinor.getAllVersions();
+
+                f = createResult(FAILURE, "Version series should have one version but has
" + versions.size() + ".");
+                addResult(assertEquals(1, versions.size(), null, f));
+
                 deleteObject(docMinor);
             } catch (CmisConstraintException ce) {
                 addResult(createResult(WARNING, "Creating a minor version failed! "
@@ -103,6 +114,11 @@ public class VersioingStateCreateTest ex
                 f = createResult(FAILURE, "Version series should be checked out.");
                 addResult(assertIsTrue(docCheckedOut.isVersionSeriesCheckedOut(), null, f));
 
+                versions = docCheckedOut.getAllVersions();
+
+                f = createResult(FAILURE, "Version series should have one version but has
" + versions.size() + ".");
+                addResult(assertEquals(1, versions.size(), null, f));
+
                 docCheckedOut.cancelCheckOut();
             } catch (CmisConstraintException ce) {
                 addResult(createResult(WARNING, "Creating a checked out version failed! "



Mime
View raw message