/** * Runs a test and collects its result in a TestResult instance. */ public void run(final TestResult result) { try { setUp(); } catch (final Exception e) { e.printStackTrace(); final Test test = new TestSetup(); result.addError(test, e); return; } for (final Method testMethod : testMethods) { run(result, testMethod); } try { tearDown(); } catch (final Exception e) { e.printStackTrace(); final Test test = new TestTearDown(); result.addError(test, e); } }
/** * Runs a test and collects its result in a TestResult instance. */ public void run(TestResult result) { try{ setUp(); } catch (Exception e){ e.printStackTrace(); Test test = new TestSetup(); result.addError(test, e); return; } for (int i=0; i < testMethods.length; i++){ run(result, testMethods[i]); } try{ tearDown(); } catch (Exception e){ e.printStackTrace(); Test test = new TestTearDown(); result.addError(test, e); return; } }