You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by md...@apache.org on 2011/09/09 17:07:43 UTC

svn commit: r1167239 [2/2] - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src: main/java/org/apache/jackrabbit/jcr2spi/ main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ main/java/org/apache/jackrabbit/jcr2spi/lock/ main/java/org/apache/jac...

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java?rev=1167239&r1=1167238&r2=1167239&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AddPropertyTest.java Fri Sep  9 15:07:42 2011
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.jcr2spi.state.Status0;
+import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
@@ -48,11 +48,11 @@ public class AddPropertyTest extends Abs
         super.tearDown();
     }
 
-    private static void assertItemStatus(Item item, Status0 status) throws NotExecutableException {
+    private static void assertItemStatus(Item item, Status status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        Status st = ((ItemImpl) item).getItemState().getStatus();
         assertEquals("Expected status to be " + status + ", was " + st, status, st);
     }
 
@@ -70,9 +70,9 @@ public class AddPropertyTest extends Abs
         assertTrue(testNode.hasProperty(propertyName1));
         assertEquals("value3", testNode.getProperty(propertyName1).getString());
 
-        assertItemStatus(p1, Status0.REMOVED);
-        assertItemStatus(p2, Status0.REMOVED);
-        assertItemStatus(p3, Status0.EXISTING);
+        assertItemStatus(p1, Status.REMOVED);
+        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(p3, Status.EXISTING);
     }
 
     public void testReplacingProperty2() throws RepositoryException,
@@ -89,9 +89,9 @@ public class AddPropertyTest extends Abs
 
         assertFalse(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status0.REMOVED);
-        assertItemStatus(p2, Status0.REMOVED);
-        assertItemStatus(p3, Status0.REMOVED);
+        assertItemStatus(p1, Status.REMOVED);
+        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(p3, Status.REMOVED);
     }
 
     public void testRevertReplacingProperty() throws RepositoryException,
@@ -109,9 +109,9 @@ public class AddPropertyTest extends Abs
         assertTrue(testNode.hasProperty(propertyName1));
         assertEquals(val, p1.getString());
 
-        assertItemStatus(p1, Status0.EXISTING);
-        assertItemStatus(p2, Status0.REMOVED);
-        assertItemStatus(p3, Status0.REMOVED);
+        assertItemStatus(p1, Status.EXISTING);
+        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(p3, Status.REMOVED);
     }
 
     public void testAddingProperty() throws RepositoryException,
@@ -127,9 +127,9 @@ public class AddPropertyTest extends Abs
 
         assertTrue(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status0.REMOVED);
-        assertItemStatus(p2, Status0.REMOVED);
-        assertItemStatus(p3, Status0.EXISTING);
+        assertItemStatus(p1, Status.REMOVED);
+        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(p3, Status.EXISTING);
     }
 
     public void testAddingProperty2() throws RepositoryException,
@@ -146,9 +146,9 @@ public class AddPropertyTest extends Abs
 
         assertFalse(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status0.REMOVED);
-        assertItemStatus(p2, Status0.REMOVED);
-        assertItemStatus(p3, Status0.REMOVED);
+        assertItemStatus(p1, Status.REMOVED);
+        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(p3, Status.REMOVED);
     }
 
     public void testRevertAddingProperty() throws RepositoryException,
@@ -164,8 +164,8 @@ public class AddPropertyTest extends Abs
 
         assertFalse(testNode.hasProperty(propertyName2));
 
-        assertItemStatus(p1, Status0.REMOVED);
-        assertItemStatus(p2, Status0.REMOVED);
-        assertItemStatus(p3, Status0.REMOVED);
+        assertItemStatus(p1, Status.REMOVED);
+        assertItemStatus(p2, Status.REMOVED);
+        assertItemStatus(p3, Status.REMOVED);
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java?rev=1167239&r1=1167238&r2=1167239&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ExternalModificationTest.java Fri Sep  9 15:07:42 2011
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.jcr2spi.state.Status0;
+import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
@@ -62,19 +62,19 @@ public class ExternalModificationTest ex
         super.tearDown();
     }
 
