1 54 55 package junitx.framework; 56 57 import junit.framework.Protectable; 58 import junit.framework.Test; 59 import junit.framework.TestCase; 60 import junitx.runner.engine.RunMonitor; 61 62 67 public class TestResult extends AbstractTestResult { 68 69 public TestResult(RunMonitor monitor) { 70 super(monitor); 71 } 72 73 76 public void runProtected(final Test test, Protectable p) { 77 try { 78 p.protect(); 79 if (TestCase.class.isAssignableFrom(test.getClass())) { 81 endTest(test); 82 } 83 if (m_monitor != null) { 84 m_monitor.pause(test); 85 } 86 } catch (junit.framework.AssertionFailedError e) { 87 addFailure(test, e); 88 } catch (Ignored e) { 89 if (m_monitor.treatIgnoreAsError()) { 90 addError(test, e); 91 } else { 92 ignoreTest(test); 93 } 94 } catch (ThreadDeath e) { 95 throw e; 96 } catch (Throwable e) { 97 addError(test, e); 98 } 99 } 100 101 } 102 | Popular Tags |