jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1329714 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/ oak-jcr/src/main/java/org/apache/ja...
Date Tue, 24 Apr 2012 13:45:21 GMT
Author: mduerig
Date: Tue Apr 24 13:45:20 2012
New Revision: 1329714

URL: http://svn.apache.org/viewvc?rev=1329714&view=rev
Log:
OAK-18: Define Oak API 
- fix refresh

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java?rev=1329714&r1=1329713&r2=1329714&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java Tue
Apr 24 13:45:20 2012
@@ -60,9 +60,7 @@ public interface Root {
     Tree getTree(String path);
 
     /**
-     * Refresh this root to the latest revision. After a call to this method,
-     * all trees obtained through {@link #getTree(String)} are invalid and fresh
-     * instances must be obtained.
+     * Refresh this root to the latest revision.
      */
     void refresh();
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java?rev=1329714&r1=1329713&r2=1329714&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelRoot.java
Tue Apr 24 13:45:20 2012
@@ -59,7 +59,6 @@ public class KernelRoot implements Root 
     /** Log of changes to tree */
     private ChangeLog changeLog = new ChangeLog();
 
-
     public KernelRoot(NodeStore store, String workspaceName) {
         this.store = store;
         this.workspaceName = workspaceName;
@@ -101,7 +100,6 @@ public class KernelRoot implements Root 
     @Override
     public void refresh() {
         this.base = (KernelNodeState) store.getRoot().getChildNode(workspaceName);  // FIXME
don't cast to implementation
-        this.root = new KernelTree(base, changeLog);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootTest.java?rev=1329714&r1=1329713&r2=1329714&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootTest.java
Tue Apr 24 13:45:20 2012
@@ -21,9 +21,9 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.simple.SimpleKernelImpl;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -331,20 +331,25 @@ public class KernelRootTest {
         KernelRoot root = new KernelRoot(store, "test");
         Tree tree = root.getTree("/");
 
+        Set<String> added = new HashSet<String>();
+
         tree.addChild("large");
         tree = tree.getChild("large");
         for (int c = 0; c < 10000; c++) {
-            tree.addChild("n" + c);
+            String name = "n" + c;
+            added.add(name);
+            tree.addChild(name);
         }
 
         root.commit();
         tree = root.getTree("/");
         tree = tree.getChild("large");
 
-        int c = 0;
         for (Tree q : tree.getChildren()) {
-            assertEquals("n" + c++, q.getName());
+            assertTrue(added.remove(q.getName()));
         }
+
+        assertTrue(added.isEmpty());
     }
 
     private static void checkEqual(Tree tree1, Tree tree2) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1329714&r1=1329713&r2=1329714&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Tue Apr 24 13:45:20 2012
@@ -161,7 +161,7 @@ public class SessionImpl extends Abstrac
         ensureIsAlive();
         try {
             root.commit();
-            root = contentSession.getCurrentRoot();  // TODO branch should be refreshed.
double check
+            root = contentSession.getCurrentRoot();
         } catch (CommitFailedException e) {
             throw new RepositoryException(e);
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1329714&r1=1329713&r2=1329714&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Tue Apr 24 13:45:20 2012
@@ -1074,7 +1074,6 @@ public class RepositoryTest extends Abst
     }
 
     @Test
-    @Ignore("WIP")  // FIXME session.refresh
     public void sessionRefresh() throws RepositoryException {
         Session session = getRepository().login();
         try {



Mime
View raw message