You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/04/29 13:12:56 UTC
svn commit: r1590951 - in /tomee/tomee/trunk/examples/async-methods:
README.md src/test/java/org/superbiz/async/JobProcessorTest.java
Author: andygumbrecht
Date: Tue Apr 29 11:12:56 2014
New Revision: 1590951
URL: http://svn.apache.org/r1590951
Log:
Description
Modified:
tomee/tomee/trunk/examples/async-methods/README.md
tomee/tomee/trunk/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
Modified: tomee/tomee/trunk/examples/async-methods/README.md
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/async-methods/README.md?rev=1590951&r1=1590950&r2=1590951&view=diff
==============================================================================
--- tomee/tomee/trunk/examples/async-methods/README.md (original)
+++ tomee/tomee/trunk/examples/async-methods/README.md Tue Apr 29 11:12:56 2014
@@ -80,8 +80,10 @@ It waits for the processing to complete
final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
// Execution should be around 9 - 21 seconds
- assertTrue("" + total, total > 9);
- assertTrue("" + total, total < 21);
+ // The execution time depends on the number of threads available for asynchronous execution.
+ // In the best case it is 10s plus some minimal processing time.
+ assertTrue("Expected > 9 but was: " + total, total > 9);
+ assertTrue("Expected < 21 but was: " + total, total < 21);
}
}
Modified: tomee/tomee/trunk/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java?rev=1590951&r1=1590950&r2=1590951&view=diff
==============================================================================
--- tomee/tomee/trunk/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java (original)
+++ tomee/tomee/trunk/examples/async-methods/src/test/java/org/superbiz/async/JobProcessorTest.java Tue Apr 29 11:12:56 2014
@@ -56,8 +56,10 @@ public class JobProcessorTest extends Te
final long total = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start);
// Execution should be around 9 - 21 seconds
- assertTrue("" + total, total > 9);
- assertTrue("" + total, total < 21);
+ // The execution time depends on the number of threads available for asynchronous execution.
+ // In the best case it is 10s plus some minimal processing time.
+ assertTrue("Expected > 9 but was: " + total, total > 9);
+ assertTrue("Expected < 21 but was: " + total, total < 21);
}