jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792142 [15/35] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrab...
Date Wed, 08 Jul 2009 13:57:46 GMT
Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/AbstractConcurrencyTest.java Wed Jul  8 13:57:13 2009
@@ -68,7 +68,7 @@
         for (int t = 0; t < tasks.length; t++) {
             for (int i = 0; i < concurrency; i++) {
                 int id = t * concurrency + i;
-                Session s = helper.getSuperuserSession();
+                Session s = getHelper().getSuperuserSession();
                 Node test = s.getRootNode().addNode(testPath + "/node" + id);
                 s.save();
                 executors[id] = new Executor(s, test, tasks[t]);
@@ -89,7 +89,7 @@
             throws RepositoryException {
         Executor[] executors = new Executor[concurrency];
         for (int i = 0; i < concurrency; i++) {
-            Session s = helper.getSuperuserSession();
+            Session s = getHelper().getSuperuserSession();
             Node test = (Node) s.getItem(path);
             s.save();
             executors[i] = new Executor(s, test, task);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrencyTest.java Wed Jul  8 13:57:13 2009
@@ -55,7 +55,7 @@
             Thread[] threads = new Thread[NUM_SESSIONS];
             for (int i = 0; i < threads.length; i++) {
                 // create new session
-                Session session = helper.getSuperuserSession();
+                Session session = getHelper().getSuperuserSession();
                 TestSession ts = new TestSession("s" + i, session);
                 Thread t = new Thread(ts);
                 t.setName((NUM_ITERATIONS - n) + "-s" + i);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentLoginTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentLoginTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentLoginTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentLoginTest.java Wed Jul  8 13:57:13 2009
@@ -50,10 +50,10 @@
         for (int i = 0; i < NUM_THREADS; i++) {
             testRunner.add(new Thread(new Runnable() {
                 public void run() {
-                    Credentials cred = helper.getSuperuserCredentials();
+                    Credentials cred = getHelper().getSuperuserCredentials();
                     for (int i = 0; i < NUM_LOGINS_PER_THREAD; i++) {
                         try {
-                            Session s = helper.getRepository().login(cred);
+                            Session s = getHelper().getRepository().login(cred);
                             // immediately logout
                             s.logout();
                         } catch (Exception e) {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentNodeModificationTest.java Wed Jul  8 13:57:13 2009
@@ -48,7 +48,7 @@
             Thread[] threads = new Thread[NUM_SESSIONS];
             for (int i = 0; i < threads.length; i++) {
                 // create new session
-                Session session = helper.getSuperuserSession();
+                Session session = getHelper().getSuperuserSession();
                 TestSession ts = new TestSession("s" + i, session);
                 Thread t = new Thread(ts);
                 t.setName((NUM_ITERATIONS - n) + "-s" + i);
@@ -120,7 +120,17 @@
                     state = "adding property to subnode " + i;
                     n1.setProperty("testprop", "xxx");
                     if (i % 10 == 0) {
-                        state = "saving pending subnodes";
+                        state = "saving pending (added) subnodes";
+                        session.save();
+                    }
+                    randomSleep();
+                }
+
+                for (int i = 0; i < NUM_NODES; i++) {
+                    state = "removing subnode " + i;
+                    n.getNode("x" + identity + i).remove();
+                    if (i % 10 == 0) {
+                        state = "saving pending (removed) subnodes";
                         session.save();
                     }
                     randomSleep();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ConcurrentSaveTest.java Wed Jul  8 13:57:13 2009
@@ -42,8 +42,8 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        addNodeSession = helper.getSuperuserSession();
-        removePropertySession = helper.getSuperuserSession();
+        addNodeSession = getHelper().getSuperuserSession();
+        removePropertySession = getHelper().getSuperuserSession();
     }
 
     protected void tearDown() throws Exception {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/LockTest.java Wed Jul  8 13:57:13 2009
@@ -58,7 +58,7 @@
                 public void run() {
                     Session s;
                     try {
-                        s = helper.getSuperuserSession();
+                        s = getHelper().getSuperuserSession();
                     } catch (RepositoryException e) {
                         return;
                     }
@@ -125,7 +125,7 @@
                 public void run() {
                     Session s;
                     try {
-                        s = helper.getSuperuserSession();
+                        s = getHelper().getSuperuserSession();
                     } catch (RepositoryException e) {
                         return;
                     }
@@ -191,7 +191,7 @@
                 public void run() {
                     Session s;
                     try {
-                        s = helper.getSuperuserSession();
+                        s = getHelper().getSuperuserSession();
                     } catch (RepositoryException e) {
                         return;
                     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/NodeImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/NodeImplTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/NodeImplTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/NodeImplTest.java Wed Jul  8 13:57:13 2009
@@ -16,19 +16,19 @@
  */
 package org.apache.jackrabbit.core;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.AccessControlPolicyIterator;
-import javax.jcr.security.AccessControlPolicy;
-import javax.jcr.security.Privilege;
-import org.apache.jackrabbit.core.security.authorization.JackrabbitAccessControlList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.jcr.Node;
-import javax.jcr.Session;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.AccessControlPolicy;
+import javax.jcr.security.AccessControlPolicyIterator;
+import javax.jcr.security.Privilege;
 import java.security.Principal;
 import java.security.acl.Group;
 import java.util.Iterator;
@@ -77,8 +77,8 @@
         }
     }
 
-    private static Principal getReadOnlyPrincipal() throws RepositoryException, NotExecutableException {
-        SessionImpl s = (SessionImpl) helper.getReadOnlySession();
+    private Principal getReadOnlyPrincipal() throws RepositoryException, NotExecutableException {
+        SessionImpl s = (SessionImpl) getHelper().getReadOnlySession();
         try {
             for (Iterator it = s.getSubject().getPrincipals().iterator(); it.hasNext();) {
                 Principal p = (Principal) it.next();
@@ -108,7 +108,7 @@
         changeReadPermission(principal, n, false);
         changeReadPermission(principal, testNode, true);
 
-        Session readOnly = helper.getReadOnlySession();
+        Session readOnly = getHelper().getReadOnlySession();
         try {
             NodeImpl tn = (NodeImpl) readOnly.getItem(testNode.getPath());
             assertTrue(tn.internalIsCheckedOut());

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadVersionsWhileModified.java Wed Jul  8 13:57:13 2009
@@ -37,7 +37,7 @@
         final Node n = testRootNode.addNode(nodeName1);
         n.addMixin(mixVersionable);
         testRootNode.save();
-        final Session s = helper.getSuperuserSession();
+        final Session s = getHelper().getSuperuserSession();
         Thread t = new Thread(new Runnable() {
             public void run() {
                 long end = System.currentTimeMillis() + RUN_NUM_SECONDS * 1000;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadWhileSaveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadWhileSaveTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadWhileSaveTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ReadWhileSaveTest.java Wed Jul  8 13:57:13 2009
@@ -42,7 +42,7 @@
         Thread t = runExpensiveSave();
         long numReads = 0;
         while (t.isAlive()) {
-            Session s = helper.getSuperuserSession();
+            Session s = getHelper().getSuperuserSession();
             try {
                 for (NodeIterator it = s.getRootNode().getNodes(); it.hasNext(); ) {
                     it.nextNode();
@@ -71,7 +71,7 @@
             out.write(randomKb);
         }
         out.close();
-        final Session s = helper.getSuperuserSession();
+        final Session s = getHelper().getSuperuserSession();
         final Node stuff = s.getRootNode().getNode(testPath).addNode("stuff");
         Thread t = new Thread(new Runnable() {
             public void run() {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RestoreAndCheckoutTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RestoreAndCheckoutTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RestoreAndCheckoutTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RestoreAndCheckoutTest.java Wed Jul  8 13:57:13 2009
@@ -32,7 +32,7 @@
 	private static final int NODES_COUNT = 10;
 
 	public void testRestoreAndCheckout() throws RepositoryException {
-		Session session = helper.getSuperuserSession();
+		Session session = getHelper().getSuperuserSession();
 		
 		Node rootNode = session.getRootNode();
 		Node myRoot = rootNode.addNode("myRoot");

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RetentionRegistryImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RetentionRegistryImplTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RetentionRegistryImplTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/RetentionRegistryImplTest.java Wed Jul  8 13:57:13 2009
@@ -133,7 +133,7 @@
     }
 
     public void testReadRetentionFromFile() throws RepositoryException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistryImpl re = new RetentionRegistryImpl(s, createFileSystem());
         try {
             assertTrue(re.hasEffectiveRetention(s.getQPath(childNPath), false));
@@ -223,7 +223,7 @@
     }
 
     public void testRemoveHold() throws RepositoryException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistry re = s.getRetentionRegistry();
         try {
             Hold[] holds = retentionMgr.getHolds(childNPath);
@@ -242,7 +242,7 @@
     }
 
     public void testRemoveRetentionPolicy() throws RepositoryException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistry re = s.getRetentionRegistry();
         try {
             retentionMgr.removeRetentionPolicy(childNPath);
@@ -259,7 +259,7 @@
     }
 
     public void testAddHold() throws RepositoryException, NotExecutableException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistry re = s.getRetentionRegistry();
         Hold h = null;
         try {
@@ -281,7 +281,7 @@
     }
 
     public void testAddMultipleHold() throws RepositoryException, NotExecutableException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistry re = s.getRetentionRegistry();
         try {
             retentionMgr.addHold(childN2.getPath(), getHoldName(), false);
@@ -310,7 +310,7 @@
     }
 
     public void testSetRetentionPolicy() throws RepositoryException, NotExecutableException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistry re = s.getRetentionRegistry();
         try {
             retentionMgr.setRetentionPolicy(childN2.getPath(), getApplicableRetentionPolicy("test2"));
@@ -329,7 +329,7 @@
     }
 
     public void testChangeRetentionPolicy() throws RepositoryException, NotExecutableException {
-        SessionImpl s = (SessionImpl) helper.getSuperuserSession();
+        SessionImpl s = (SessionImpl) getHelper().getSuperuserSession();
         RetentionRegistry re = s.getRetentionRegistry();
         try {
             retentionMgr.setRetentionPolicy(childN2.getPath(), getApplicableRetentionPolicy("test2"));

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/SessionGarbageCollectedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/SessionGarbageCollectedTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/SessionGarbageCollectedTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/SessionGarbageCollectedTest.java Wed Jul  8 13:57:13 2009
@@ -33,17 +33,17 @@
 public class SessionGarbageCollectedTest extends AbstractJCRTest {
 
     public void testSessionsGetGarbageCollected() throws RepositoryException {
-        ArrayList list = new ArrayList();
-        ReferenceQueue detect = new ReferenceQueue();
+        ArrayList<WeakReference<Session>> list = new ArrayList<WeakReference<Session>>();
+        ReferenceQueue<Session> detect = new ReferenceQueue<Session>();
         Error error = null;
         try {
             for (int i = 0;; i++) {
-                Session s = helper.getReadWriteSession();
+                Session s = getHelper().getReadWriteSession();
                 // eat  a lot of memory so it gets garbage collected quickly
                 // (or quickly runs out of memory)
                 Node n = s.getRootNode().addNode("n" + i);
                 n.setProperty("x", new String(new char[1000000]));
-                list.add(new WeakReference(s, detect));
+                list.add(new WeakReference<Session>(s, detect));
                 if (detect.poll() != null) {
                     break;
                 }
@@ -52,8 +52,8 @@
             error = e;
         }
         for (int i = 0; i < list.size(); i++) {
-            Reference ref = (Reference) list.get(i);
-            Session s = (Session) ref.get();
+            Reference<Session> ref = list.get(i);
+            Session s = ref.get();
             if (s != null) {
                 s.logout();
             }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ShareableNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ShareableNodeTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ShareableNodeTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/ShareableNodeTest.java Wed Jul  8 13:57:13 2009
@@ -16,9 +16,7 @@
  */
 package org.apache.jackrabbit.core;
 
-import javax.jcr.Item;
 import javax.jcr.Node;
-import javax.jcr.Session;
 import javax.jcr.Workspace;
 import javax.jcr.observation.Event;
 import javax.jcr.observation.EventIterator;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java Wed Jul  8 13:57:13 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.core;
 
+import org.apache.jackrabbit.test.ConcurrentTestSuite;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -30,7 +32,7 @@
      *         package, except the multi-threading related ones.
      */
     public static Test suite() {
-        TestSuite suite = new TestSuite("Core tests");
+        TestSuite suite = new ConcurrentTestSuite("Core tests");
 
         suite.addTestSuite(CachingHierarchyManagerTest.class);
         suite.addTestSuite(ShareableNodeTest.class);
@@ -41,6 +43,15 @@
         suite.addTestSuite(RetentionRegistryImplTest.class);
         suite.addTestSuite(InvalidDateTest.class);
         suite.addTestSuite(SessionGarbageCollectedTest.class);
+        suite.addTestSuite(ReferencesTest.class);
+
+        // test related to NodeStateMerger
+        suite.addTestSuite(ConcurrentAddRemoveMoveTest.class);
+        suite.addTestSuite(ConcurrentAddRemovePropertyTest.class);
+        suite.addTestSuite(ConcurrentMixinModificationTest.class);
+        suite.addTestSuite(ConcurrentModificationWithSNSTest.class);
+        suite.addTestSuite(ConcurrentMoveTest.class);
+        suite.addTestSuite(ConcurrentReorderTest.class);
 
         return suite;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestRepository.java Wed Jul  8 13:57:13 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core;
 
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.Map;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/XATest.java Wed Jul  8 13:57:13 2009
@@ -51,10 +51,10 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-        otherSuperuser = helper.getSuperuserSession();
+        otherSuperuser = getHelper().getSuperuserSession();
 
         // clean testroot on second workspace
-        Session s2 = helper.getSuperuserSession(workspaceName);
+        Session s2 = getHelper().getSuperuserSession(workspaceName);
         try {
             Node root = s2.getRootNode();
             if (root.hasNode(testPath)) {
@@ -129,7 +129,7 @@
         }
 
         // assertion: node does not exist in other session
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
 
         try {
             otherSuperuser.getNodeByUUID(n.getUUID());
@@ -185,7 +185,7 @@
         assertTrue(testRootNode.hasProperty(propertyName1));
 
         // assertion: property does not exist in other session
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
         Node otherRootNode = otherSuperuser.getRootNode().getNode(testPath);
         assertFalse(otherRootNode.hasProperty(propertyName1));
 
@@ -230,7 +230,7 @@
         utx.commit();
 
         // check property value
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
         Node n = (Node) otherSuperuser.getItem(testRootNode.getPath());
         assertEquals(n.getProperty(propertyName1).getString(), "1");
         otherSuperuser.logout();
@@ -338,7 +338,7 @@
         utx.commit();
 
         // check property value
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
         Node n = (Node) otherSuperuser.getItem(testRootNode.getPath());
         assertEquals(n.getProperty(propertyName1).getString(), "1");
         otherSuperuser.logout();
@@ -370,7 +370,7 @@
         utx.commit();
 
         // check property value
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
         Node n = (Node) otherSuperuser.getItem(testRootNode.getPath());
         assertFalse("Property must be deleted.", n.hasProperty(propertyName1));
         otherSuperuser.logout();
@@ -404,7 +404,7 @@
         utx.commit();
 
         // check property value
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
         Node n = (Node) otherSuperuser.getItem(testRootNode.getPath());
         assertFalse("Property must be deleted.", n.hasProperty(propertyName1));
         otherSuperuser.logout();
@@ -578,7 +578,7 @@
         testRootNode.save();
 
         // remove referenced node in other session
-        Session otherSuperuser = helper.getSuperuserSession();
+        Session otherSuperuser = getHelper().getSuperuserSession();
         Node otherRootNode = otherSuperuser.getRootNode().getNode(testPath);
         otherSuperuser.getNodeByUUID(n2.getUUID()).remove();
         otherRootNode.save();
@@ -751,7 +751,7 @@
      * @throws Exception
      */
     public void testLockCommit() throws Exception {
-        Session other = helper.getSuperuserSession();
+        Session other = getHelper().getSuperuserSession();
         try {
             // add node that is both lockable and referenceable, save
             Node n = testRootNode.addNode(nodeName1);
@@ -792,7 +792,7 @@
      * @throws Exception
      */
     public void testLockUnlockCommit() throws Exception {
-        Session other = helper.getSuperuserSession();
+        Session other = getHelper().getSuperuserSession();
         try {
             // add node that is both lockable and referenceable, save
             Node n = testRootNode.addNode(nodeName1);
@@ -835,7 +835,7 @@
      * @throws Exception
      */
     public void testLockRollback() throws Exception {
-        Session other = helper.getSuperuserSession();
+        Session other = getHelper().getSuperuserSession();
         try {
             // add node that is both lockable and referenceable, save
             Node n = testRootNode.addNode(nodeName1);
@@ -879,7 +879,7 @@
      * @throws Exception
      */
     public void testLockTwice() throws Exception {
-        Session other = helper.getSuperuserSession();
+        Session other = getHelper().getSuperuserSession();
         try {
             // add node that is both lockable and referenceable, save
             Node n = testRootNode.addNode(nodeName1);
@@ -947,27 +947,30 @@
 
         // commit
         utx.commit();
-        
+
         // Check if it is locked in other session
-        Session other = helper.getSuperuserSession();
-        Node nOther = other.getNodeByUUID(n.getUUID());        
+        Session other = getHelper().getSuperuserSession();
+        Node nOther = other.getNodeByUUID(n.getUUID());
         assertTrue(nOther.isLocked());
 
         // Check if it is also locked in other transaction
-        Session other2 = helper.getSuperuserSession();
+        Session other2 = getHelper().getSuperuserSession();
         // start new Transaction and try to add locktoken
         utx = new UserTransactionImpl(other2);
         utx.begin();
-        
-        Node nOther2 = other2.getNodeByUUID(n.getUUID());        
+
+        Node nOther2 = other2.getNodeByUUID(n.getUUID());
         assertTrue(nOther2.isLocked());
-        
+
         utx.commit();
-    
+
+        other.logout();
+        other2.logout();
+
     }
 
     /**
-     * Test add and remove lock tokens in a transaction 
+     * Test add and remove lock tokens in a transaction
      * @throws Exception
      */
     public void testAddRemoveLockToken() throws Exception {
@@ -976,18 +979,18 @@
         utx.begin();
 
         // add node that is both lockable and referenceable, save
-        Node rootNode = superuser.getRootNode(); 
+        Node rootNode = superuser.getRootNode();
         Node n = rootNode.addNode(nodeName1);
         n.addMixin(mixLockable);
         n.addMixin(mixReferenceable);
         rootNode.save();
 
         String uuid = n.getUUID();
-        
+
         // lock this new node
         Lock lock = n.lock(true, false);
         String lockToken = lock.getLockToken();
-        
+
         // assert: session must get a non-null lock token
         assertNotNull("session must get a non-null lock token", lockToken);
 
@@ -996,45 +999,49 @@
 
         superuser.removeLockToken(lockToken);
         assertNull("session must get a null lock token", lock.getLockToken());
-        
+
         // commit
         utx.commit();
-        
+
         // refresh Lock Info
         lock = n.getLock();
 
         assertNull("session must get a null lock token", lock.getLockToken());
 
-        Session other = helper.getSuperuserSession();
-        // start new Transaction and try to add lock token
-        utx = new UserTransactionImpl(other);
-        utx.begin();
-        
-        Node otherNode = other.getNodeByUUID(uuid); 
-        assertTrue("Node not locked", otherNode.isLocked());
+        Session other = getHelper().getSuperuserSession();
         try {
+            // start new Transaction and try to add lock token
+            utx = new UserTransactionImpl(other);
+            utx.begin();
+
+            Node otherNode = other.getNodeByUUID(uuid);
+            assertTrue("Node not locked", otherNode.isLocked());
+            try {
+                otherNode.setProperty(propertyName1, "foo");
+                fail("Lock exception should be thrown");
+            } catch (LockException e) {
+                // expected
+            }
+
+            // add lock token
+            other.addLockToken(lockToken);
+
+            // refresh Lock Info
+            lock = otherNode.getLock();
+
+            // assert: session must hold lock token
+            assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));
+
+            otherNode.unlock();
+
+            assertFalse("Node is locked", otherNode.isLocked());
+
             otherNode.setProperty(propertyName1, "foo");
-            fail("Lock exception should be thrown");
-        } catch (LockException e) {
-            // expected
+            other.save();
+            utx.commit();
+        } finally {
+            other.logout();
         }
-        
-        // add lock token
-        other.addLockToken(lockToken);
-        
-        // refresh Lock Info
-        lock = otherNode.getLock();
-
-        // assert: session must hold lock token
-        assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));        
-        
-        otherNode.unlock();
-        
-        assertFalse("Node is locked", otherNode.isLocked());
-        
-        otherNode.setProperty(propertyName1, "foo");
-        other.save();
-        utx.commit();
     }
 
     /**
@@ -1382,7 +1389,7 @@
      */
     public void testXAVersionsThoroughly() throws Exception {
         Session s1 = superuser;
-        Session s2 = helper.getSuperuserSession(workspaceName);
+        Session s2 = getHelper().getSuperuserSession(workspaceName);
 
         // add node and save
         Node n1 = testRootNode.addNode(nodeName1, testNodeType);
@@ -1542,7 +1549,7 @@
         s2.logout();
 
     }
-
+    
     /**
      * helper method for {@link #testXAVersionsThoroughly()}
      */
@@ -1647,7 +1654,7 @@
     public void testSetProperty() throws Exception {
         final String testNodePath = testPath + "/" + Math.random();
 
-        Session session = helper.getSuperuserSession();
+        Session session = getHelper().getSuperuserSession();
         try {
             // Add node
             doTransactional(new Operation() {
@@ -1682,7 +1689,7 @@
     public void testDeleteNode() throws Exception {
         final String testNodePath = testPath + "/" + Math.random();
 
-        Session session = helper.getSuperuserSession();
+        Session session = getHelper().getSuperuserSession();
         try {
             for (int i = 1; i <= 3; i++) {
                 // Add parent node
@@ -1742,7 +1749,7 @@
 
         utx.commit();
     }
-    
+
     /**
      * Return a flag indicating whether the indicated session contains
      * a specific lock token
@@ -1755,5 +1762,5 @@
             }
         }
         return false;
-    }    
+    }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/CopyValueTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/CopyValueTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/CopyValueTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/CopyValueTest.java Wed Jul  8 13:57:13 2009
@@ -23,7 +23,7 @@
 
 import javax.jcr.Node;
 import javax.jcr.Property;
-import javax.jcr.Session;
+import javax.jcr.ValueFactory;
 
 /**
  * Tests copying binary values from one node to another.
@@ -51,7 +51,7 @@
 
     private void doTestCopy(int length) throws Exception {
         Node root = superuser.getRootNode();
-        if(root.hasNode("testCopy")) {
+        if (root.hasNode("testCopy")) {
             root.getNode("testCopy").remove();
             superuser.save();
         }
@@ -59,10 +59,11 @@
         Node n = testRoot.addNode("a");
         superuser.save();
         byte[] data = new byte[length + 1];
-        n.setProperty("data", new ByteArrayInputStream(data));
+        ValueFactory vf = superuser.getValueFactory();
+        n.setProperty("data", vf.createBinary(new ByteArrayInputStream(data)));
         superuser.save();
         data = new byte[length];
-        n.setProperty("data", new ByteArrayInputStream(data));
+        n.setProperty("data", vf.createBinary(new ByteArrayInputStream(data)));
         Property p = testRoot.getNode("a").getProperty("data");
         assertEquals(length, p.getLength());
         superuser.getWorkspace().copy("/testCopy/a", "/testCopy/b");
@@ -81,7 +82,7 @@
     public void testRandomOperations() throws Exception {
         Random random = new Random(1);
         Node root = superuser.getRootNode();
-        if(root.hasNode("testRandom")) {
+        if (root.hasNode("testRandom")) {
             root.getNode("testRandom").remove();
             superuser.save();
         }
@@ -106,7 +107,8 @@
                         .nextGaussian())));
                 byte[] data = new byte[dataLength];
                 log(node1 + " add len:" + dataLength);
-                n.setProperty("data", new ByteArrayInputStream(data));
+                ValueFactory vf = superuser.getValueFactory();
+                n.setProperty("data", vf.createBinary(new ByteArrayInputStream(data)));
                 n.setProperty("len", dataLength);
                 break;
             }
@@ -151,7 +153,7 @@
             }
         }
         superuser.save();
-        for(int i=0; i<opCounts.length; i++) {
+        for (int i = 0; i < opCounts.length; i++) {
             log(i + ": " + opCounts[i]);
         }
         testRoot.remove();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java Wed Jul  8 13:57:13 2009
@@ -19,8 +19,6 @@
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.InputStream;
-import java.sql.DriverManager;
-import java.sql.SQLException;
 import java.util.Random;
 
 import junit.framework.TestCase;
@@ -28,6 +26,9 @@
 import org.apache.commons.io.FileUtils;
 import org.apache.jackrabbit.core.data.db.DbDataStore;
 
+/**
+ * Test the Database Data Store.
+ */
 public class DBDataStoreTest extends TestCase {
 
     private DbDataStore store = new DbDataStore();
@@ -53,13 +54,10 @@
     }
 
     protected void tearDown() {
-        store.close();
 
         try {
-            // TODO: This should automatically be done by DbDataStore.close()
-            DriverManager.getConnection(
-                    "jdbc:derby:target/test-db-datastore/db;shutdown=true");
-        } catch (SQLException expected) {
+            store.close();
+        } catch (DataStoreException expected) {
         }
     }
 
@@ -75,7 +73,7 @@
             try {
                 assertNotNull(stream);
                 for (int j = 0; j < data.length; j++) {
-                    assertEquals(((int) data[j]) & 0xff, stream.read());
+                    assertEquals((data[j]) & 0xff, stream.read());
                 }
                 assertEquals(-1, stream.read());
             } finally {
@@ -95,7 +93,7 @@
         // verify the contents of all the streams, reading them in parallel
         for (int i = 0; i < data.length; i++) {
             for (int j = 0; j < streams.length; j++) {
-                assertEquals(((int) data[i]) & 0xff, streams[j].read());
+                assertEquals((data[i]) & 0xff, streams[j].read());
             }
         }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DataStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DataStoreTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DataStoreTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DataStoreTest.java Wed Jul  8 13:57:13 2009
@@ -138,8 +138,8 @@
     }
     
     private void doTest(DataStore ds, int offset) throws Exception {
-        ArrayList list = new ArrayList();
-        HashMap map = new HashMap();
+        ArrayList<DataRecord> list = new ArrayList<DataRecord>();
+        HashMap<DataRecord, Integer> map = new HashMap<DataRecord, Integer>();
         for (int i = 0; i < 100; i++) {
             int size = 100 + i * 10;
             RandomInputStream in = new RandomInputStream(size + offset, size);
@@ -150,8 +150,8 @@
         Random random = new Random(1);
         for (int i = 0; i < list.size(); i++) {
             int pos = random.nextInt(list.size());
-            DataRecord rec = (DataRecord) list.get(pos);
-            int size = ((Integer) map.get(rec)).intValue();
+            DataRecord rec = list.get(pos);
+            int size = map.get(rec);
             rec = ds.getRecord(rec.getIdentifier());
             assertEquals(size, rec.getLength());
             InputStream in = rec.getStream();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ExportImportTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ExportImportTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ExportImportTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/ExportImportTest.java Wed Jul  8 13:57:13 2009
@@ -28,6 +28,7 @@
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.ValueFactory;
 
 /**
  * Test importing and exporting large binary and text objects.
@@ -60,7 +61,7 @@
     }
     
     private void doTestExportImportLargeText(char[] chars) throws RepositoryException {
-        Session session = helper.getReadWriteSession();
+        Session session = getHelper().getReadWriteSession();
         try {
             Node root = session.getRootNode();
             clean(root);
@@ -68,7 +69,6 @@
             session.save();
             String s = new String(chars);
             test.setProperty("text", s);
-            test.save();
             session.save();
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             session.exportSystemView("/testText", out, false, false);
@@ -111,7 +111,7 @@
     }
 
     private void doTestExportImportBinary(int len) throws RepositoryException {
-        Session session = helper.getReadWriteSession();
+        Session session = getHelper().getReadWriteSession();
         try {
             Node root = session.getRootNode();
             clean(root);
@@ -120,8 +120,8 @@
             byte[] data = new byte[len];
             Random random = new Random(1);
             random.nextBytes(data);
-            test.setProperty("data", new ByteArrayInputStream(data));
-            test.save();
+            ValueFactory vf = session.getValueFactory();
+            test.setProperty("data", vf.createBinary(new ByteArrayInputStream(data)));
             session.save();
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             session.exportSystemView("/testBinary", out, false, false);
@@ -136,8 +136,8 @@
             test2 = test2.getNode("testBinary");
             test3 = root.getNode("testBinary3");
             test3 = test3.getNode("testBinary");
-            byte[] data2 = readFromStream(test2.getProperty("data").getStream());
-            byte[] data3 = readFromStream(test3.getProperty("data").getStream());
+            byte[] data2 = readFromStream(test2.getProperty("data").getBinary().getStream());
+            byte[] data3 = readFromStream(test3.getProperty("data").getBinary().getStream());
             assertEquals(data.length, data2.length);
             assertEquals(data.length, data3.length);
             for (int i = 0; i < len; i++) {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCConcurrentTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCConcurrentTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCConcurrentTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCConcurrentTest.java Wed Jul  8 13:57:13 2009
@@ -30,6 +30,7 @@
 import javax.jcr.Property;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.ValueFactory;
 
 /**
  * Test case for concurrent garbage collection
@@ -58,7 +59,8 @@
                 gcThread.start();
             }
             Node n = node(root, "test" + i);
-            n.setProperty("data", randomInputStream(i));
+            ValueFactory vf = session.getValueFactory();
+            n.setProperty("data", vf.createBinary(randomInputStream(i)));
             session.save();
             LOG.debug("saved: " + i);
         }
@@ -66,7 +68,7 @@
         for (int i = 0; i < len; i++) {
             Node n = root.getNode("test" + i);
             Property p = n.getProperty("data");
-            InputStream in = p.getStream();
+            InputStream in = p.getBinary().getStream();
             InputStream expected = randomInputStream(i);
             checkStreams(expected, in);
             n.remove();
@@ -76,6 +78,7 @@
         Thread.sleep(10);
         gc.setStop(true);
         Thread.sleep(10);
+        gcThread.join();
         gc.throwException();
     }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCEventListenerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCEventListenerTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCEventListenerTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCEventListenerTest.java Wed Jul  8 13:57:13 2009
@@ -27,6 +27,7 @@
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.ValueFactory;
 
 /**
  * Test the DataStore garbage collector.
@@ -60,10 +61,11 @@
         Node test = root.addNode(TEST_NODE_NAME);
         Random random = new Random();
         byte[] data = new byte[10000];
-        for (int i = 0; i < 20; i++) {
+        for (int i = 0; i < 10; i++) {
             Node n = test.addNode("x" + i);
             random.nextBytes(data);
-            n.setProperty("data", new ByteArrayInputStream(data));
+            ValueFactory vf = session.getValueFactory();
+            n.setProperty("data", vf.createBinary(new ByteArrayInputStream(data)));
             session.save();
             if (i % 2 == 0) {
                 n.remove();
@@ -92,6 +94,7 @@
             int deleted = gc.deleteUnused();
             LOG.debug("Deleted " + deleted);
             assertTrue("Should delete at least one item", deleted >= 0);
+            gc.close();
         }
     }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCThread.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCThread.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCThread.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GCThread.java Wed Jul  8 13:57:13 2009
@@ -60,6 +60,7 @@
                 LOG.debug("Waiting...");
                 Thread.sleep(10);
             }
+            gc.close();
         } catch (Exception ex) {
             LOG.error("Error scanning", ex);
             exception = ex;
@@ -75,10 +76,10 @@
     }
 
     private int listIdentifiers(GarbageCollector gc) throws DataStoreException {
-        Iterator it = gc.getDataStore().getAllIdentifiers();
+        Iterator<DataIdentifier> it = gc.getDataStore().getAllIdentifiers();
         int count = 0;
         while (it.hasNext()) {
-            DataIdentifier id = (DataIdentifier) it.next();
+            DataIdentifier id = it.next();
             LOG.debug("  " + id);
             count++;
         }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java Wed Jul  8 13:57:13 2009
@@ -18,7 +18,6 @@
 
 import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -32,6 +31,7 @@
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.ValueFactory;
 
 /**
  * Test cases for data store garbage collection.
@@ -51,16 +51,18 @@
         }
         final SynchronousChannel sync = new SynchronousChannel();
         final Node node = root.addNode("slowBlob");
+        final int blobLength = 1000;
+        final ValueFactory vf = session.getValueFactory();
         new Thread() {
             public void run() {
                 try {
-                    node.setProperty("slowBlob", new InputStream() {
+                    node.setProperty("slowBlob", vf.createBinary(new InputStream() {
                         int pos;
                         public int read() throws IOException {
                             pos++;
-                            if (pos < 10000) {
+                            if (pos < blobLength) {
                                 return pos % 80 == 0 ? '\n' : '.';
-                            } else if (pos == 10000) {
+                            } else if (pos == blobLength) {
                                 try {
                                     sync.put("x");
                                     // deleted
@@ -72,7 +74,7 @@
                             }
                             return -1;
                         }
-                    });
+                    }));
                     node.getSession().save();
                     sync.put("saved");
                 } catch (Exception e) {
@@ -87,13 +89,14 @@
         gc.deleteUnused();
         sync.put("deleted");
         assertEquals("saved", sync.take());
-        InputStream in = node.getProperty("slowBlob").getStream();
-        for (int pos = 1; pos < 10000; pos++) {
+        InputStream in = node.getProperty("slowBlob").getBinary().getStream();
+        for (int pos = 1; pos < blobLength; pos++) {
             int expected = pos % 80 == 0 ? '\n' : '.';
             assertEquals(expected, in.read());
         }
         assertEquals('x', in.read());
         in.close();
+        gc.close();
     }
 
     public void testGC() throws Exception {
@@ -108,23 +111,25 @@
 
         deleteMyNodes();
         runGC(session, true);
-        runGC(session, true);
 
         root.addNode("node1");
         Node node2 = root.addNode("node2");
         Node n = node2.addNode("nodeWithBlob");
-        n.setProperty("test", new RandomInputStream(10, 10000));
+        ValueFactory vf = session.getValueFactory();
+        n.setProperty("test", vf.createBinary(new RandomInputStream(10, 1000)));
         n = node2.addNode("nodeWithTemporaryBlob");
-        n.setProperty("test", new RandomInputStream(11, 10000));
+        n.setProperty("test", vf.createBinary(new RandomInputStream(11, 1000)));
         session.save();
 
         n.remove();
         session.save();
-        Thread.sleep(1000);
 
         GarbageCollector gc = ((SessionImpl)session).createDataStoreGarbageCollector();
-        gc.setScanEventListener(this);
-        gc.setTestDelay(1000);
+
+        if (gc.getDataStore() instanceof FileDataStore) {
+            // make sure the file is old (access time resolution is 2 seconds)
+            Thread.sleep(2000);
+        }
 
         LOG.debug("scanning...");
         gc.scan();
@@ -138,26 +143,32 @@
         assertEquals(count - 1, count2);
 
         deleteMyNodes();
+
+        gc.close();
     }
 
-    private void runGC(Session session, boolean all) throws RepositoryException, IOException, ItemStateException {
+    private void runGC(Session session, boolean all) throws Exception {
         GarbageCollector gc = ((SessionImpl)session).createDataStoreGarbageCollector();
         gc.setScanEventListener(this);
-        gc.setTestDelay(1000);
+        if (gc.getDataStore() instanceof FileDataStore) {
+            // make sure the file is old (access time resolution is 2 seconds)
+            Thread.sleep(2000);
+        }
         gc.scan();
         gc.stopScan();
         if (all) {
             gc.getDataStore().clearInUse();
         }
         gc.deleteUnused();
+        gc.close();
     }
 
     private int listIdentifiers(GarbageCollector gc) throws DataStoreException {
         LOG.debug("identifiers:");
-        Iterator it = gc.getDataStore().getAllIdentifiers();
         int count = 0;
+        Iterator<DataIdentifier> it = gc.getDataStore().getAllIdentifiers();
         while (it.hasNext()) {
-            DataIdentifier id = (DataIdentifier) it.next();
+            DataIdentifier id = it.next();
             LOG.debug("  " + id);
             count++;
         }
@@ -176,23 +187,21 @@
         }
 
         deleteMyNodes();
-        runGC(session, true);
-        runGC(session, true);
 
-        Credentials cred = helper.getSuperuserCredentials();
-        Session s2 = helper.getRepository().login(cred);
+        Credentials cred = getHelper().getSuperuserCredentials();
+        Session s2 = getHelper().getRepository().login(cred);
         root = s2.getRootNode();
         Node node2 = root.addNode("node3");
         Node n = node2.addNode("nodeWithBlob");
-        n.setProperty("test", new RandomInputStream(10, 10000));
-        Thread.sleep(1000);
+        ValueFactory vf = session.getValueFactory();
+        n.setProperty("test", vf.createBinary(new RandomInputStream(10, 1000)));
 
         runGC(session, false);
 
         s2.save();
 
-        InputStream in = n.getProperty("test").getStream();
-        InputStream in2 = new RandomInputStream(10, 10000);
+        InputStream in = n.getProperty("test").getBinary().getStream();
+        InputStream in2 = new RandomInputStream(10, 1000);
         while (true) {
             int a = in.read();
             int b = in2.read();
@@ -203,6 +212,8 @@
         }
 
         deleteMyNodes();
+
+        s2.logout();
     }
 
     public void afterScanning(Node n) throws RepositoryException {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/NodeTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/NodeTypeTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/NodeTypeTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/NodeTypeTest.java Wed Jul  8 13:57:13 2009
@@ -27,9 +27,11 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 
+/**
+ * Test node types with binary default values.
+ */
 public class NodeTypeTest extends AbstractJCRTest {
 
-
     /**
      * Test a node type with a binary default value
      * @throws RepositoryException

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/OpenFilesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/OpenFilesTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/OpenFilesTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/OpenFilesTest.java Wed Jul  8 13:57:13 2009
@@ -21,6 +21,7 @@
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.ValueFactory;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 
@@ -33,10 +34,11 @@
      * Test opening a large number of streams.
      */
     public void testStreams() throws RepositoryException {
-        Session session = helper.getReadWriteSession();
+        Session session = getHelper().getReadWriteSession();
         try {
             Node test = session.getRootNode().addNode("test");
-            test.setProperty("data", new ByteArrayInputStream(new byte[10 * 1024]));
+            ValueFactory vf = session.getValueFactory();
+            test.setProperty("data", vf.createBinary(new ByteArrayInputStream(new byte[10 * 1024])));
             session.save();
             for (int i = 0; i < 10000; i++) {
                 test.getProperty("data").getValue();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java Wed Jul  8 13:57:13 2009
@@ -36,6 +36,9 @@
 import javax.jcr.Repository;
 import javax.jcr.Session;
 
+/**
+ * Test AbstractBundlePersistenceManager.getAllNodeIds
+ */
 public class PersistenceManagerIteratorTest extends AbstractJCRTest {
     /** logger instance */
     private static final Logger LOG = LoggerFactory.getLogger(PersistenceManagerIteratorTest.class);
@@ -58,20 +61,20 @@
 
         RepositoryImpl r = (RepositoryImpl) rep;
         RepositoryConfig conf = r.getConfig();
-        Collection coll = conf.getWorkspaceConfigs();
+        Collection<WorkspaceConfig> coll = conf.getWorkspaceConfigs();
         String[] names = new String[coll.size()];
-        Iterator wspIt = coll.iterator();
-        for(int i = 0; wspIt.hasNext(); i++) {
+        Iterator<WorkspaceConfig> wspIt = coll.iterator();
+        for (int i = 0; wspIt.hasNext(); i++) {
             WorkspaceConfig wsc = (WorkspaceConfig) wspIt.next();
             names[i] = wsc.getName();
         }
 
-        for (int i = 0; i < names.length; i++) {
-            Session s = helper.getSuperuserSession(names[i]);
+        for (int i = 0; i < names.length && i < 1; i++) {
+            Session s = getHelper().getSuperuserSession(names[i]);
             try {
                 Method m = r.getClass().getDeclaredMethod("getWorkspaceInfo", new Class[] { String.class });
                 m.setAccessible(true);
-                Object info = m.invoke(r, new String[] { names[i] });
+                Object info = m.invoke(r, names[i]);
                 m = info.getClass().getDeclaredMethod("getPersistenceManager", new Class[0]);
                 m.setAccessible(true);
                 PersistenceManager pm = (PersistenceManager) m.invoke(info, new Object[0]);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/RandomInputStream.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/RandomInputStream.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/RandomInputStream.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/RandomInputStream.java Wed Jul  8 13:57:13 2009
@@ -20,6 +20,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+/**
+ * An input stream that returns pseudo-random bytes.
+ */
 public class RandomInputStream extends InputStream {
 
     private static final long MUL = 0x5DEECE66DL;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestAll.java Wed Jul  8 13:57:13 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.core.data;
 
+import org.apache.jackrabbit.test.ConcurrentTestSuite;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -31,7 +33,8 @@
      * @return a test suite that executes all tests inside this package
      */
     public static Test suite() {
-        TestSuite suite = new TestSuite("Data tests");
+        TestSuite suite = new ConcurrentTestSuite("Data tests");
+        suite.addTestSuite(LazyFileInputStreamTest.class);
         suite.addTestSuite(OpenFilesTest.class);
         suite.addTestSuite(DataStoreTest.class);
         suite.addTestSuite(NodeTypeTest.class);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestTwoGetStreams.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestTwoGetStreams.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestTwoGetStreams.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/TestTwoGetStreams.java Wed Jul  8 13:57:13 2009
@@ -21,8 +21,8 @@
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-import javax.jcr.Session;
 import javax.jcr.Value;
+import javax.jcr.ValueFactory;
 
 import org.apache.jackrabbit.api.JackrabbitValue;
 import org.apache.jackrabbit.core.RepositoryImpl;
@@ -37,13 +37,13 @@
 
     private static Logger log = LoggerFactory.getLogger(TestTwoGetStreams.class);
 
-    private static final int STREAM_LENGTH = 1 * 1024 * 1024;
-    
+    private static final int STREAM_LENGTH = 256 * 1024;
+
     private boolean isDataStoreEnabled() throws RepositoryException {
         RepositoryImpl rep = (RepositoryImpl) superuser.getRepository();
         return rep.getDataStore() != null;
     }
-    
+
     /**
      * Test the JackrabbitValue.getContentIdentity feature.
      */
@@ -52,10 +52,11 @@
             log.info("testContentIdentity skipped. Data store is not used.");
             return;
         }
-        
+
         Node root = superuser.getRootNode();
-        root.setProperty("p1", new RandomInputStream(1, STREAM_LENGTH));
-        root.setProperty("p2", new RandomInputStream(1, STREAM_LENGTH));
+        ValueFactory vf = superuser.getValueFactory();
+        root.setProperty("p1", vf.createBinary(new RandomInputStream(1, STREAM_LENGTH)));
+        root.setProperty("p2", vf.createBinary(new RandomInputStream(1, STREAM_LENGTH)));
         superuser.save();
 
         Value v1 = root.getProperty("p1").getValue();
@@ -68,7 +69,7 @@
             assertNotNull(id1);
             assertEquals(id1, id2);
         }
-        
+
         // copying a value should not stream the content
         long time = System.currentTimeMillis();
         for (int i = 0; i < 100; i++) {
@@ -77,12 +78,12 @@
         }
         superuser.save();
         time = System.currentTimeMillis() - time;
-        // streaming the value again and again takes about 4.3 seconds
+        // streaming 1 MB again and again takes about 4.3 seconds
         // on my computer; copying the data identifier takes about 16 ms
-        assertTrue(time < 500);
+        assertTrue("time: " + time, time < 100);
 
     }
-    
+
     /**
      * Test reading from two concurrently opened streams.
      */
@@ -91,14 +92,15 @@
             log.info("testContentIdentity skipped. Data store is not used.");
             return;
         }
-        
+
         Node root = superuser.getRootNode();
-        root.setProperty("p1", new RandomInputStream(1, STREAM_LENGTH));
-        root.setProperty("p2", new RandomInputStream(2, STREAM_LENGTH));
+        ValueFactory vf = superuser.getValueFactory();
+        root.setProperty("p1", vf.createBinary(new RandomInputStream(1, STREAM_LENGTH)));
+        root.setProperty("p2", vf.createBinary(new RandomInputStream(2, STREAM_LENGTH)));
         superuser.save();
 
-        InputStream i1 = root.getProperty("p1").getStream();
-        InputStream i2 = root.getProperty("p2").getStream();
+        InputStream i1 = root.getProperty("p1").getBinary().getStream();
+        InputStream i2 = root.getProperty("p2").getBinary().getStream();
         assertEquals("p1", i1, new RandomInputStream(1, STREAM_LENGTH));
         assertEquals("p2", i2, new RandomInputStream(2, STREAM_LENGTH));
         try {
@@ -121,14 +123,15 @@
             log.info("testContentIdentity skipped. Data store is not used.");
             return;
         }
-        
+
         Node root = superuser.getRootNode();
-        root.setProperty("p1", new RandomInputStream(1, STREAM_LENGTH));
-        root.setProperty("p2", new RandomInputStream(1, STREAM_LENGTH));
+        ValueFactory vf = superuser.getValueFactory();
+        root.setProperty("p1", vf.createBinary(new RandomInputStream(1, STREAM_LENGTH)));
+        root.setProperty("p2", vf.createBinary(new RandomInputStream(1, STREAM_LENGTH)));
         superuser.save();
 
-        InputStream i1 = root.getProperty("p1").getStream();
-        InputStream i2 = root.getProperty("p2").getStream();
+        InputStream i1 = root.getProperty("p1").getBinary().getStream();
+        InputStream i2 = root.getProperty("p2").getBinary().getStream();
         assertEquals("Streams are different", i1, i2);
         try {
             i1.close();
@@ -151,13 +154,14 @@
             log.info("testContentIdentity skipped. Data store is not used.");
             return;
         }
-        
+
         Node root = superuser.getRootNode();
-        root.setProperty("p1", new RandomInputStream(1, STREAM_LENGTH));
+        ValueFactory vf = superuser.getValueFactory();
+        root.setProperty("p1", vf.createBinary(new RandomInputStream(1, STREAM_LENGTH)));
         superuser.save();
 
-        InputStream i1 = root.getProperty("p1").getStream();
-        InputStream i2 = root.getProperty("p1").getStream();
+        InputStream i1 = root.getProperty("p1").getBinary().getStream();
+        InputStream i2 = root.getProperty("p1").getBinary().getStream();
         assertEquals("Streams are different", i1, i2);
         try {
             i1.close();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/ConcurrentQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/ConcurrentQueryTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/ConcurrentQueryTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/ConcurrentQueryTest.java Wed Jul  8 13:57:13 2009
@@ -51,7 +51,7 @@
     protected void setUp() throws Exception {
         super.setUp();
         for (int i = 0; i < NUM_READERS; i++) {
-            readSessions.add(helper.getReadOnlySession());
+            readSessions.add(getHelper().getReadOnlySession());
         }
     }
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RepositoryFactoryImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RepositoryFactoryImplTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RepositoryFactoryImplTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RepositoryFactoryImplTest.java Wed Jul  8 13:57:13 2009
@@ -148,8 +148,8 @@
 
     //-------------------------< internal helper >------------------------------
 
-    private static void checkRepository(Repository r) throws RepositoryException {
-        r.login(helper.getSuperuserCredentials()).logout();
+    private void checkRepository(Repository r) throws RepositoryException {
+        r.login(getHelper().getSuperuserCredentials()).logout();
     }
 
     private static void setProperties() {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RestoreSameNameSiblingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RestoreSameNameSiblingTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RestoreSameNameSiblingTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/RestoreSameNameSiblingTest.java Wed Jul  8 13:57:13 2009
@@ -31,7 +31,7 @@
 public class RestoreSameNameSiblingTest extends AbstractJCRTest {
 
     public void testRestoreSNS() throws RepositoryException {
-        Session session = helper.getSuperuserSession();
+        Session session = getHelper().getSuperuserSession();
 
         // - Create a node 'a' with nodetype nt:unstructured
         // (defining it's childnodes to show OPV Version behaviour)

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java Wed Jul  8 13:57:13 2009
@@ -36,7 +36,7 @@
      * instead of AccessControlException
      */
     public void testCheckAddNodePermissionOnRoot() throws RepositoryException {
-        Session session = helper.getReadOnlySession();
+        Session session = getHelper().getReadOnlySession();
         try {
             session.checkPermission("/", "add_node");
         } catch (PathNotFoundException e) {
@@ -59,7 +59,7 @@
         SimpleCredentials credentials =
             new SimpleCredentials("admin", "admin".toCharArray());
         credentials.setAttribute("test", "attribute");
-        Session session = helper.getRepository().login(credentials);
+        Session session = getHelper().getRepository().login(credentials);
         try {
             String[] names = session.getAttributeNames();
             assertEquals(1, names.length);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/VersioningTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/VersioningTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/VersioningTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/VersioningTest.java Wed Jul  8 13:57:13 2009
@@ -37,12 +37,12 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-        Session s1 = helper.getSuperuserSession();
+        Session s1 = getHelper().getSuperuserSession();
         n1 = s1.getRootNode().addNode("VersioningTest");
         n1.addMixin(mixVersionable);
         n1.getSession().save();
 
-        Session s2 = helper.getSuperuserSession(workspaceName);
+        Session s2 = getHelper().getSuperuserSession(workspaceName);
         s2.getWorkspace().clone(
                 s1.getWorkspace().getName(), n1.getPath(),
                 "/VersioningTest", true);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/WorkspaceInitTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/WorkspaceInitTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/WorkspaceInitTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/WorkspaceInitTest.java Wed Jul  8 13:57:13 2009
@@ -23,12 +23,23 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.core.query.lucene.SlowQueryHandler;
 
 /**
  * <code>WorkspaceInitTest</code>...
  */
 public class WorkspaceInitTest extends AbstractJCRTest {
 
+    protected void setUp() throws Exception {
+        super.setUp();
+        SlowQueryHandler.setInitializationDelay(10 * 1000);
+    }
+
+    protected void tearDown() throws Exception {
+        SlowQueryHandler.setInitializationDelay(0);
+        super.tearDown();
+    }
+
     public void testIdleTime() throws Exception {
         // simply access the workspace, which will cause
         // initialization of SlowQueryHandler.
@@ -37,7 +48,7 @@
             Thread t = new Thread(new Runnable() {
                 public void run() {
                     try {
-                        helper.getSuperuserSession("workspace-init-test").logout();
+                        getHelper().getSuperuserSession("workspace-init-test").logout();
                     } catch (RepositoryException e) {
                         throw new RuntimeException(e);
                     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/journal/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/journal/TestAll.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/journal/TestAll.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/journal/TestAll.java Wed Jul  8 13:57:13 2009
@@ -38,6 +38,7 @@
         TestSuite suite = new TestSuite();
 
         suite.addTestSuite(FileJournalTest.class);
+        suite.addTestSuite(LockableFileRevisionTest.class);
 
         return suite;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/CyclicNodeTypeRegistrationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/CyclicNodeTypeRegistrationTest.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/CyclicNodeTypeRegistrationTest.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/CyclicNodeTypeRegistrationTest.java Wed Jul  8 13:57:13 2009
@@ -68,7 +68,7 @@
         //isReadOnly = true;
         super.setUp();
 
-        session = helper.getReadOnlySession();
+        session = getHelper().getReadOnlySession();
         manager = session.getWorkspace().getNodeTypeManager();
         nameFactory = NameFactoryImpl.getInstance();
 



Mime
View raw message