jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1042650 - in /jackrabbit/branches/2.2: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/ jackrabbit-core/src/test/java/org/apache/jac...
Date Mon, 06 Dec 2010 14:08:35 GMT
Author: jukka
Date: Mon Dec  6 14:08:34 2010
New Revision: 1042650

URL: http://svn.apache.org/viewvc?rev=1042650&view=rev
Log:
2.2: Merged trunk revisions.

Modified:
    jackrabbit/branches/2.2/   (props changed)
    jackrabbit/branches/2.2/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/QueryBuilder.java
    jackrabbit/branches/2.2/jackrabbit-core/pom.xml
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java

Propchange: jackrabbit/branches/2.2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec  6 14:08:34 2010
@@ -2,4 +2,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041761
+/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643

Modified: jackrabbit/branches/2.2/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/QueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/QueryBuilder.java?rev=1042650&r1=1042649&r2=1042650&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/QueryBuilder.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/QueryBuilder.java
Mon Dec  6 14:08:34 2010
@@ -94,7 +94,7 @@ public interface QueryBuilder<T> {
      * Set limits for the query. The limits consists of an offset and a maximal
      * number of results. <code>offset</code> refers to the offset within the
full
      * result set at which the returned result set should start expressed in terms 
-     * of the number of {@link Authorizable}s to skip. <code>limit</code> sets
the
+     * of the number of {@link Authorizable}s to skip. <code>maxCount</code>
sets the
      * maximum size of the result set expressed in terms of the number of authorizables
      * to return.
      *

Modified: jackrabbit/branches/2.2/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/pom.xml?rev=1042650&r1=1042649&r2=1042650&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/pom.xml (original)
+++ jackrabbit/branches/2.2/jackrabbit-core/pom.xml Mon Dec  6 14:08:34 2010
@@ -33,6 +33,10 @@
   <name>Jackrabbit Core</name>
   <description>Jackrabbit content repository implementation</description>
 
+  <properties>
+    <org.apache.jackrabbit.test.integration>false</org.apache.jackrabbit.test.integration>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
@@ -106,6 +110,10 @@ org.apache.jackrabbit.test.api.Shareable
 org.apache.jackrabbit.test.api.ShareableNodeTest#testGetNodesByPattern
               </value>
             </property>
+            <property>
+              <name>org.apache.jackrabbit.test.integration</name>
+              <value>${org.apache.jackrabbit.test.integration}</value>
+            </property>
           </systemProperties>
         </configuration>
         <executions>
@@ -287,16 +295,22 @@ org.apache.jackrabbit.test.api.Shareable
     </dependency>
   </dependencies>
 
-  <!--
-    These profiles can be used to run the (integration) tests against different DB backends.
-    For instance, if you want to run the integration tests against MySQL backend, do:
-    
-      mvn clean integration-test -Pmysql,use-descriptor-overlay
-    
-    Note: the ${config.db.name} database is dropped and re-created in the clean phase. 
-  -->
   <profiles>
     <profile>
+      <id>integrationTesting</id>
+      <properties>
+        <org.apache.jackrabbit.test.integration>true</org.apache.jackrabbit.test.integration>
+      </properties>
+    </profile>
+    <!--
+      These profiles can be used to run the (integration) tests against different DB backends.
+      For instance, if you want to run the integration tests against MySQL backend, do:
+
+        mvn clean integration-test -Pmysql,use-descriptor-overlay
+
+      Note: the ${config.db.name} database is dropped and re-created in the clean phase.

+    -->
+    <profile>
       <id>mysql</id>
       <properties>
         <config.db.name>jackrabbit</config.db.name>

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java?rev=1042650&r1=1042649&r2=1042650&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Mon Dec  6 14:08:34 2010
@@ -16,6 +16,10 @@
  */
 package org.apache.jackrabbit.core.version;
 
+import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_ACTIVITY;
+import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_VERSIONHISTORY;
+import static org.apache.jackrabbit.spi.commons.name.NameConstants.MIX_VERSIONABLE;
+
 import java.util.Calendar;
 
 import javax.jcr.ItemNotFoundException;
@@ -554,6 +558,45 @@ abstract class InternalVersionManagerBas
     }
 
     /**
+     * Creates a new version of the given node using the given version
+     * creation time.
+     *
+     * @param node the node to be checked in
+     * @param created version creation time
+     * @return the new version
+     * @throws RepositoryException if an error occurs
+     */
+    protected InternalVersion checkin(NodeStateEx node, Calendar created)
+            throws RepositoryException {
+        WriteOperation operation = startWriteOperation();
+        try {
+            boolean simple =
+                !node.getEffectiveNodeType().includesNodeType(MIX_VERSIONABLE);
+            InternalVersionHistoryImpl vh;
+            if (simple) {
+                // in simple versioning the history id needs to be calculated
+                vh = (InternalVersionHistoryImpl) getVersionHistoryOfNode(
+                        node.getNodeId());
+            } else {
+                // in full versioning, the history id can be retrieved via
+                // the property
+                vh = (InternalVersionHistoryImpl) getVersionHistory(
+                        node.getPropertyValue(JCR_VERSIONHISTORY).getNodeId());
+            }
+
+            InternalVersion version =
+                internalCheckin(vh, node, simple, created);
+
+            operation.save();
+            return version;
+        } catch (ItemStateException e) {
+            throw new RepositoryException(e);
+        } finally {
+            operation.close();
+        }
+    }
+
+    /**
      * Checks in a node
      *
      * @param history the version history
@@ -568,26 +611,19 @@ abstract class InternalVersionManagerBas
             InternalVersionHistoryImpl history,
             NodeStateEx node, boolean simple, Calendar created)
             throws RepositoryException {
-        WriteOperation operation = startWriteOperation();
-        try {
-            String versionName = calculateCheckinVersionName(history, node, simple);
-            InternalVersionImpl v = history.checkin(
-                    NameFactoryImpl.getInstance().create("", versionName),
-                    node, created);
-
-            // check for jcr:activity
-            if (node.hasProperty(NameConstants.JCR_ACTIVITY)) {
-                NodeId actId = node.getPropertyValue(NameConstants.JCR_ACTIVITY).getNodeId();
-                InternalActivityImpl act = (InternalActivityImpl) getItem(actId);
-                act.addVersion(v);
-            }
-            operation.save();
-            return v;
-        } catch (ItemStateException e) {
-            throw new RepositoryException(e);
-        } finally {
-            operation.close();
+        String versionName = calculateCheckinVersionName(history, node, simple);
+        InternalVersionImpl v = history.checkin(
+                NameFactoryImpl.getInstance().create("", versionName),
+                node, created);
+
+        // check for jcr:activity
+        if (node.hasProperty(JCR_ACTIVITY)) {
+            NodeId actId = node.getPropertyValue(JCR_ACTIVITY).getNodeId();
+            InternalActivityImpl act = (InternalActivityImpl) getItem(actId);
+            act.addVersion(v);
         }
+
+        return v;
     }
 
     /**

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java?rev=1042650&r1=1042649&r2=1042650&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
Mon Dec  6 14:08:34 2010
@@ -401,26 +401,15 @@ public class InternalVersionManagerImpl 
      * item-reading listeners in the observation thread.
      */
     public InternalVersion checkin(
-            final Session session,
-            final NodeStateEx node, final Calendar created)
+            Session session, final NodeStateEx node, final Calendar created)
             throws RepositoryException {
-        return (InternalVersion)
-                escFactory.doSourced((SessionImpl) session, new SourcedTarget() {
-            public Object run() throws RepositoryException {
-                InternalVersionHistoryImpl vh;
-                if (node.getEffectiveNodeType().includesNodeType(NameConstants.MIX_VERSIONABLE))
{
-                    // in full versioning, the history id can be retrieved via
-                    // the property
-                    NodeId histId = node.getPropertyValue(NameConstants.JCR_VERSIONHISTORY).getNodeId();
-                    vh = (InternalVersionHistoryImpl) getVersionHistory(histId);
-                    return internalCheckin(vh, node, false, created);
-                } else {
-                    // in simple versioning the history id needs to be calculated
-                    vh = (InternalVersionHistoryImpl) getVersionHistoryOfNode(node.getNodeId());
-                    return internalCheckin(vh, node, true, created);
-                }
-            }
-        });
+        return (InternalVersion) escFactory.doSourced(
+                (SessionImpl) session,
+                new SourcedTarget() {
+                    public Object run() throws RepositoryException {
+                        return checkin(node, created);
+                    }
+                });
     }
 
     /**

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java?rev=1042650&r1=1042649&r2=1042650&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
Mon Dec  6 14:08:34 2010
@@ -233,20 +233,7 @@ public class InternalXAVersionManager ex
             Session session, NodeStateEx node, Calendar created)
             throws RepositoryException {
         if (isInXA()) {
-            InternalVersionHistoryImpl vh;
-            InternalVersion version;
-            if (node.getEffectiveNodeType().includesNodeType(NameConstants.MIX_VERSIONABLE))
{
-                // in full versioning, the history id can be retrieved via
-                // the property
-                NodeId histId = node.getPropertyValue(NameConstants.JCR_VERSIONHISTORY).getNodeId();
-                vh = (InternalVersionHistoryImpl) getVersionHistory(histId);
-                version = internalCheckin(vh, node, false, created);
-            } else {
-                // in simple versioning the history id needs to be calculated
-                vh = (InternalVersionHistoryImpl) getVersionHistoryOfNode(node.getNodeId());
-                version = internalCheckin(vh, node, true, created);
-            }
-            return version;
+            return checkin(node, created);
         } else {
             return vMgr.checkin(session, node, created);
         }
@@ -480,6 +467,7 @@ public class InternalXAVersionManager ex
      * <p/>
      * Before modifying version history given, make a local copy of it.
      */
