jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1388369 [3/3] - in /jackrabbit/oak/trunk: ./ oak-mongomk-api/ oak-mongomk-api/src/main/java/org/apache/jackrabbit/mongomk/api/ oak-mongomk-api/src/main/java/org/apache/jackrabbit/mongomk/api/command/ oak-mongomk-api/src/main/java/org/apach...
Date Fri, 21 Sep 2012 08:26:45 GMT
Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/NodeFilter.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/NodeFilter.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/NodeFilter.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/NodeFilter.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/NodeFilter.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilder.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilder.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilder.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilder.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilder.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilder.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilder.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilder.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilder.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilder.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/CommandExecutorImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/command/CommandExecutorImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/CommandExecutorImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/CommandExecutorImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/command/CommandExecutorImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/DefaultJsopHandler.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/DefaultJsopHandler.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/DefaultJsopHandler.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/DefaultJsopHandler.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/DefaultJsopHandler.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsopParser.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsopParser.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsopParser.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsopParser.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsopParser.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddNodeInstructionImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddNodeInstructionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddNodeInstructionImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddNodeInstructionImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddNodeInstructionImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddPropertyInstructionImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddPropertyInstructionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddPropertyInstructionImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddPropertyInstructionImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/AddPropertyInstructionImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CommitImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CommitImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CommitImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CommitImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CommitImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CopyNodeInstructionImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CopyNodeInstructionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CopyNodeInstructionImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CopyNodeInstructionImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/CopyNodeInstructionImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/MoveNodeInstructionImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/MoveNodeInstructionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/MoveNodeInstructionImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/MoveNodeInstructionImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/MoveNodeInstructionImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/NodeImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/NodeImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/NodeImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/NodeImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/NodeImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/RemoveNodeInstructionImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/RemoveNodeInstructionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/RemoveNodeInstructionImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/RemoveNodeInstructionImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/RemoveNodeInstructionImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/SetPropertyInstructionImpl.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/SetPropertyInstructionImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/SetPropertyInstructionImpl.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/model/SetPropertyInstructionImpl.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/model/SetPropertyInstructionImpl.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/command/NodeExistsCommandMongoTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/command/NodeExistsCommandMongoTest.java?rev=1388369&r1=1388368&r2=1388369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/command/NodeExistsCommandMongoTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/command/NodeExistsCommandMongoTest.java
Fri Sep 21 08:26:42 2012
@@ -30,202 +30,205 @@ import org.apache.jackrabbit.mongomk.imp
 import org.apache.jackrabbit.mongomk.impl.model.CommitImpl;
 import org.apache.jackrabbit.mongomk.impl.model.RemoveNodeInstructionImpl;
 import org.apache.jackrabbit.mongomk.scenario.SimpleNodeScenario;
