jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1430271 - /jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
Date Tue, 08 Jan 2013 13:23:16 GMT
Author: mreutegg
Date: Tue Jan  8 13:23:16 2013
New Revision: 1430271

URL: http://svn.apache.org/viewvc?rev=1430271&view=rev
Log:
OAK-542: MongoMK.getNodes() may return changes from other unmerged branch 

Added:
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
  (with props)

Added: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java?rev=1430271&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
(added)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
Tue Jan  8 13:23:16 2013
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mongomk.impl;
+
+import org.apache.jackrabbit.mongomk.BaseMongoMicroKernelTest;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+
+/**
+ * <code>MongoMKBranchTest</code> performs a test to check if commits
+ * to a branch are not visible to other branches.
+ */
+public class MongoMKBranchTest extends BaseMongoMicroKernelTest {
+
+    /**
+     * Creates the following revision history:
+     * <pre>
+     *   + rev1 (first commit with /child1)
+     *   |\
+     *   | + branchRev1 (branch from rev1)
+     *   | + branchRev11 (branch commit /child1/foo:1)
+     *   |
+     *   + rev2 (second commit with /child2)
+     *   |\
+     *   | + branchRev2 (brach from rev2)
+     * </pre>
+     * The test reads /child from <code>branchRev2</code> and expects
+     * the version from the first commit.
+     */
+    @Test
+    @Ignore("OAK-542")
+    public void isolatedBranches() throws Exception {
+        String rev1 = mk.commit("", "+\"/child1\":{}", null, "");
+
+        String branchRev1 = mk.branch(rev1);
+        String branchRev11 = mk.commit("/child1", "^\"foo\":1", branchRev1, "");
+
+        String rev2 = mk.commit("", "+\"/child2\":{}", null, "");
+
+        String branchRev2 = mk.branch(rev2);
+        String json = mk.getNodes("/child1", branchRev2, 1000, 0, -1, null);
+        JSONParser parser = new JSONParser();
+        JSONObject obj = (JSONObject) parser.parse(json);
+        assertFalse(obj.containsKey("foo"));
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKBranchTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL



Mime
View raw message