chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1609656 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src: main/java/org/apache/chemistry/opencmis/server/impl/ main/java/org/apache/chemistry/opencmis/server/impl/webservices/ test/java/org/ap...
Date Fri, 11 Jul 2014 09:39:11 GMT
Author: fmui
Date: Fri Jul 11 09:39:11 2014
New Revision: 1609656

URL: http://svn.apache.org/r1609656
Log:
checks for CMIS version in CallContext

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CallContextImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/CallContextImplTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CallContextImpl.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/CallContextImpl.java?rev=1609656&r1=1609655&r2=1609656&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CallContextImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/CallContextImpl.java
Fri Jul 11 09:39:11 2014
@@ -51,6 +51,9 @@ public class CallContextImpl implements 
         put(REPOSITORY_ID, repositoryId);
 
         // CMIS version
+        if (cmisVersion == null) {
+            throw new IllegalArgumentException("CMIS version must be set!");
+        }
         put(CallContext.CMIS_VERSION, cmisVersion);
 
         // servlet context and HTTP servlet request and response

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.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/AbstractService.java?rev=1609656&r1=1609655&r2=1609656&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java
Fri Jul 11 09:39:11 2014
@@ -97,6 +97,9 @@ public abstract class AbstractService {
                 MessageContext.SERVLET_RESPONSE);
 
         CmisVersion cmisVersion = (CmisVersion) request.getAttribute(CmisWebServicesServlet.CMIS_VERSION);
+        if (cmisVersion == null) {
+            throw new CmisRuntimeException("Server configuration issue. CMIS version not
set!");
+        }
 
         CallContextImpl context = new CallContextImpl(CallContext.BINDING_WEBSERVICES, cmisVersion,
repositoryId,
                 servletContext, request, response, factory, null);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/CallContextImplTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/CallContextImplTest.java?rev=1609656&r1=1609655&r2=1609656&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/CallContextImplTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/CallContextImplTest.java
Fri Jul 11 09:39:11 2014
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.se
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.junit.Test;
 
@@ -28,7 +29,7 @@ public class CallContextImplTest {
 
     @Test
     public void testLocal() {
-        CallContextImpl context = new CallContextImpl(null, null, null, null, null, null,
null, null);
+        CallContextImpl context = new CallContextImpl(null, CmisVersion.CMIS_1_1, null, null,
null, null, null, null);
 
         context.setAcceptLanguage(" en - us ");
         assertEquals("en", context.get(CallContext.LOCALE_ISO639_LANGUAGE));
@@ -48,7 +49,7 @@ public class CallContextImplTest {
 
     @Test
     public void testRange() {
-        CallContextImpl context = new CallContextImpl(null, null, null, null, null, null,
null, null);
+        CallContextImpl context = new CallContextImpl(null, CmisVersion.CMIS_1_1, null, null,
null, null, null, null);
 
         context.setRange("bytes=100-299");
         assertEquals(100L, context.getOffset().longValue());



Mime
View raw message