jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r156050 - in incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config: RepositoryConfigTest.java WorkspaceConfigTest.java workspace.xml
Date Thu, 03 Mar 2005 15:20:41 GMT
Author: jukka
Date: Thu Mar  3 07:20:40 2005
New Revision: 156050

URL: http://svn.apache.org/viewcvs?view=rev&rev=156050
Log:
Test case for workspace configuration handling. (JCR-53)

Added:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/workspace.xml
Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/RepositoryConfigTest.java

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/RepositoryConfigTest.java?view=diff&r1=156049&r2=156050
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/RepositoryConfigTest.java
Thu Mar  3 07:20:40 2005
@@ -6,7 +6,7 @@
  * 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
+ *      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,
@@ -42,15 +42,15 @@
 
         assertEquals("foo", config.getHomeDir());
         assertEquals("default", config.getDefaultWorkspaceName());
-        assertEquals("foo/workspace", config.getWorkspacesConfigRootDir());
+        assertEquals("foo/workspaces", config.getWorkspacesConfigRootDir());
         assertEquals("Jackrabbit", config.getAppName());
-        
+
         AccessManagerConfig amc = config.getAccessManagerConfig();
         assertEquals(
                 "org.apache.jackrabbit.core.security.SimpleAccessManager",
                 amc.getClassName());
         assertTrue(amc.getParameters().isEmpty());
-        
+
         VersioningConfig vc = config.getVersioningConfig();
         assertEquals(new File("foo/version"), vc.getHomeDir());
         assertEquals(

Added: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java?view=auto&rev=156050
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java
(added)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java
Thu Mar  3 07:20:40 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed 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.core.config;
+
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.xml.sax.InputSource;
+
+/**
+ * Test cases for workspace configuration handling.
+ */
+public class WorkspaceConfigTest extends TestCase {
+
+    /**
+     * Test that a standard workspace configuration file is
+     * correctly parsed.
+     *
+     * @throws Exception on errors
+     */
+    public void testWorkspaceXml() throws Exception {
+        InputStream xml = getClass().getClassLoader().getResourceAsStream(
+                "org/apache/jackrabbit/core/config/workspace.xml");
+        WorkspaceConfig config =
+            WorkspaceConfig.create(new InputSource(xml), "foo");
+
+        assertEquals("foo", config.getHomeDir());
+        assertEquals("default", config.getName());
+
+        PersistenceManagerConfig pmc = config.getPersistenceManagerConfig();
+        assertEquals(
+                "org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager",
+                pmc.getClassName());
+        assertTrue(pmc.getParameters().isEmpty());
+
+        SearchConfig sc = config.getSearchConfig();
+        assertEquals(
+                "org.apache.jackrabbit.core.search.lucene.SearchIndex",
+                sc.getHandlerClassName());
+        assertEquals(4, sc.getParameters().size());
+        assertEquals("true", sc.getParameters().get("useCompoundFile"));
+        assertEquals("1000", sc.getParameters().get("minMergeDocs"));
+        assertEquals("10000", sc.getParameters().get("maxMergeDocs"));
+        assertEquals("10", sc.getParameters().get("mergeFactor"));
+    }
+
+}

Added: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/workspace.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/workspace.xml?view=auto&rev=156050
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/workspace.xml (added)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/config/workspace.xml Thu
Mar  3 07:20:40 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace name="default">
+  <!--
+      virtual file system of the workspace:
+      class: FQN of class implementing FileSystem interface
+  -->
+  <FileSystem class="com.day.jackrabbit.fs.cq.CQFileSystem">
+    <param name="path" value="${wsp.home}/data/wspStore.dat"/>
+    <param name="autoRepair" value="false"/>
+    <param name="blockSize" value="128"/>
+    <param name="autoSync" value="false"/>
+  </FileSystem>
+  <!--
+      persistence of the workspace:
+      class: FQN of class implementing PersistenceManager interface
+  -->
+  <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager"/>
+  <!--
+      Search index and the file system it uses.
+  -->
+  <SearchIndex class="org.apache.jackrabbit.core.search.lucene.SearchIndex">
+    <param name="useCompoundFile" value="true" />
+    <param name="minMergeDocs" value="1000" />
+    <param name="maxMergeDocs" value="10000" />
+    <param name="mergeFactor" value="10" />
+    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+      <param name="path" value="${wsp.home}/index" />
+    </FileSystem>
+  </SearchIndex>
+</Workspace>



Mime
View raw message