1 7 package org.jboss.dtf; 8 9 import junit.framework.AssertionFailedError; 10 import junit.framework.TestCase; 11 import junit.framework.TestResult; 12 import org.jboss.logging.Logger; 13 14 import java.util.Iterator ; 15 import java.util.List ; 16 17 24 public class MultipleTestResult extends TestResult 25 { 26 private static final Logger log = Logger.getLogger(MultipleTestResult.class); 27 28 protected void run(final TestCase test) 29 { 30 if(test instanceof MultipleTestCase) 31 { 32 startTest(test); 33 34 MultipleTestCase mTest = (MultipleTestCase) test; 35 List testMethods = mTest.getTestMethods(); 36 Iterator itr = testMethods.iterator(); 37 while(itr.hasNext()) 38 { 39 try 40 { 41 String methodName = (String ) itr.next(); 42 log.debug("running test method " + methodName); 43 mTest.runBare(methodName); 44 } 45 catch(AssertionFailedError e) 46 { 47 addFailure(test, e); 48 } 49 catch(ThreadDeath e) 50 { throw e; 52 } 53 catch(Throwable e) 54 { 55 addError(test, e); 56 } 57 } 58 endTest(test); 59 60 } 61 else 62 { 63 super.run(test); 64 } 65 } 66 67 } | Popular Tags |