+    @Override
     protected InternalVersion internalCheckin(
             InternalVersionHistoryImpl history,
             NodeStateEx node, boolean simple, Calendar created)

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java?rev=1042650&r1=1042649&r2=1042650&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
Mon Dec  6 14:08:34 2010
@@ -58,6 +58,20 @@ public class TestAll extends TestCase {
         suite.addTestSuite(ConcurrentReorderTest.class);
         suite.addTestSuite(ConcurrentAddRemoveNodeTest.class);
 
+        if (Boolean.getBoolean("org.apache.jackrabbit.test.integration")) {
+            suite.addTestSuite(ConcurrencyTest.class);
+            // suite.addTestSuite(ConcurrencyTest3.class);
+            suite.addTestSuite(ConcurrentVersioningTest.class);
+            // suite.addTestSuite(ConcurrentVersioningWithTransactionsTest.class);
+            suite.addTestSuite(ConcurrentCheckinMixedTransactionTest.class);
+            suite.addTestSuite(ConcurrentLoginTest.class);
+            suite.addTestSuite(ConcurrentNodeModificationTest.class);
+            suite.addTestSuite(ConcurrentReadWriteTest.class);
+            suite.addTestSuite(ConcurrentRenameTest.class);
+            suite.addTestSuite(ConcurrentSaveTest.class);
+            suite.addTestSuite(ConcurrentWorkspaceCopyTest.class);
+        }
+
         suite.addTestSuite(UserPerWorkspaceSecurityManagerTest.class);
 
         suite.addTestSuite(PersistenceManagerTest.class);



Mime
View raw message