+import org.junit.Ignore;
 import org.junit.Test;
 
 @SuppressWarnings("javadoc")
 public class NodeExistsCommandMongoTest extends BaseMongoTest {
 
-	@Test
-	public void simple() throws Exception {
-		SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
-		String revisionId = scenario.create();
-
-		NodeExistsCommandMongo command = new NodeExistsCommandMongo(
-				mongoConnection, "/a", revisionId);
-		boolean exists = command.execute();
-		assertTrue(exists);
-
-		command = new NodeExistsCommandMongo(mongoConnection, "/a/b",
-				revisionId);
-		exists = command.execute();
-		assertTrue(exists);
-
-		revisionId = scenario.delete_A();
-
-		command = new NodeExistsCommandMongo(mongoConnection, "/a", revisionId);
-		exists = command.execute();
-		assertFalse(exists);
-
-		command = new NodeExistsCommandMongo(mongoConnection, "/a/b",
-				revisionId);
-		exists = command.execute();
-		assertFalse(exists);
-	}
-
-	@Test
-	public void withoutRevisionId() throws Exception {
-		SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
-		scenario.create();
-
-		NodeExistsCommandMongo command = new NodeExistsCommandMongo(
-				mongoConnection, "/a", null /* revisionId */);
-		boolean exists = command.execute();
-		assertTrue(exists);
-
-		scenario.delete_A();
-
-		command = new NodeExistsCommandMongo(mongoConnection, "/a", null /* revisionId */);
-		exists = command.execute();
-		assertFalse(exists);
-	}
-
-	@Test
-	public void withInvalidRevisionId() throws Exception {
-		SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
-		scenario.create();
-
-		NodeExistsCommandMongo command = new NodeExistsCommandMongo(
-				mongoConnection, "/a", "123456789");
-		try {
-			command.execute();
-			fail("Expected: Invalid revision id exception");
-		} catch (Exception expected) {
-		}
-	}
-
-	@Test
-	public void parentDelete() throws Exception {
-		SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
-		scenario.create();
-
-		NodeExistsCommandMongo command = new NodeExistsCommandMongo(
-				mongoConnection, "/a/b", null);
-		boolean exists = command.execute();
-		assertTrue(exists);
-
-		scenario.delete_A();
-		command = new NodeExistsCommandMongo(mongoConnection, "/a/b", null);
-		exists = command.execute();
-		assertFalse(exists);
-	}
-
-	@Test
-	public void grandParentDelete() throws Exception {
-		// Add a->b->c->d.
-		List<Instruction> instructions = new LinkedList<Instruction>();
-		instructions.add(new AddNodeInstructionImpl("/", "a"));
-		instructions.add(new AddNodeInstructionImpl("/a", "b"));
-		instructions.add(new AddNodeInstructionImpl("/a/b", "c"));
-		instructions.add(new AddNodeInstructionImpl("/a/b/c", "d"));
-
-		Commit commit = new CommitImpl("Add nodes", "/", "TODO", instructions);
-		CommitCommandMongo command = new CommitCommandMongo(mongoConnection,
-				commit);
-		command.execute();
-
-		// Remove b.
-		instructions = new LinkedList<Instruction>();
-		instructions.add(new RemoveNodeInstructionImpl("/a", "b"));
-		commit = new CommitImpl("Delete /b", "/a", "-b", instructions);
-		command = new CommitCommandMongo(mongoConnection, commit);
-		command.execute();
-
-		// Check for d.
-		NodeExistsCommandMongo existsCommand = new NodeExistsCommandMongo(
-				mongoConnection, "/a/b/c/d", null);
-		boolean exists = existsCommand.execute();
-		assertFalse(exists);
-	}
-
-	@Test
-	public void existsInOldRevNotInNewRev() throws Exception {
-		SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
-		String rev1 = scenario.create();
-		String rev2 = scenario.delete_A();
-
-		NodeExistsCommandMongo command = new NodeExistsCommandMongo(
-				mongoConnection, "/a", rev1);
-		boolean exists = command.execute();
-		assertTrue(exists);
-
-		command = new NodeExistsCommandMongo(mongoConnection, "/a", rev2);
-		exists = command.execute();
-		assertFalse(exists);
-	}
-
-	@Test
-	public void siblingDelete() throws Exception {
-		SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
-		scenario.create();
-
-		scenario.delete_B();
-		NodeExistsCommandMongo command = new NodeExistsCommandMongo(
-				mongoConnection, "/a/b", null);
-		boolean exists = command.execute();
-		assertFalse(exists);
-
-		command = new NodeExistsCommandMongo(mongoConnection, "/a/c", null);
-		exists = command.execute();
-		assertTrue(exists);
-	}
-
-	@Test
-	public void testNodeNotFound() throws Exception {
-
-		// adds nodes /a,/a/b,/a/b/c , checks if node a exists
-		List<Instruction> instructions = new LinkedList<Instruction>();
-
-		// commit node /a
-		instructions.add(new AddNodeInstructionImpl("/", "a"));
-		Commit commit1 = new CommitImpl("/", "+a : {}", "Add node a",
-				instructions);
-		CommitCommandMongo command = new CommitCommandMongo(mongoConnection,
-				commit1);
-		command.execute();
-
-		// commit node /a/b
-		instructions = new LinkedList<Instruction>();
-		instructions.add(new AddNodeInstructionImpl("/a", "b"));
-		Commit commit2 = new CommitImpl("/a", "+b : {}", "Add node a/b",
-				instructions);
-		command = new CommitCommandMongo(mongoConnection, commit2);
-		command.execute();
-
-		// commit node /a/b/c
-		instructions = new LinkedList<Instruction>();
-		instructions.add(new AddNodeInstructionImpl("/a/b", "c"));
-		Commit commit3 = new CommitImpl("a/b", "+c : {}", "Add node a/b/c",
-				instructions);
-		command = new CommitCommandMongo(mongoConnection, commit3);
-		command.execute();
-
-		// verify if node a is visible in the head revision
-		NodeExistsCommandMongo isNodeVisible = new NodeExistsCommandMongo(
-				mongoConnection, "/a", null);
-		boolean exists = isNodeVisible.execute();
-		assertTrue("The node a is not found in the head revision!", exists);
-
-	}
-	
-	@Test
-	public void testTreeDepth() throws Exception {
-
-		String path = "/";
-		List<Instruction> instructions = new LinkedList<Instruction>();
-
-		for (int i = 0; i < 1000; i++) {
-			instructions.clear();
-			instructions.add(new AddNodeInstructionImpl(path, "N" + i));
-			Commit commit1 = new CommitImpl(path, "+N" + i + " : {}",
-					"Add node N" + i, instructions);
-			CommitCommandMongo command = new CommitCommandMongo(
-					mongoConnection, commit1);
-			command.execute();
-			path = (path.endsWith("/")) ? (path = path + "N" + i)
-					: (path = path + "/N" + i);
-			//System.out.println("*********" + path.length() + "*****");
-		}
-		
-	}
+    @Test
+    public void simple() throws Exception {
+        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
+        String revisionId = scenario.create();
+
+        NodeExistsCommandMongo command = new NodeExistsCommandMongo(
+                mongoConnection, "/a", revisionId);
+        boolean exists = command.execute();
+        assertTrue(exists);
+
+        command = new NodeExistsCommandMongo(mongoConnection, "/a/b",
+                revisionId);
+        exists = command.execute();
+        assertTrue(exists);
+
+        revisionId = scenario.delete_A();
+
+        command = new NodeExistsCommandMongo(mongoConnection, "/a", revisionId);
+        exists = command.execute();
+        assertFalse(exists);
+
+        command = new NodeExistsCommandMongo(mongoConnection, "/a/b",
+                revisionId);
+        exists = command.execute();
+        assertFalse(exists);
+    }
+
+    @Test
+    public void withoutRevisionId() throws Exception {
+        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
+        scenario.create();
+
+        NodeExistsCommandMongo command = new NodeExistsCommandMongo(
+                mongoConnection, "/a", null /* revisionId */);
+        boolean exists = command.execute();
+        assertTrue(exists);
+
+        scenario.delete_A();
+
+        command = new NodeExistsCommandMongo(mongoConnection, "/a", null /* revisionId */);
+        exists = command.execute();
+        assertFalse(exists);
+    }
+
+    @Test
+    public void withInvalidRevisionId() throws Exception {
+        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
+        scenario.create();
+
+        NodeExistsCommandMongo command = new NodeExistsCommandMongo(
+                mongoConnection, "/a", "123456789");
+        try {
+            command.execute();
+            fail("Expected: Invalid revision id exception");
+        } catch (Exception expected) {
+        }
+    }
+
+    @Test
+    public void parentDelete() throws Exception {
+        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
+        scenario.create();
+
+        NodeExistsCommandMongo command = new NodeExistsCommandMongo(
+                mongoConnection, "/a/b", null);
+        boolean exists = command.execute();
+        assertTrue(exists);
+
+        scenario.delete_A();
+        command = new NodeExistsCommandMongo(mongoConnection, "/a/b", null);
+        exists = command.execute();
+        assertFalse(exists);
+    }
+
+    @Test
+    public void grandParentDelete() throws Exception {
+        // Add a->b->c->d.
+        List<Instruction> instructions = new LinkedList<Instruction>();
+        instructions.add(new AddNodeInstructionImpl("/", "a"));
+        instructions.add(new AddNodeInstructionImpl("/a", "b"));
+        instructions.add(new AddNodeInstructionImpl("/a/b", "c"));
+        instructions.add(new AddNodeInstructionImpl("/a/b/c", "d"));
+
+        Commit commit = new CommitImpl("Add nodes", "/", "TODO", instructions);
+        CommitCommandMongo command = new CommitCommandMongo(mongoConnection,
+                commit);
+        command.execute();
+
+        // Remove b.
+        instructions = new LinkedList<Instruction>();
+        instructions.add(new RemoveNodeInstructionImpl("/a", "b"));
+        commit = new CommitImpl("Delete /b", "/a", "-b", instructions);
+        command = new CommitCommandMongo(mongoConnection, commit);
+        command.execute();
+
+        // Check for d.
+        NodeExistsCommandMongo existsCommand = new NodeExistsCommandMongo(
+                mongoConnection, "/a/b/c/d", null);
+        boolean exists = existsCommand.execute();
+        assertFalse(exists);
+    }
+
+    @Test
+    public void existsInOldRevNotInNewRev() throws Exception {
+        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
+        String rev1 = scenario.create();
+        String rev2 = scenario.delete_A();
+
+        NodeExistsCommandMongo command = new NodeExistsCommandMongo(
+                mongoConnection, "/a", rev1);
+        boolean exists = command.execute();
+        assertTrue(exists);
+
+        command = new NodeExistsCommandMongo(mongoConnection, "/a", rev2);
+        exists = command.execute();
+        assertFalse(exists);
+    }
+
+    @Test
+    public void siblingDelete() throws Exception {
+        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
+        scenario.create();
+
+        scenario.delete_B();
+        NodeExistsCommandMongo command = new NodeExistsCommandMongo(
+                mongoConnection, "/a/b", null);
+        boolean exists = command.execute();
+        assertFalse(exists);
+
+        command = new NodeExistsCommandMongo(mongoConnection, "/a/c", null);
+        exists = command.execute();
+        assertTrue(exists);
+    }
+
+    @Test
+    @Ignore
+    public void testNodeNotFound() throws Exception {
+
+        // adds nodes /a,/a/b,/a/b/c , checks if node a exists
+        List<Instruction> instructions = new LinkedList<Instruction>();
+
+        // commit node /a
+        instructions.add(new AddNodeInstructionImpl("/", "a"));
+        Commit commit1 = new CommitImpl("/", "+a : {}", "Add node a",
+                instructions);
+        CommitCommandMongo command = new CommitCommandMongo(mongoConnection,
+                commit1);
+        command.execute();
+
+        // commit node /a/b
+        instructions = new LinkedList<Instruction>();
+        instructions.add(new AddNodeInstructionImpl("/a", "b"));
+        Commit commit2 = new CommitImpl("/a", "+b : {}", "Add node a/b",
+                instructions);
+        command = new CommitCommandMongo(mongoConnection, commit2);
+        command.execute();
+
+        // commit node /a/b/c
+        instructions = new LinkedList<Instruction>();
+        instructions.add(new AddNodeInstructionImpl("/a/b", "c"));
+        Commit commit3 = new CommitImpl("a/b", "+c : {}", "Add node a/b/c",
+                instructions);
+        command = new CommitCommandMongo(mongoConnection, commit3);
+        command.execute();
+
+        // verify if node a is visible in the head revision
+        NodeExistsCommandMongo isNodeVisible = new NodeExistsCommandMongo(
+                mongoConnection, "/a", null);
+        boolean exists = isNodeVisible.execute();
+        assertTrue("The node a is not found in the head revision!", exists);
+
+    }
+
+    @Test
+    @Ignore
+    public void testTreeDepth() throws Exception {
+
+        String path = "/";
+        List<Instruction> instructions = new LinkedList<Instruction>();
+
+        for (int i = 0; i < 1000; i++) {
+            instructions.clear();
+            instructions.add(new AddNodeInstructionImpl(path, "N" + i));
+            Commit commit1 = new CommitImpl(path, "+N" + i + " : {}",
+                    "Add node N" + i, instructions);
+            CommitCommandMongo command = new CommitCommandMongo(
+                    mongoConnection, commit1);
+            command.execute();
+            path = (path.endsWith("/")) ? (path = path + "N" + i)
+                    : (path = path + "/N" + i);
+            //System.out.println("*********" + path.length() + "*****");
+        }
+
+    }
 
 }

