You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2014/08/30 10:32:14 UTC

svn commit: r1621425 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Author: jacopoc
Date: Sat Aug 30 08:32:14 2014
New Revision: 1621425

URL: http://svn.apache.org/r1621425
Log:
Misc minor enhancements to the testSequenceValueItemWithConcurrentThreads unit test.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1621425&r1=1621424&r2=1621425&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Sat Aug 30 08:32:14 2014
@@ -1100,11 +1100,11 @@ public class EntityTestSuite extends Ent
         String sequenceName = "BogusSequence" + id.toString();
         for (int i = 10000; i <= 10015; i++) {
             Long seqId = sequencer.getNextSeqId(sequenceName, 1, null);
-            assertEquals(seqId.longValue(), i);
+            assertEquals(i, seqId.longValue());
         }
         sequencer.forceBankRefresh(sequenceName, 1);
         Long seqId = sequencer.getNextSeqId(sequenceName, 1, null);
-        assertEquals(seqId.longValue(), 10020);
+        assertEquals(10020, seqId.longValue());
     }
 
     public void testSequenceValueItemWithConcurrentThreads() {
@@ -1143,7 +1143,11 @@ public class EntityTestSuite extends Ent
             Callable randomTask = Math.random() < probabilityOfRefresh ? refreshTask : getSeqIdTask;
             futures.add(ExecutionPool.GLOBAL_FORK_JOIN.submit(randomTask));
         }
+        long startTime = System.currentTimeMillis();
         ExecutionPool.getAllFutures(futures);
+        long endTime = System.currentTimeMillis();
+        long totalTime = endTime - startTime;
+        Debug.logInfo("testSequenceValueItemWithConcurrentThreads total time (ms): " + totalTime, module);
         assertFalse("Null sequence id returned", nullSeqIdReturned.get());
         assertFalse("Duplicate sequence id returned", duplicateFound.get());
     }