jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r791842 - in /jackrabbit/branches/1.x: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/
Date Tue, 07 Jul 2009 14:08:49 GMT
Author: jukka
Date: Tue Jul  7 14:08:48 2009
New Revision: 791842

URL: http://svn.apache.org/viewvc?rev=791842&view=rev
Log:
1.x: Merged revision 789279 (JCR-2129)

Added:
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java
      - copied, changed from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java
      - copied, changed from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java
      - copied, changed from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationBase.java
      - copied unchanged from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationBase.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java
      - copied, changed from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMoveTest.java
      - copied unchanged from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMoveTest.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java
      - copied, changed from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java
Modified:
    jackrabbit/branches/1.x/   (props changed)
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java
    jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java

Propchange: jackrabbit/branches/1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul  7 14:08:48 2009
@@ -1 +1,2 @@
-/jackrabbit/trunk:770143-773197,773483,773525-773554,773584,773588,773828,773835-775756,775833,775836,775840,775868,775981,775986,776036,776256,776310,776313,776321-776322,776332,776356-776357,776362,776373,776650-776693,776737,776757,776776-776777,777024,777029,777034,777478,777509,777541,777548,777936,778445,778613,778616,778621,778645,778720,778802,779032,779040,779068-779071,779074,779076,779081,779084,779086-779088,779090-779092,779094-779096,779101,779223,779225,779227-779228,779230,779233-779234,779460,779475-779476,779504,779550,779552,779555,779561,779563,779583,779590,779618,779621-779622,779624,779642,779654,779657-779659,779661,779936,780006,780010,780025,780085,780989,780993,781017,781051,781054,781294-781300,781305-781311,781318,781328,781338,781344,781347,781369,781372,781377,781416-781417,781423,782621-782622,782644,782646,782652,782669,782675,782677,782683,782694,782921,782925,782930,782936,783002,783004-783005,783042-783043,783239,783278,783304,783319-78332
 1,783324,783326,783330-783333,783337-783338,783340-783341,783343,783345-783346,783356,783359,783383,783386,783412,783435,783444,783447,783523,783688,783703,783708,783710,783719,783757,783759,783786,783809,784011,784013,784039,784058,784060-784061,784090-784091,784106,784108-784109,784111,784117-784120,784124,784163,784261,784680,784691,784696,784760,784824,785981,786003,786319,786680,787183,787219,787241,787942,787952,787964,787996,788002,788012-788013,788350-788351,788443,788446,788450,789245,789257
