1 30 31 package net.sourceforge.groboutils.junit.v1; 32 33 import org.apache.log4j.Logger; 34 import junit.framework.TestCase; 35 import junit.framework.TestResult; 36 import junit.framework.AssertionFailedError; 37 import junit.framework.Assert; 38 39 40 49 public abstract class TestMonitorRunnable extends TestRunnable 50 { 51 public TestMonitorRunnable() 52 { 53 super( true ); 54 } 55 56 57 58 68 public abstract void runMonitor() throws Throwable ; 69 70 71 76 public void runTest() throws Throwable 77 { 78 while (!isDone() && !Thread.interrupted()) 79 { 80 runMonitor(); 81 yieldProcessing(); 82 } 83 84 runMonitor(); 86 } 87 88 89 100 protected void yieldProcessing() throws InterruptedException 101 { 102 Thread.yield(); 103 } 104 } 105 106 | Popular Tags |