-    private static boolean isItemStatus(Item item, Status0 status) throws NotExecutableException {
+    private static boolean isItemStatus(Item item, Status status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        Status st = ((ItemImpl) item).getItemState().getStatus();
         return st == status;
     }
 
-    private static void assertItemStatus(Item item, Status0 status) throws NotExecutableException {
+    private static void assertItemStatus(Item item, Status status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        Status st = ((ItemImpl) item).getItemState().getStatus();
         assertEquals("Expected status to be " + status + ", was " + st, status, st);
     }
 
@@ -108,16 +108,16 @@ public class ExternalModificationTest ex
             Node parent = refNode2.getParent();
             if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                 // node has been automatically moved to new place
-                assertItemStatus(refNode2, Status0.EXISTING);
+                assertItemStatus(refNode2, Status.EXISTING);
             } else {
-                assertItemStatus(refNode2, Status0.REMOVED);
+                assertItemStatus(refNode2, Status.REMOVED);
             }
         } catch (InvalidItemStateException e) {
             // no automatic move of the externally moved node. ok.
             log.debug(e.getMessage());
             // since node had no pending changes -> status should be changed
             // to REMOVED.
-            assertItemStatus(refNode2, Status0.REMOVED);
+            assertItemStatus(refNode2, Status.REMOVED);
         }
     }
 
@@ -133,18 +133,18 @@ public class ExternalModificationTest ex
             Node parent = refNode2.getParent();
             if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                 // node has been automatically moved to new place
-                assertItemStatus(refNode2, Status0.EXISTING_MODIFIED);
-            } else if (!isItemStatus(refNode2, Status0.EXISTING_MODIFIED)) {
+                assertItemStatus(refNode2, Status.EXISTING_MODIFIED);
+            } else if (!isItemStatus(refNode2, Status.EXISTING_MODIFIED)) {
                 // external removal was detected either by observation or be
                 // batch-reading the parent -> status must be stale.
-                assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+                assertItemStatus(refNode2, Status.STALE_DESTROYED);
             }
         } catch (InvalidItemStateException e) {
             // no automatic move of the externally moved node. ok.
             log.debug(e.getMessage());
             // since refNode2 has pending modifications its status should be
             // changed to STALE_DESTROYED.
-            assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+            assertItemStatus(refNode2, Status.STALE_DESTROYED);
             Node refAgain = testSession.getNodeByUUID(refNode.getUUID());
             assertTrue(refAgain.getParent().isSame(testSession.getItem(destParentNode.getPath())));
             assertFalse(refAgain.isNodeType(mixLockable));
@@ -160,7 +160,7 @@ public class ExternalModificationTest ex
 
         testSession.getItem(destParentNode.getPath() + "/" + nodeName2);
 
-        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status.STALE_DESTROYED);
         try {
             refNode2.refresh(false);
             fail();
@@ -178,9 +178,9 @@ public class ExternalModificationTest ex
 
         testSession.getItem(destParentNode.getPath() + "/" + nodeName2);
 
-        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status.STALE_DESTROYED);
         testSession.refresh(false);
-        assertItemStatus(refNode2, Status0.REMOVED);
+        assertItemStatus(refNode2, Status.REMOVED);
     }
 
     public void testStaleDestroyed3() throws RepositoryException, NotExecutableException {
@@ -198,7 +198,7 @@ public class ExternalModificationTest ex
 
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status.STALE_DESTROYED);
         // the uuid must be transferred to the 'moved' node
         Node n = testSession.getNodeByUUID(uuid);
         assertTrue(n.isSame(testSession.getItem(destPath)));
@@ -221,7 +221,7 @@ public class ExternalModificationTest ex
         } catch (InvalidItemStateException e) {
         }
 
-        assertItemStatus(refNode2, Status0.REMOVED);
+        assertItemStatus(refNode2, Status.REMOVED);
         // the uuid must be transferred to the 'moved' node
         Node n = testSession.getNodeByUUID(uuid);
         assertTrue(n.isSame(testSession.getItem(destPath)));
