jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1773332 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java
Date Fri, 09 Dec 2016 08:01:02 GMT
Author: reschke
Date: Fri Dec  9 08:01:01 2016
New Revision: 1773332

URL: http://svn.apache.org/viewvc?rev=1773332&view=rev
Log:
JCR-4078: occasional test failure in GarbageCollectorTest.testSimulatenousRunGC

whitespace, typos, slightly improved diagnostics

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java?rev=1773332&r1=1773331&r2=1773332&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/GarbageCollectorTest.java
Fri Dec  9 08:01:01 2016
@@ -184,12 +184,12 @@ public class GarbageCollectorTest extend
 
         gc.close();
     }
-    
+
     /**
-     *  Test to validate that two  GC cannot run simulatenously. one 
-     *  exits throwing exception  
+     *  Test to validate that two  GC cannot run simultaneously. One 
+     *  exits throwing exception.
      */
-    public void testSimulatenousRunGC() throws Exception {
+    public void testSimultaneousRunGC() throws Exception {
         Node root = testRootNode;
         Session session = root.getSession();
 
@@ -197,21 +197,26 @@ public class GarbageCollectorTest extend
         GCThread gct2 = new GCThread(session);
         Thread gcThread1 = new Thread(gct1, "Datastore Garbage Collector 1");
         Thread gcThread2 = new Thread(gct2, "Datastore Garbage Collector 2");
-        // run simulatensou gc
+        // run simultaneous GC
         gcThread1.start();
         gcThread2.start();
         Thread.sleep(100);
-        
+
         gct1.setStop(true);
         gct2.setStop(true);
-        
+
         // allow them to complete
         gcThread1.join();
         gcThread2.join();
 
         // only one should throw error
         int count = (gct1.getException() == null ? 0 : 1) + (gct2.getException() == null
? 0 : 1);
-        assertEquals("only one gc should throw exception ", 1, count);
+        if (count == 0) {
+            fail("None of the GCs threw an exception");
+        }
+        else {
+            assertEquals("Only one gc should throw an exception ", 1, count);
+        }
     }
 
     private void runGC(Session session, boolean all) throws Exception {



Mime
View raw message