db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r545873 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang: LangHarnessJavaTest.java deadlockMode.java
Date Sun, 10 Jun 2007 12:43:19 GMT
Author: kahatlen
Date: Sun Jun 10 05:43:18 2007
New Revision: 545873

URL: http://svn.apache.org/viewvc?view=rev&rev=545873
Log:
DERBY-2799: Intermittent failure in lang/deadlockMode.java

Fixed problem with ordering of the output. Also added main method to
LangHarnessJavaTest to allow easier testing of a single harness test.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/deadlockMode.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java?view=diff&rev=545873&r1=545872&r2=545873
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangHarnessJavaTest.java
Sun Jun 10 05:43:18 2007
@@ -97,6 +97,16 @@
     protected String getArea() {
         return "lang";
     }
+
+    /**
+     * Run a set of language tests (.java files).
+     *
+     * @param args names of the tests to run (the .java suffix should not be
+     * included in the name of a test)
+     */
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(baseSuite("main()", args));
+    }
     
     public static Test suite()
     {

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/deadlockMode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/deadlockMode.java?view=diff&rev=545873&r1=545872&r2=545873
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/deadlockMode.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/deadlockMode.java
Sun Jun 10 05:43:18 2007
@@ -50,6 +50,7 @@
 	private static boolean passed = false;
 	private Object syncObject = new Object();
 	private int doneCount;
+	private int startedCount;
 	private deadlockMode() {}
 
 	public static void main(String[] args) {
@@ -133,6 +134,16 @@
 			// make the initial connection.
 			conn = ij.startJBMS();
 			System.out.println("Starting thread");
+
+			// Don't start until all threads are up and running. Otherwise, the
+			// output may come out in the wrong order (DERBY-2799).
+			synchronized (syncObject) {
+				startedCount++;
+				syncObject.notifyAll();
+				while (startedCount < THREAD_COUNT) {
+					syncObject.wait();
+				}
+			}
 
 			Statement stmt = conn.createStatement();
 			// execute a query to load cache



Mime
View raw message