@@ -250,9 +250,9 @@ public class ExternalModificationTest ex
         } catch (InvalidItemStateException e) {
         }
 
-        assertItemStatus(refNode2, Status0.REMOVED);
-        assertItemStatus(c2, Status0.STALE_DESTROYED);
-        assertItemStatus(p2, Status0.REMOVED);
+        assertItemStatus(refNode2, Status.REMOVED);
+        assertItemStatus(c2, Status.STALE_DESTROYED);
+        assertItemStatus(p2, Status.REMOVED);
     }
 
     public void testExternalRemoval3() throws RepositoryException, NotExecutableException {
@@ -278,9 +278,9 @@ public class ExternalModificationTest ex
         } catch (InvalidItemStateException e) {
         }
 
-        assertItemStatus(refNode2, Status0.REMOVED);
-        assertItemStatus(c2, Status0.REMOVED);
-        assertItemStatus(p2, Status0.STALE_DESTROYED);
+        assertItemStatus(refNode2, Status.REMOVED);
+        assertItemStatus(c2, Status.REMOVED);
+        assertItemStatus(p2, Status.STALE_DESTROYED);
         assertEquals("changedValue", p2.getString());
     }
 
@@ -302,11 +302,11 @@ public class ExternalModificationTest ex
         testSession.refresh(true);
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
-        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status0.STALE_DESTROYED);
-        assertItemStatus(childN, Status0.NEW);
-        assertItemStatus(childP, Status0.NEW);
-        assertItemStatus(childN.getProperty(jcrPrimaryType), Status0.NEW);
+        assertItemStatus(refNode2, Status.STALE_DESTROYED);
+        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status.STALE_DESTROYED);
+        assertItemStatus(childN, Status.NEW);
+        assertItemStatus(childP, Status.NEW);
+        assertItemStatus(childN.getProperty(jcrPrimaryType), Status.NEW);
 
         assertTrue(testSession.itemExists(childNPath));
         assertTrue(childN.isSame(testSession.getItem(childNPath)));
@@ -316,8 +316,8 @@ public class ExternalModificationTest ex
 
         testSession.refresh(false);
 
-        assertItemStatus(childN, Status0.REMOVED);
-        assertItemStatus(childP, Status0.REMOVED);
+        assertItemStatus(childN, Status.REMOVED);
+        assertItemStatus(childP, Status.REMOVED);
         assertFalse(testSession.itemExists(childNPath));
         assertFalse(testSession.itemExists(childPPath));
     }
@@ -343,17 +343,17 @@ public class ExternalModificationTest ex
         testSession.refresh(true);
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status0.STALE_DESTROYED);
-        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status0.STALE_DESTROYED);
-        assertItemStatus(child, Status0.REMOVED);
-        assertItemStatus(child2, Status0.STALE_DESTROYED);
-        assertItemStatus(child3, Status0.NEW);
-        assertItemStatus(child3.getProperty(jcrPrimaryType), Status0.NEW);
+        assertItemStatus(refNode2, Status.STALE_DESTROYED);
+        assertItemStatus(refNode2.getProperty(jcrMixinTypes), Status.STALE_DESTROYED);
+        assertItemStatus(child, Status.REMOVED);
+        assertItemStatus(child2, Status.STALE_DESTROYED);
+        assertItemStatus(child3, Status.NEW);
+        assertItemStatus(child3.getProperty(jcrPrimaryType), Status.NEW);
 
         testSession.refresh(false);
 
