You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/03/18 09:46:47 UTC

[1/2] git commit: CAMEL-7285: Upgrade camel-jcr to Jackrabbit 2.6.5

Repository: camel
Updated Branches:
  refs/heads/master 856997e92 -> 46e67a149


CAMEL-7285: Upgrade camel-jcr to Jackrabbit 2.6.5

Rewrite JUnit tests to support change of default SecurityManager and
AccessManager in Jackrabbit 2.6.

Signed-off-by: Gregor Zurowski <gr...@zurowski.org>

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b436c0f7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b436c0f7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b436c0f7

Branch: refs/heads/master
Commit: b436c0f7ed650d2d8ba1ea7fa7fcb39dea2e3f00
Parents: 6bbc94f
Author: Gregor Zurowski <gr...@zurowski.org>
Authored: Sun Mar 16 17:46:55 2014 -0400
Committer: Gregor Zurowski <gr...@zurowski.org>
Committed: Sun Mar 16 17:46:55 2014 -0400

----------------------------------------------------------------------
 .../camel/component/jcr/JcrAuthTestBase.java    |  15 +-
 .../component/jcr/JcrNodePathCreationTest.java  |   8 +-
 .../component/jcr/JcrRouteTestSupport.java      |  17 ++-
 .../resources/repository-simple-security.xml    | 152 +++++++++++++++++++
 .../src/test/resources/repository_with_auth.xml | 121 ---------------
 parent/pom.xml                                  |   2 +-
 6 files changed, 178 insertions(+), 137 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b436c0f7/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
----------------------------------------------------------------------
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
index 42c721a..39a9ffb 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrAuthTestBase.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.jcr;
 
 import java.io.File;
+
 import javax.jcr.Repository;
 import javax.jcr.SimpleCredentials;
 import javax.jcr.security.AccessControlList;
