jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1574040 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
Date Tue, 04 Mar 2014 11:44:21 GMT
Author: alexparvulescu
Date: Tue Mar  4 11:44:21 2014
New Revision: 1574040

URL: http://svn.apache.org/r1574040
Log:
OAK-1472 ConcurrentAddReferenceTest#addReferences still fails
 - tweaked the test so the #tearDown doesn't break it

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java?rev=1574040&r1=1574039&r2=1574040&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ConcurrentAddReferenceTest.java
Tue Mar  4 11:44:21 2014
@@ -48,6 +48,8 @@ public class ConcurrentAddReferenceTest 
 
     private String refPath;
 
+    private Node testRoot;
+
     public ConcurrentAddReferenceTest(NodeStoreFixture fixture) {
         super(fixture);
     }
@@ -58,6 +60,7 @@ public class ConcurrentAddReferenceTest 
         Node root = session.getRootNode();
         Node testNode = root.addNode("test_referenceable");
         testNode.addMixin(NodeType.MIX_REFERENCEABLE);
+        testRoot = getAdminSession().getRootNode().addNode("test");
         session.save();
         refPath = testNode.getPath();
     }
@@ -65,20 +68,19 @@ public class ConcurrentAddReferenceTest 
     @After
     public void tearDown() throws RepositoryException {
         Session session = getAdminSession();
-        session.removeItem("/test");
+        testRoot.remove();
         session.removeItem(refPath);
         session.save();
     }
 
-//    @SuppressWarnings("unchecked")
+    @SuppressWarnings("unchecked")
     @Test
     public void addReferences() throws Exception {
         Assume.assumeTrue(fixture != NodeStoreFixture.DOCUMENT_JDBC);  // FIXME OAK-1472
         List<Exception> exceptions = Collections.synchronizedList(new ArrayList<Exception>());
-        Node test = getAdminSession().getRootNode().addNode("test");
         List<Thread> worker = new ArrayList<Thread>();
         for (int i = 0; i < NUM_WORKERS; i++) {
-            String path = test.addNode("node" + i).getPath();
+            String path = testRoot.addNode("node" + i).getPath();
             worker.add(new Thread(new Worker(
                     createAdminSession(), path, exceptions)));
         }
@@ -93,7 +95,7 @@ public class ConcurrentAddReferenceTest 
             fail(e.toString());
         }
         getAdminSession().refresh(false);
-        for (Node n : in((Iterator<Node>) test.getNodes())) {
+        for (Node n : in((Iterator<Node>) testRoot.getNodes())) {
             assertEquals(NODES_PER_WORKER, Iterators.size(n.getNodes()));
         }
     }



Mime
View raw message