-        assertItemStatus(child2, Status0.REMOVED);
-        assertItemStatus(child3, Status0.REMOVED);
+        assertItemStatus(child2, Status.REMOVED);
+        assertItemStatus(child3, Status.REMOVED);
     }
 
     public void testUnmodifiedAncestorRemoved() throws RepositoryException, NotExecutableException {
@@ -383,10 +383,10 @@ public class ExternalModificationTest ex
         testSession.refresh(true);
         testSession.getItem(destPath);
 
-        assertItemStatus(refNode2, Status0.REMOVED);
-        assertItemStatus(node3, Status0.STALE_DESTROYED);
-        assertItemStatus(childN, Status0.NEW);
-        assertItemStatus(childP, Status0.NEW);
+        assertItemStatus(refNode2, Status.REMOVED);
+        assertItemStatus(node3, Status.STALE_DESTROYED);
+        assertItemStatus(childN, Status.NEW);
+        assertItemStatus(childP, Status.NEW);
 
         // since 'refNode2' is removed -> child items must not be accessible
         // any more.
@@ -396,8 +396,8 @@ public class ExternalModificationTest ex
         // revert all pending changes...
         testSession.refresh(false);
         // must mark all modified/new items as removed.
-        assertItemStatus(node3, Status0.REMOVED);
-        assertItemStatus(childN, Status0.REMOVED);
-        assertItemStatus(childP, Status0.REMOVED);
+        assertItemStatus(node3, Status.REMOVED);
+        assertItemStatus(childN, Status.REMOVED);
+        assertItemStatus(childP, Status.REMOVED);
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java?rev=1167239&r1=1167238&r2=1167239&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MixinModificationTest.java Fri Sep  9 15:07:42 2011
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.jcr2spi.state.Status0;
+import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.slf4j.Logger;
@@ -34,11 +34,11 @@ public class MixinModificationTest exten
 
     private static Logger log = LoggerFactory.getLogger(MixinModificationTest.class);
 
-    private static void assertItemStatus(Item item, Status0 status) throws NotExecutableException {
+    private static void assertItemStatus(Item item, Status status) throws NotExecutableException {
         if (!(item instanceof ItemImpl)) {
             throw new NotExecutableException("org.apache.jackrabbit.jcr2spi.ItemImpl expected");
         }
-        Status0 st = ((ItemImpl) item).getItemState().getStatus();
+        Status st = ((ItemImpl) item).getItemState().getStatus();
         assertEquals("Expected status to be " + status + ", was " + st, status, st);
     }
 
@@ -56,7 +56,7 @@ public class MixinModificationTest exten
             throw new NotExecutableException();
         }
 
-        assertItemStatus(n, Status0.EXISTING_MODIFIED);
+        assertItemStatus(n, Status.EXISTING_MODIFIED);
         assertTrue(n.hasProperty(jcrMixinTypes));
         Property p = n.getProperty(jcrMixinTypes);
 
@@ -64,8 +64,8 @@ public class MixinModificationTest exten
 
         // after saving the affected target node must be marked 'invalidated'.
         // the property however should be set existing.
-        assertItemStatus(n, Status0.INVALIDATED);
-        assertItemStatus(p, Status0.EXISTING);
+        assertItemStatus(n, Status.INVALIDATED);
+        assertItemStatus(p, Status.EXISTING);
     }
 
     public void testAddMixin2() throws RepositoryException,
@@ -82,7 +82,7 @@ public class MixinModificationTest exten
         // after saving the affected target node must be marked 'invalidated'
         // even if adding the node and setting a mixin was achieved in the
         // same batch.
-        assertItemStatus(n, Status0.INVALIDATED);
+        assertItemStatus(n, Status.INVALIDATED);
     }
 
     public void testRemoveMixin() throws RepositoryException, NotExecutableException {
@@ -115,7 +115,7 @@ public class MixinModificationTest exten
             }
 
             // however: the added node should still be valid. but not referenceable
-            assertItemStatus(n, Status0.EXISTING);
+            assertItemStatus(n, Status.EXISTING);
             assertFalse(n.isNodeType(mixReferenceable));
             assertTrue(testSession.itemExists(nPath));
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java?rev=1167239&r1=1167238&r2=1167239&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/MoveTest.java Fri Sep  9 15:07:42 2011
@@ -276,7 +276,7 @@ public class MoveTest extends AbstractMo
         destParentNode.remove();
 
         // JCR-2528 caused this call to throw a javax.jcr.InvalidItemStateException: Item has already
-        // been removed by someone else. Status0 = REMOVED
+        // been removed by someone else. Status = REMOVED
         destParentNode.getSession().save();
     }