< prev index next >

src/com/sun/javatest/DefaultTestRunner.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

*** 40,50 **** * for creating threads for each test, running the <code>Script</code>, * and handling timeouts. */ public class DefaultTestRunner extends TestRunner { ! public synchronized boolean runTests(Iterator testIter) throws InterruptedException { this.testIter = testIter; Thread[] threads = new Thread[getConcurrency()]; --- 40,50 ---- * for creating threads for each test, running the <code>Script</code>, * and handling timeouts. */ public class DefaultTestRunner extends TestRunner { ! public synchronized boolean runTests(Iterator<TestDescription> testIter) throws InterruptedException { this.testIter = testIter; Thread[] threads = new Thread[getConcurrency()];
*** 99,110 **** // The thread has been interrupted stopping = true; // stop workers from starting any new tests // interrupt the worker threads ! for (Iterator iter = activeThreads.iterator() ; iter.hasNext(); ) { ! Thread t = (Thread) (iter.next()); t.interrupt(); } // while a short while (a couple of seconds) for tests to clean up // before we nuke them --- 99,109 ---- // The thread has been interrupted stopping = true; // stop workers from starting any new tests // interrupt the worker threads ! for (Thread t : activeThreads) { t.interrupt(); } // while a short while (a couple of seconds) for tests to clean up // before we nuke them
*** 139,149 **** private synchronized TestDescription nextTest() { if (stopping) return null; if (testIter.hasNext()) ! return (TestDescription) (testIter.next()); else { stopping = true; return null; } } --- 138,148 ---- private synchronized TestDescription nextTest() { if (stopping) return null; if (testIter.hasNext()) ! return (testIter.next()); else { stopping = true; return null; } }
*** 252,262 **** private static final Integer EXCEPTION = new Integer(0); private static final Integer ERROR = new Integer(1); private static final Integer THROWABLE = new Integer(2); ! private Iterator testIter; private Set<Thread> activeThreads; private boolean allPassed; private boolean stopping; private static I18NResourceBundle i18n = I18NResourceBundle.getBundleForClass(DefaultTestRunner.class); --- 251,261 ---- private static final Integer EXCEPTION = new Integer(0); private static final Integer ERROR = new Integer(1); private static final Integer THROWABLE = new Integer(2); ! private Iterator<TestDescription> testIter; private Set<Thread> activeThreads; private boolean allPassed; private boolean stopping; private static I18NResourceBundle i18n = I18NResourceBundle.getBundleForClass(DefaultTestRunner.class);
< prev index next >