db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r922445 - /db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/api/QueryCancel.java
Date Fri, 12 Mar 2010 22:48:58 GMT
Author: mbo
Date: Fri Mar 12 22:48:58 2010
New Revision: 922445

URL: http://svn.apache.org/viewvc?rev=922445&view=rev
Log:
JDO-623: Add Thread.sleep to main thread 

Modified:
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/api/QueryCancel.java

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/api/QueryCancel.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/api/QueryCancel.java?rev=922445&r1=922444&r2=922445&view=diff
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/api/QueryCancel.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/query/api/QueryCancel.java Fri Mar 12 22:48:58
2010
@@ -49,6 +49,9 @@ supporting cancel) then JDOUnsupportedOp
 
 public class QueryCancel extends QueryTest {
 
+    /** Time for the main thread to sleep after starting a parallel thread. */
+    private static int MAIN_SLEEP_MILLIS = 1000;
+
     /** */
     private static final String ASSERTION_FAILED = 
         "Assertion A14.6.1-8 (QueryCancel) failed: ";
@@ -82,6 +85,9 @@ public class QueryCancel extends QueryTe
         Thread t = new Thread(group, runnable, "Query Executor");
         t.start();
 
+        // Wait for a second such that the other thread can execute the query
+        Thread.sleep(MAIN_SLEEP_MILLIS);
+
         try {
             // cancel query 
             query.cancel(t);
@@ -121,6 +127,9 @@ public class QueryCancel extends QueryTe
         Thread t = new Thread(group, runnable, "Query Executor");
         t.start();
 
+        // Wait for a second such that the other thread can execute the query
+        Thread.sleep(MAIN_SLEEP_MILLIS);
+
         try {
             // cancel query 
             query.cancelAll();



Mime
View raw message