@@ -29,7 +30,6 @@ import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.TransientRepository;
-
 import org.junit.Before;
 
 /**
@@ -40,27 +40,22 @@ public abstract class JcrAuthTestBase extends CamelTestSupport {
 
     protected static final String BASE_REPO_PATH = "/home/test";
 
-    private static final String CONFIG_FILE = "target/test-classes/repository_with_auth.xml";
+    protected static final String REPO_PATH = "target/repository";
 
     private Repository repository;
 
     @Override
     @Before
     public void setUp() throws Exception {
-        deleteDirectory("target/repository_with_auth");
+        deleteDirectory(REPO_PATH);
         super.setUp();
     }
 
     @Override
     protected Context createJndiContext() throws Exception {
         Context context = super.createJndiContext();
-
-        File config = new File(CONFIG_FILE);
-        if (!config.exists()) {
-            throw new Exception("missing config file: " + config.getPath());
-        }
-        repository = new TransientRepository(CONFIG_FILE,
-                "target/repository_with_auth");
+        
+        repository = new TransientRepository(new File(REPO_PATH));
 
         // set up a user to authenticate
         SessionImpl session = (SessionImpl) repository

http://git-wip-us.apache.org/repos/asf/camel/blob/b436c0f7/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
index 4c004b2..12df8f9 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrNodePathCreationTest.java
@@ -31,12 +31,16 @@ import org.junit.Test;
 
 public class JcrNodePathCreationTest extends CamelTestSupport {
 
+    protected static final String CONFIG_FILE = "target/test-classes/repository-simple-security.xml";
+
+    protected static final String REPO_PATH = "target/repository-simple-security";
+
     private Repository repository;
 
     @Override
     @Before
     public void setUp() throws Exception {
-        deleteDirectory("target/repository");
+        deleteDirectory(REPO_PATH);
         super.setUp();
     }
 
@@ -75,7 +79,7 @@ public class JcrNodePathCreationTest extends CamelTestSupport {
     @Override
     protected Context createJndiContext() throws Exception {
         Context context = super.createJndiContext();
-        repository = new TransientRepository("target/repository.xml", "target/repository");
+        repository = new TransientRepository(CONFIG_FILE, REPO_PATH);
         context.bind("repository", repository);
         return context;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/b436c0f7/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
index be22df0..101eba4 100644
--- a/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
+++ b/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTestSupport.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.jcr;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -33,13 +36,16 @@ import org.junit.Before;
  */
 public abstract class JcrRouteTestSupport extends CamelTestSupport {
 
+    protected static final String CONFIG_FILE = "target/test-classes/repository-simple-security.xml";
+
+    protected static final String REPO_PATH = "target/repository-simple-security";
+
     private Repository repository;
 
     @Override
     @Before
     public void setUp() throws Exception {
-        deleteDirectory("target/repository_with_auth");
-        deleteDirectory("target/repository");
+        deleteDirectory(REPO_PATH);
         super.setUp();
     }
 
@@ -53,8 +59,13 @@ public abstract class JcrRouteTestSupport extends CamelTestSupport {
 
     @Override
     protected Context createJndiContext() throws Exception {
+        File config = new File(CONFIG_FILE);
+        if (!config.exists()) {
+            throw new FileNotFoundException("Missing config file: " + config.getPath());
+        }
+        
         Context context = super.createJndiContext();
-        repository = new TransientRepository("target/repository.xml", "target/repository");
+        repository = new TransientRepository(CONFIG_FILE, REPO_PATH);
         context.bind("repository", repository);
         return context;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/b436c0f7/components/camel-jcr/src/test/resources/repository-simple-security.xml
----------------------------------------------------------------------
diff --git a/components/camel-jcr/src/test/resources/repository-simple-security.xml b/components/camel-jcr/src/test/resources/repository-simple-security.xml
new file mode 100644
index 0000000..831e3c9
--- /dev/null
+++ b/components/camel-jcr/src/test/resources/repository-simple-security.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+<!--
+   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.
+-->
+
+<!DOCTYPE Repository
+          PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
+          "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
+
+<!-- Example Repository Configuration File
+     Used by
+     - org.apache.jackrabbit.core.config.RepositoryConfigTest.java
+     -
+-->
+<Repository>
+    <!--
+        virtual file system where the repository stores global state
+        (e.g. registered namespaces, custom node types, etc.)
+    -->
+    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+        <param name="path" value="${rep.home}/repository"/>
+    </FileSystem>
+
+    <!--
+        data store configuration
+    -->
+    <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
+
+    <!--
+        security configuration
+    -->
+    <Security appName="Jackrabbit">
+        <!--
+            security manager:
+            class: FQN of class implementing the JackrabbitSecurityManager interface
+        -->
+        <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security">
+            <!--
+            workspace access:
+            class: FQN of class implementing the WorkspaceAccessManager interface
+            -->
+            <!-- <WorkspaceAccessManager class="..."/> -->
+            <!-- <param name="config" value="${rep.home}/security.xml"/> -->
+        </SecurityManager>
+
+        <!--
+            access manager:
+            class: FQN of class implementing the AccessManager interface
+        -->
+        <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
+            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+        </AccessManager>
+
+        <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
+           <!-- 
+              anonymous user name ('anonymous' is the default value)
+            -->
+           <param name="anonymousId" value="anonymous"/>
+           <!--
+              administrator user id (default value if param is missing is 'admin')
+            -->
+           <param name="adminId" value="admin"/>
+        </LoginModule>
+    </Security>
+
+    <!--
+        location of workspaces root directory and name of default workspace
+    -->
+    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+    <!--
+        workspace configuration template:
+        used to create the initial workspace if there's no workspace yet
+    -->
+    <Workspace name="${wsp.name}">
+        <!--
+            virtual file system of the workspace:
+            class: FQN of class implementing the FileSystem interface
+        -->
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${wsp.home}"/>
+        </FileSystem>
+        <!--
+            persistence manager of the workspace:
+            class: FQN of class implementing the PersistenceManager interface
+        -->
+        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+          <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+        </PersistenceManager>
+        <!--
+            Search index and the file system it uses.
+            class: FQN of class implementing the QueryHandler interface
+        -->
+        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+            <param name="path" value="${wsp.home}/index"/>
+            <param name="supportHighlighting" value="true"/>
+        </SearchIndex>
+    </Workspace>
+
+    <!--
+        Configures the versioning
+    -->
+    <Versioning rootPath="${rep.home}/version">
+        <!--
+            Configures the filesystem to use for versioning for the respective
+            persistence manager
+        -->
+        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+            <param name="path" value="${rep.home}/version" />
+        </FileSystem>
+
+        <!--
+            Configures the persistence manager to be used for persisting version state.
+            Please note that the current versioning implementation is based on
+            a 'normal' persistence manager, but this could change in future
+            implementations.
+        -->
+        <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
+          <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+          <param name="schemaObjectPrefix" value="version_"/>
+        </PersistenceManager>
+    </Versioning>
+
+    <!--
+        Search index for content that is shared repository wide
+        (/jcr:system tree, contains mainly versions)
+    -->
+    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+        <param name="path" value="${rep.home}/repository/index"/>
+        <param name="supportHighlighting" value="true"/>
+    </SearchIndex>
+
+    <!--
+        Run with a cluster journal
+    -->
+    <Cluster id="node1">
+        <Journal class="org.apache.jackrabbit.core.journal.MemoryJournal"/>
+    </Cluster>
+</Repository>

http://git-wip-us.apache.org/repos/asf/camel/blob/b436c0f7/components/camel-jcr/src/test/resources/repository_with_auth.xml
----------------------------------------------------------------------
diff --git a/components/camel-jcr/src/test/resources/repository_with_auth.xml b/components/camel-jcr/src/test/resources/repository_with_auth.xml
deleted file mode 100644
index a54a7db..0000000
--- a/components/camel-jcr/src/test/resources/repository_with_auth.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0"?>
-<!--
-   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.
--->
-
-<!DOCTYPE Repository
-  PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
-  "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
-
-<!-- Example Repository Configuration File
-     Used by
-     - org.apache.jackrabbit.core.config.RepositoryConfigTest.java
-     -
--->
-<Repository>
-  <!--
-      virtual file system where the repository stores global state
-      (e.g. registered namespaces, custom node types, etc.)
-  -->
-  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-    <param name="path" value="${rep.home}/repository"/>
-  </FileSystem>
-
-  <!--
-      data store configuration
-  -->
-  <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
-
-  <!--
-      security configuration
-  -->
-  <Security appName="Jackrabbit">
-
-    <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security"/>
-    <AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager"/>
-    <LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
-      <param name="adminId" value="admin"/>
-    </LoginModule>
-
-  </Security>
-
-  <!--
-      location of workspaces root directory and name of default workspace
-  -->
-  <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
-  <!--
-      workspace configuration template:
-      used to create the initial workspace if there's no workspace yet
-  -->
-  <Workspace name="${wsp.name}">
-    <!--
-        virtual file system of the workspace:
-        class: FQN of class implementing the FileSystem interface
-    -->
-    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-      <param name="path" value="${wsp.home}"/>
-    </FileSystem>
-    <!--
-        persistence manager of the workspace:
-        class: FQN of class implementing the PersistenceManager interface
-    -->
-    <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
-      <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
-      <param name="schemaObjectPrefix" value="${wsp.name}_"/>
-    </PersistenceManager>
-    <!--
-        Search index and the file system it uses.
-        class: FQN of class implementing the QueryHandler interface
-    -->
-    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
-      <param name="path" value="${wsp.home}/index"/>
-      <param name="supportHighlighting" value="true"/>
-    </SearchIndex>
-  </Workspace>
-
-  <!--
-      Configures the versioning
-  -->
-  <Versioning rootPath="${rep.home}/version">
-    <!--
-        Configures the filesystem to use for versioning for the respective
-        persistence manager
-    -->
-    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-      <param name="path" value="${rep.home}/version"/>
-    </FileSystem>
-
-    <!--
-        Configures the persistence manager to be used for persisting version state.
-        Please note that the current versioning implementation is based on
-        a 'normal' persistence manager, but this could change in future
-        implementations.
-    -->
-    <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
-      <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
-      <param name="schemaObjectPrefix" value="version_"/>
-    </PersistenceManager>
-  </Versioning>
-
-  <!--
-      Search index for content that is shared repository wide
-      (/jcr:system tree, contains mainly versions)
-  -->
-  <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
-    <param name="path" value="${rep.home}/repository/index"/>
-    <param name="supportHighlighting" value="true"/>
-  </SearchIndex>
-</Repository>

http://git-wip-us.apache.org/repos/asf/camel/blob/b436c0f7/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index e17487e..fca2be2 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -193,7 +193,7 @@
     <jini-version>2.1</jini-version>
     <jackson-version>1.9.12</jackson-version>
     <jackson2-version>2.3.2</jackson2-version>
-    <jackrabbit-version>2.2.12</jackrabbit-version>
+    <jackrabbit-version>2.6.5</jackrabbit-version>
     <jain-sip-ri-bundle-version>1.2.154_2</jain-sip-ri-bundle-version>
     <jasper-bundle-version>6.0.36_1</jasper-bundle-version>
     <jasypt-bundle-version>1.9.1_1</jasypt-bundle-version>


[2/2] git commit: Merge branch 'Jackrabbit265' of https://github.com/gzurowski/camel

Posted by da...@apache.org.
Merge branch 'Jackrabbit265' of https://github.com/gzurowski/camel


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/46e67a14
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/46e67a14
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/46e67a14

Branch: refs/heads/master
Commit: 46e67a149469d050ce1d8eac03a4173389d27df5
Parents: 856997e b436c0f
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Mar 18 09:43:27 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Mar 18 09:43:27 2014 +0100

----------------------------------------------------------------------
 .../camel/component/jcr/JcrAuthTestBase.java    |  15 +-
 .../component/jcr/JcrNodePathCreationTest.java  |   8 +-
 .../component/jcr/JcrRouteTestSupport.java      |  17 ++-
 .../resources/repository-simple-security.xml    | 152 +++++++++++++++++++
 .../src/test/resources/repository_with_auth.xml | 121 ---------------
 parent/pom.xml                                  |   2 +-
 6 files changed, 178 insertions(+), 137 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/46e67a14/parent/pom.xml
----------------------------------------------------------------------