jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r711566 - in /jackrabbit/trunk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/ jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ jackrabbi...
Date Wed, 05 Nov 2008 13:48:26 GMT
Author: angela
Date: Wed Nov  5 05:48:26 2008
New Revision: 711566

URL: http://svn.apache.org/viewvc?rev=711566&view=rev
Log:
JCR-1842JCR-1842: RepositoryService.obtain should allow to pass null workspaceName indicating
the default workspace

Added:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
    jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
    jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java?rev=711566&r1=711565&r2=711566&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
Wed Nov  5 05:48:26 2008
@@ -79,8 +79,7 @@
      * @see Repository#login(javax.jcr.Credentials, String)
      */
     public Session login(Credentials credentials, String workspaceName) throws LoginException,
NoSuchWorkspaceException, RepositoryException {
-        String wspName = (workspaceName == null) ? config.getDefaultWorkspaceName() : workspaceName;
-        SessionInfo info = config.getRepositoryService().obtain(credentials, wspName);
+        SessionInfo info = config.getRepositoryService().obtain(credentials, workspaceName);
         try {
             if (info instanceof XASessionInfo) {
                 return new XASessionImpl((XASessionInfo) info, this, config);

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java?rev=711566&r1=711565&r2=711566&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
Wed Nov  5 05:48:26 2008
@@ -32,8 +32,6 @@
 
     public RepositoryService getRepositoryService() throws RepositoryException;
 
-    public String getDefaultWorkspaceName();
-
     public CacheBehaviour getCacheBehaviour();
 
     public int getItemCacheSize();

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java?rev=711566&r1=711565&r2=711566&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
Wed Nov  5 05:48:26 2008
@@ -30,10 +30,6 @@
 
     private static final int DEFAULT_ITEM_CACHE_SIZE = 5000;
 
-    public String getDefaultWorkspaceName() {
-        return null;
-    }
-
     public CacheBehaviour getCacheBehaviour() {
         return CacheBehaviour.INVALIDATE;
     }

Added: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java?rev=711566&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
(added)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
Wed Nov  5 05:48:26 2008
@@ -0,0 +1,57 @@
+/*
+ * 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.jackrabbit.jcr2spi;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.test.AbstractJCRTest;
+
+import javax.jcr.Session;
+import javax.jcr.RepositoryException;
+
+/** <code>LoginTest</code>... */
+public class LoginTest extends AbstractJCRTest {
+
+    private static Logger log = LoggerFactory.getLogger(LoginTest.class);
+
+    public void testNullLogin() throws RepositoryException {
+        Session s = helper.getRepository().login();
+        try {
+            assertNotNull(s.getWorkspace().getName());
+        } finally {
+            s.logout();
+        }
+    }
+
+    public void testNullWorkspaceLogin() throws RepositoryException {
+        Session s = helper.getRepository().login((String) null);
+        try {
+            assertNotNull(s.getWorkspace().getName());
+        } finally {
+            s.logout();
+        }
+    }
+
+    public void testNullCredentialsNullWorkspaceLogin() throws RepositoryException {
+        Session s = helper.getRepository().login(null, null);
+        try {
+            assertNotNull(s.getWorkspace().getName());
+        } finally {
+            s.logout();
+        }
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java?rev=711566&r1=711565&r2=711566&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
Wed Nov  5 05:48:26 2008
@@ -96,6 +96,9 @@
         suite.addTestSuite(ExternalModificationTest.class);
         suite.addTestSuite(IsSameTest.class);
 
+        // repository
+        suite.addTestSuite(LoginTest.class);
+        
         return suite;
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=711566&r1=711565&r2=711566&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
Wed Nov  5 05:48:26 2008
@@ -130,7 +130,8 @@
      *
      * @param credentials the credentials of the user.
      * @param workspaceName the name of the workspace the <code>SessionInfo</code>
-     * should be built for.
+     * should be built for. If the specified workspaceName is <code>null</code>
+     * the implementation should select a default workspace.
      * @return a <code>SessionInfo</code> if authentication was successful.
      * @throws LoginException           if authentication of the user fails.
      * @throws NoSuchWorkspaceException if the specified <code>workspaceName</code>
@@ -146,7 +147,8 @@
      *
      * @param sessionInfo for another workspace
      * @param workspaceName the name of the workspace the new <code>SessionInfo</code>
-     * should be built for.
+     * should be built for. If the specified workspaceName is <code>null</code>
+     * the implementation should select a default workspace.
      * @return a <code>SessionInfo</code> if authentication was successful.
      * @throws LoginException           if authentication of the user fails.
      * @throws NoSuchWorkspaceException if the specified <code>workspaceName</code>

Modified: jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties?rev=711566&r1=711565&r2=711566&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties (original)
+++ jackrabbit/trunk/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties Wed
Nov  5 05:48:26 2008
@@ -26,8 +26,6 @@
 # Use this stub implementation for testing Jackrabbit-Core over JNDI without intermediate
SPI
 # javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.spi2jcr.DefaultRepositoryStub
 
-# name of the default workspace
-org.apache.jackrabbit.jcr2spi.workspace.name=default
 # alternative workspace used for update tests etc.
 org.apache.jackrabbit.jcr2spi.workspace2.name=test
 



Mime
View raw message