jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r713037 - in /jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi: Helper.java RepositoryServiceTest.java SessionInfoTest.java
Date Tue, 11 Nov 2008 13:32:18 GMT
Author: angela
Date: Tue Nov 11 05:32:17 2008
New Revision: 713037

URL: http://svn.apache.org/viewvc?rev=713037&view=rev
Log:
JCR-1851: Helper does not properly retrieve org.apache.jackrabbit.spi.workspacename param.
+ minor improvement of test cases

Modified:
    jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/Helper.java
    jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/RepositoryServiceTest.java
    jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/SessionInfoTest.java

Modified: jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/Helper.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/Helper.java?rev=713037&r1=713036&r2=713037&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/Helper.java (original)
+++ jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/Helper.java Tue
Nov 11 05:32:17 2008
@@ -101,14 +101,16 @@
     public SessionInfo getAdminSessionInfo() throws RepositoryException {
         // force assignment of repoStub
         getRepositoryService();
-        String wspName = repoServiceStub.getProperty(RepositoryServiceStub.PROP_WORKSPACE);
+        String propName = RepositoryServiceStub.PROP_PREFIX + "." + RepositoryServiceStub.PROP_WORKSPACE;
+        String wspName = repoServiceStub.getProperty(propName);
         return getRepositoryService().obtain(getAdminCredentials(), wspName);
     }
 
     public SessionInfo getReadOnlySessionInfo() throws RepositoryException {
         // force assignment of repoStub
         getRepositoryService();
-        String wspName = repoServiceStub.getProperty(RepositoryServiceStub.PROP_WORKSPACE);
+        String propName = RepositoryServiceStub.PROP_PREFIX + "." + RepositoryServiceStub.PROP_WORKSPACE;
+        String wspName = repoServiceStub.getProperty(propName);
         return getRepositoryService().obtain(getReadOnlyCredentials(), wspName);
     }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/RepositoryServiceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/RepositoryServiceTest.java?rev=713037&r1=713036&r2=713037&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/RepositoryServiceTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/RepositoryServiceTest.java
Tue Nov 11 05:32:17 2008
@@ -58,7 +58,18 @@
         assertTrue("Workspace names must contain at least a single workspace", workspaceNames.length
> 0);
 
         String wspName = getProperty(RepositoryServiceStub.PROP_WORKSPACE);
-        assertTrue("Workspace name used for retrieving the SessionInfo must be included in
the available workspaces.", Arrays.asList(workspaceNames).contains(wspName));
+        if (wspName != null) {
+            assertTrue("Workspace name used for retrieving the SessionInfo must be included
in the available workspaces.", Arrays.asList(workspaceNames).contains(wspName));
+        }
+    }
+
+    public void testNullWorkspaceName() throws RepositoryException {
+        SessionInfo sInfo = service.obtain(helper.getAdminCredentials(), null);
+        try {
+            assertNotNull(sInfo.getWorkspaceName());
+        } finally {
+            service.dispose(sInfo);
+        }
     }
 
     // TODO: add more tests

Modified: jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/SessionInfoTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/SessionInfoTest.java?rev=713037&r1=713036&r2=713037&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/SessionInfoTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi/src/test/java/org/apache/jackrabbit/spi/SessionInfoTest.java
Tue Nov 11 05:32:17 2008
@@ -42,7 +42,11 @@
     }
 
     public void testGetWorkspaceName() {
-        assertEquals(workspaceName, sessionInfo.getWorkspaceName());
+        if (workspaceName == null) {
+            assertNotNull(sessionInfo.getWorkspaceName());
+        } else {
+            assertEquals(workspaceName, sessionInfo.getWorkspaceName());
+        }
     }
 
     // TODO: add more tests



Mime
View raw message