Copied: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/NodeAssert.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/NodeAssert.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/NodeAssert.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/NodeAssert.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/NodeAssert.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Copied: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilderImplTest.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/builder/CommitBuilderImplTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilderImplTest.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilderImplTest.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/builder/CommitBuilderImplTest.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/builder/CommitBuilderImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/CommitBuilderImplTest.java
Fri Sep 21 08:26:42 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mongomk.builder;
+package org.apache.jackrabbit.mongomk.impl.builder;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;

Copied: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilderTest.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/builder/NodeBuilderTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilderTest.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilderTest.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/builder/NodeBuilderTest.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/builder/NodeBuilderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/builder/NodeBuilderTest.java
Fri Sep 21 08:26:42 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mongomk.builder;
+package org.apache.jackrabbit.mongomk.impl.builder;
 
 import org.apache.jackrabbit.mongomk.api.model.Node;
 import org.apache.jackrabbit.mongomk.impl.NodeAssert;

Copied: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/json/JsopParserTest.java
(from r1388086, jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/json/JsopParserTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/json/JsopParserTest.java?p2=jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/json/JsopParserTest.java&p1=jackrabbit/oak/trunk/oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/json/JsopParserTest.java&r1=1388086&r2=1388369&rev=1388369&view=diff
==============================================================================
    (empty)

Modified: jackrabbit/oak/trunk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/pom.xml?rev=1388369&r1=1388368&r2=1388369&view=diff
==============================================================================
--- jackrabbit/oak/trunk/pom.xml (original)
+++ jackrabbit/oak/trunk/pom.xml Fri Sep 21 08:26:42 2012
@@ -90,8 +90,6 @@
     <profile>
       <id>mongomk</id>
       <modules>
-        <module>oak-mongomk-api</module>
-        <module>oak-mongomk-impl</module>
         <module>oak-mongomk</module>
         <module>oak-mongomk-test</module>
         <module>oak-mongomk-perf</module>



Mime
View raw message