+/incubator/jackrabbit/trunk:78926
+/jackrabbit/trunk:770143-773197,773483,773525-773554,773584,773588,773828,773835-775756,775833,775836,775840,775868,775981,775986,776036,776256,776310,776313,776321-776322,776332,776356-776357,776362,776373,776650-776693,776737,776757,776776-776777,777024,777029,777034,777478,777509,777541,777548,777936,778445,778613,778616,778621,778645,778720,778802,779032,779040,779068-779071,779074,779076,779081,779084,779086-779088,779090-779092,779094-779096,779101,779223,779225,779227-779228,779230,779233-779234,779460,779475-779476,779504,779550,779552,779555,779561,779563,779583,779590,779618,779621-779622,779624,779642,779654,779657-779659,779661,779936,780006,780010,780025,780085,780989,780993,781017,781051,781054,781294-781300,781305-781311,781318,781328,781338,781344,781347,781369,781372,781377,781416-781417,781423,782621-782622,782644,782646,782652,782669,782675,782677,782683,782694,782921,782925,782930,782936,783002,783004-783005,783042-783043,783239,783278,783304,783319-78332
 1,783324,783326,783330-783333,783337-783338,783340-783341,783343,783345-783346,783356,783359,783383,783386,783412,783435,783444,783447,783523,783688,783703,783708,783710,783719,783757,783759,783786,783809,784011,784013,784039,784058,784060-784061,784090-784091,784106,784108-784109,784111,784117-784120,784124,784163,784261,784680,784691,784696,784760,784824,785981,786003,786319,786680,787183,787219,787241,787942,787952,787964,787996,788002,788012-788013,788350-788351,788443,788446,788450,789245,789257,789270,789279,789307,789312,789324,789338,789347,789485,789986

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
Tue Jul  7 14:08:48 2009
@@ -156,6 +156,18 @@
     }
 
     /**
+     * Returns a flag indicating whether a given item state is marked as
+     * modified in this log.
+     *
+     * @param id the id of the item.
+     * @return <code>true</code> if the item state is marked as modified in this
+     *         log; <code>false</code> otherwise.
+     */
+    public boolean isModified(ItemId id) {
+        return modifiedStates.containsKey(id);
+    }
+
+    /**
      * Return a node references object given its id. Returns
      * <code>null</code> if the node reference is not in the modified
      * section.

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
Tue Jul  7 14:08:48 2009
@@ -425,9 +425,7 @@
                 cache.cache(local);
             }
         }
-        if (local != null) {
-            dispatcher.notifyStateCreated(created);
-        }
+        dispatcher.notifyStateCreated(created);
     }
 
     /**

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java
Tue Jul  7 14:08:48 2009
@@ -106,7 +106,7 @@
                         ChildNodeEntry cne =
                                 (ChildNodeEntry) iter.next();
 
-                        if (context.isAdded(cne.getId())) {
+                        if (context.isAdded(cne.getId()) || context.isModified(cne.getId()))
{
                             // a new child node entry has been added to this state;
                             // check for name collisions with other state
                             if (overlayedState.hasChildNodeEntry(cne.getName())) {
@@ -121,6 +121,8 @@
                             }
 
                             added.add(cne);
+                        } else {
+                            // externally added
                         }
                     }
 
@@ -128,9 +130,11 @@
                          iter.hasNext();) {
                         ChildNodeEntry cne =
                                 (ChildNodeEntry) iter.next();
-                        if (context.isDeleted(cne.getId())) {
+                        if (context.isDeleted(cne.getId()) || context.isModified(cne.getId()))
{
                             // a child node entry has been removed from this node state
                             removed.add(cne);
+                        } else {
+                            // externally removed
                         }
                     }
 
@@ -161,14 +165,6 @@
                         PropertyId propId =
                                 new PropertyId(state.getNodeId(), name);
                         if (context.isAdded(propId)) {
-                            // a new property name has been added to this state;
-                            // check for name collisions
-                            if (overlayedState.hasPropertyName(name)
-                                    || overlayedState.hasChildNodeEntry(name)) {
-                                // conflicting names
-                                return false;
-                            }
-
                             added.add(name);
                         }
                     }
@@ -209,6 +205,7 @@
     static interface MergeContext {
         boolean isAdded(ItemId id);
         boolean isDeleted(ItemId id);
+        boolean isModified(ItemId id);
         boolean allowsSameNameSiblings(NodeId id);
     }
 }

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
Tue Jul  7 14:08:48 2009
@@ -789,9 +789,23 @@
             // local state was created
             ItemState transientState = transientStore.get(created.getId());
             if (transientState != null) {
-                // underlying state has been permanently created
-                transientState.pull();
-                transientState.setStatus(ItemState.STATUS_EXISTING);
+                if (transientState.hasOverlayedState()) {
+                    // underlying state has been permanently created
+                    transientState.pull();
+                    transientState.setStatus(ItemState.STATUS_EXISTING);
+                } else {
+                    // this is a notification from another session
+                    try {
+                        ItemState local = stateMgr.getItemState(created.getId());
+                        transientState.connect(local);
+                        // update mod count
+                        transientState.setModCount(local.getModCount());
+                        transientState.setStatus(ItemState.STATUS_EXISTING_MODIFIED);
+                    } catch (ItemStateException e) {
+                        // something went wrong, mark as stale
+                        transientState.setStatus(ItemState.STATUS_STALE_MODIFIED);
+                    }
+                }
                 visibleState = transientState;
             }
         }
@@ -825,6 +839,12 @@
                                     return atticStore.contains(id);
                                 }
 
+                                public boolean isModified(ItemId id) {
+                                    ItemState is = transientStore.get(id);
+                                    return is != null
+                                            && is.getStatus() == ItemState.STATUS_EXISTING_MODIFIED;
+                                }
+
                                 public boolean allowsSameNameSiblings(NodeId id) {
                                     NodeState ns;
                                     try {
@@ -869,6 +889,13 @@
             if (transientState != null) {
                 transientState.setStatus(ItemState.STATUS_STALE_DESTROYED);
                 visibleState = transientState;
+            } else {
+                // check attic
+                transientState = atticStore.get(destroyed.getId());
+                if (transientState != null) {
+                    atticStore.remove(destroyed.getId());
+                    transientState.onDisposed();
+                }
             }
         }
         dispatcher.notifyStateDestroyed(visibleState);

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Tue Jul  7 14:08:48 2009
@@ -617,6 +617,10 @@
                                             return local.deleted(id);
                                         }
 
+                                        public boolean isModified(ItemId id) {
+                                            return local.isModified(id);
+                                        }
+
                                         public boolean allowsSameNameSiblings(NodeId id)
{
                                             NodeState ns;
                                             try {

Copied: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java
(from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java?p2=jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java&r1=789279&r2=791842&rev=791842&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemoveMoveTest.java
Tue Jul  7 14:08:48 2009
@@ -31,6 +31,10 @@
         testRootNode.getSession().save();
     }
 
+    private Node getNode(String path) throws Exception {
+        return (Node) session.getItem(path);
+    }
+
     public void testAddWithMoveFrom() throws Exception {
         testRootNode.getNode("A").addNode("D");
         session.move(testRoot + "/A/B", testRoot + "/C/B");
@@ -89,7 +93,7 @@
 
     public void testMoveFromWithAdd() throws Exception {
         superuser.move(testRoot + "/A/B", testRoot + "/C/B");
-        session.getNode(testRoot).getNode("A").addNode("D");
+        getNode(testRoot).getNode("A").addNode("D");
 
         superuser.save();
 
@@ -102,7 +106,7 @@
 
     public void testMoveToWithAdd() throws Exception {
         superuser.move(testRoot + "/C", testRoot + "/A/C");
-        session.getNode(testRoot).getNode("A").addNode("D");
+        getNode(testRoot).getNode("A").addNode("D");
 
         superuser.save();
 
@@ -114,7 +118,7 @@
     }
 
     public void testMoveFromWithRemove() throws Exception {
-        Node d = session.getNode(testRoot).getNode("A").addNode("D");
+        Node d = getNode(testRoot).getNode("A").addNode("D");
         session.save();
 
         superuser.move(testRoot + "/A/B", testRoot + "/C/B");
@@ -130,7 +134,7 @@
     }
 
     public void testMoveToWithRemove() throws Exception {
-        Node d = session.getNode(testRoot).getNode("A").addNode("D");
+        Node d = getNode(testRoot).getNode("A").addNode("D");
         session.save();
 
         superuser.move(testRoot + "/C", testRoot + "/A/C");
@@ -149,7 +153,7 @@
 
     public void testAddAdd() throws Exception {
         testRootNode.getNode("A").addNode("D");
-        session.getNode(testRoot).getNode("A").addNode("E");
+        getNode(testRoot).getNode("A").addNode("E");
 
         superuser.save();
 
@@ -166,7 +170,7 @@
         Node d = testRootNode.getNode("A").addNode("D");
         superuser.save();
         d.remove();
-        session.getNode(testRoot).getNode("A").getNode("B").remove();
+        getNode(testRoot).getNode("A").getNode("B").remove();
 
         superuser.save();
 

Copied: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java
(from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java?p2=jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java&r1=789279&r2=791842&rev=791842&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentAddRemovePropertyTest.java
Tue Jul  7 14:08:48 2009
@@ -25,11 +25,15 @@
  */
 public class ConcurrentAddRemovePropertyTest extends ConcurrentModificationBase {
 
+    private Node getNode(String path) throws Exception {
+        return (Node) session.getItem(path);
+    }
+
     public void testAdd() throws Exception {
         Node n = testRootNode.addNode(nodeName1);
         superuser.save();
         n.setProperty(propertyName1, "foo");
-        session.getNode(testRoot).getNode(nodeName1).setProperty(propertyName2, "bar");
+        getNode(testRoot).getNode(nodeName1).setProperty(propertyName2, "bar");
         superuser.save();
         try {
             session.save();
@@ -42,7 +46,7 @@
         Node n = testRootNode.addNode(nodeName1);
         superuser.save();
         n.setProperty(propertyName1, "foo");
-        session.getNode(testRoot).getNode(nodeName1).setProperty(propertyName1, "bar");
+        getNode(testRoot).getNode(nodeName1).setProperty(propertyName1, "bar");
         superuser.save();
         try {
             session.save();
@@ -58,7 +62,7 @@
         n.setProperty(propertyName2, "bar");
         superuser.save();
         n.getProperty(propertyName1).remove();
-        session.getNode(testRoot).getNode(nodeName1).getProperty(propertyName2).remove();
+        getNode(testRoot).getNode(nodeName1).getProperty(propertyName2).remove();
         superuser.save();
         try {
             session.save();
@@ -72,7 +76,7 @@
         n.setProperty(propertyName1, "foo");
         superuser.save();
         n.getProperty(propertyName1).remove();
-        session.getNode(testRoot).getNode(nodeName1).getProperty(propertyName1).remove();
+        getNode(testRoot).getNode(nodeName1).getProperty(propertyName1).remove();
         superuser.save();
         try {
             session.save();

Copied: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java
(from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java?p2=jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java&r1=789279&r2=791842&rev=791842&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentMixinModificationTest.java
Tue Jul  7 14:08:48 2009
@@ -25,11 +25,15 @@
  */
 public class ConcurrentMixinModificationTest extends ConcurrentModificationBase {
 
+    private Node getNode(String path) throws Exception {
+        return (Node) session.getItem(path);
+    }
+
     public void testMixin() throws Exception {
         Node n = testRootNode.addNode(nodeName1);
         superuser.save();
         n.addMixin(mixReferenceable);
-        session.getNode(testRoot).getNode(nodeName1).addMixin(mixLockable);
+        getNode(testRoot).getNode(nodeName1).addMixin(mixLockable);
         superuser.save();
         try {
             session.save();

Copied: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java
(from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java?p2=jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java&r1=789279&r2=791842&rev=791842&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentModificationWithSNSTest.java
Tue Jul  7 14:08:48 2009
@@ -33,9 +33,13 @@
         superuser.save();
     }
 
+    private Node getNode(String path) throws Exception {
+        return (Node) session.getItem(path);
+    }
+
     public void testAddAdd() throws Exception {
         testRootNode.addNode("A");
-        session.getNode(testRoot).addNode("A");
+        getNode(testRoot).addNode("A");
         superuser.save();
         try {
             session.save();
@@ -46,7 +50,7 @@
 
     public void testAddRemove() throws Exception {
         testRootNode.addNode("A");
-        session.getNode(testRoot).getNode("A[2]").remove();
+        getNode(testRoot).getNode("A[2]").remove();
         superuser.save();
         try {
             session.save();
@@ -57,7 +61,7 @@
 
     public void testRemoveAdd() throws Exception {
         testRootNode.getNode("A[2]").remove();
-        session.getNode(testRoot).addNode("A");
+        getNode(testRoot).addNode("A");
         superuser.save();
         try {
             session.save();
@@ -68,7 +72,7 @@
 
     public void testRemoveRemove() throws Exception {
         testRootNode.getNode("A[1]").remove();
-        session.getNode(testRoot).getNode("A[3]").remove();
+        getNode(testRoot).getNode("A[3]").remove();
         superuser.save();
         try {
             session.save();
@@ -82,7 +86,7 @@
         Node f = testRootNode.addNode("folder", "nt:folder");
         superuser.save();
         f.addNode("A", "nt:folder");
-        session.getNode(f.getPath()).addNode("A", "nt:folder");
+        getNode(f.getPath()).addNode("A", "nt:folder");
         superuser.save();
         try {
             session.save();

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java
Tue Jul  7 14:08:48 2009
@@ -120,7 +120,17 @@
                     state = "adding property to subnode " + i;
                     n1.setProperty("testprop", "xxx");
                     if (i % 10 == 0) {
-                        state = "saving pending subnodes";
+                        state = "saving pending (added) subnodes";
+                        session.save();
+                    }
+                    randomSleep();
+                }
+
+                for (int i = 0; i < NUM_NODES; i++) {
+                    state = "removing subnode " + i;
+                    n.getNode("x" + identity + i).remove();
+                    if (i % 10 == 0) {
+                        state = "saving pending (removed) subnodes";
                         session.save();
                     }
                     randomSleep();

Copied: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java
(from r789279, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java?p2=jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java&r1=789279&r2=791842&rev=791842&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentReorderTest.java
Tue Jul  7 14:08:48 2009
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core;
 
 import javax.jcr.InvalidItemStateException;
+import javax.jcr.Node;
 
 /**
  * <code>ConcurrentReorderTest</code> checks if a reorder interleaved with
@@ -32,9 +33,13 @@
         superuser.save();
     }
 
+    private Node getNode(String path) throws Exception {
+        return (Node) session.getItem(path);
+    }
+
     public void testReorderWithAdd() throws Exception {
         testRootNode.orderBefore("C", "A");
-        session.getNode(testRoot).addNode("D");
+        getNode(testRoot).addNode("D");
         session.save();
         try {
             superuser.save();
@@ -46,7 +51,7 @@
 
     public void testAddWithReorder() throws Exception {
         testRootNode.addNode("D");
-        session.getNode(testRoot).orderBefore("C", "A");
+        getNode(testRoot).orderBefore("C", "A");
         session.save();
         try {
             superuser.save();

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java?rev=791842&r1=791841&r2=791842&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
Tue Jul  7 14:08:48 2009
@@ -43,6 +43,14 @@
         suite.addTestSuite(SessionGarbageCollectedTest.class);
         suite.addTestSuite(ReferencesTest.class);
 
+        // test related to NodeStateMerger
+        suite.addTestSuite(ConcurrentAddRemoveMoveTest.class);
+        suite.addTestSuite(ConcurrentAddRemovePropertyTest.class);
+        suite.addTestSuite(ConcurrentMixinModificationTest.class);
+        suite.addTestSuite(ConcurrentModificationWithSNSTest.class);
+        suite.addTestSuite(ConcurrentMoveTest.class);
+        suite.addTestSuite(ConcurrentReorderTest.class);
+
         return suite;
     }
 }



Mime
View raw message