[logback-dev] svn commit: r2287 - logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic133

noreply.ceki at qos.ch noreply.ceki at qos.ch
Sat Jun 13 17:34:07 CEST 2009


Author: ceki
Date: Sat Jun 13 17:34:06 2009
New Revision: 2287

Modified:
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic133/DeadlockTest.java

Log:
LBCLASSIC-133  We don't need to unit test test. A standalone app, is just as good if not simpler to run.

Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic133/DeadlockTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic133/DeadlockTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/issue/lbclassic133/DeadlockTest.java	Sat Jun 13 17:34:06 2009
@@ -2,28 +2,31 @@
 
 import static org.junit.Assert.assertFalse;
 
-import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class DeadlockTest {
   private static Logger s_logger = LoggerFactory.getLogger(DeadlockTest.class);
 
-  @Test
-  public void deadlockTest() throws Exception {
+  public static void main(String[] args) throws Exception {
     s_logger.debug("Starting test.");
 
     final Worker worker = new Worker();
     final Thread workerThread = new Thread(new Runnable() {
       public void run() {
-        worker.work();
+        while (true) {
+          worker.work();
+        }
       }
     });
     workerThread.setName("WorkerThread");
 
     final Thread accessorThread = new Thread(new Runnable() {
       public void run() {
-        new Accessor().access(worker);
+        Accessor a = new Accessor();
+        while (true) {
+          a.access(worker);
+        }
       }
     });
     accessorThread.setName("AccessorThread");
@@ -31,7 +34,7 @@
     workerThread.start();
     accessorThread.start();
 
-    workerThread.join(5 * 1000);
+    workerThread.join(50 * 1000);
     assertFalse("Worker thread seems locked.", workerThread.isAlive());
   }
 }


More information about the logback-dev mailing list