703 if (autostopThreshold > 0)
704 addObserver(new Autostop(autostopThreshold));
705
706 TestRunner r = testSuite.createTestRunner();
707 r.setWorkDirectory(workDir);
708 r.setBackupPolicy(backupPolicy);
709 r.setEnvironment(env);
710 r.setExcludeList(excludeList);
711
712 int concurrency = params.getConcurrency();
713 concurrency = Math.max(1, Math.min(concurrency,
714 Parameters.ConcurrencyParameters.MAX_CONCURRENCY));
715 r.setConcurrency(concurrency);
716
717 r.setNotifier(notifier);
718
719 TestURLCollector testURLCollector = new TestURLCollector();
720 notifier.addObserver(testURLCollector);
721 testsStartTime = System.currentTimeMillis();
722 try {
723 ok = r.runTests(new Iterator() {
724 public boolean hasNext() {
725 return (stopping ? false : raTestIter.hasNext());
726 }
727 public Object next() {
728 TestResult tr = (TestResult) (raTestIter.next());
729 try {
730 return tr.getDescription();
731 }
732 catch (TestResult.Fault e) {
733 stopping = true;
734 throw new JavaTestError(i18n, "harness.trProb", tr.getWorkRelativePath(), e);
735 }
736 }
737 public void remove() {
738 throw new UnsupportedOperationException();
739 }
740 });
741 }
742 catch (InterruptedException e) {
743 // swallow interrupts, because we're just going to wind up the run
744 }
745 notifier.removeObserver(testURLCollector);
746
747 finishTime = System.currentTimeMillis();
748
|
703 if (autostopThreshold > 0)
704 addObserver(new Autostop(autostopThreshold));
705
706 TestRunner r = testSuite.createTestRunner();
707 r.setWorkDirectory(workDir);
708 r.setBackupPolicy(backupPolicy);
709 r.setEnvironment(env);
710 r.setExcludeList(excludeList);
711
712 int concurrency = params.getConcurrency();
713 concurrency = Math.max(1, Math.min(concurrency,
714 Parameters.ConcurrencyParameters.MAX_CONCURRENCY));
715 r.setConcurrency(concurrency);
716
717 r.setNotifier(notifier);
718
719 TestURLCollector testURLCollector = new TestURLCollector();
720 notifier.addObserver(testURLCollector);
721 testsStartTime = System.currentTimeMillis();
722 try {
723 ok = r.runTests(new Iterator<TestDescription>() {
724 public boolean hasNext() {
725 return (stopping ? false : raTestIter.hasNext());
726 }
727 public TestDescription next() {
728 TestResult tr = raTestIter.next();
729 try {
730 return tr.getDescription();
731 }
732 catch (TestResult.Fault e) {
733 stopping = true;
734 throw new JavaTestError(i18n, "harness.trProb", tr.getWorkRelativePath(), e);
735 }
736 }
737 public void remove() {
738 throw new UnsupportedOperationException();
739 }
740 });
741 }
742 catch (InterruptedException e) {
743 // swallow interrupts, because we're just going to wind up the run
744 }
745 notifier.removeObserver(testURLCollector);
746
747 finishTime = System.currentTimeMillis();
748
|