private void handleBeforeException(Throwable ex, String callbackName, TestExecutionListener testExecutionListener, Object testInstance, Method testMethod) throws Exception { logException(ex, callbackName, testExecutionListener, testInstance, testMethod); ReflectionUtils.rethrowException(ex); }
logException(ex, "afterTestClass", testExecutionListener, testClass); if (afterTestClassException == null) { afterTestClassException = ex;
/** * Hook for pre-processing a test class <em>before</em> execution of any * tests within the class. Should be called prior to any framework-specific * <em>before class methods</em> (e.g., methods annotated with JUnit 4's * {@link org.junit.BeforeClass @BeforeClass}). * <p>An attempt will be made to give each registered * {@link TestExecutionListener} a chance to pre-process the test class * execution. If a listener throws an exception, however, the remaining * registered listeners will <strong>not</strong> be called. * @throws Exception if a registered TestExecutionListener throws an * exception * @since 3.0 * @see #getTestExecutionListeners() */ public void beforeTestClass() throws Exception { Class<?> testClass = getTestContext().getTestClass(); if (logger.isTraceEnabled()) { logger.trace("beforeTestClass(): class [" + testClass.getName() + "]"); } getTestContext().updateState(null, null, null); for (TestExecutionListener testExecutionListener : getTestExecutionListeners()) { try { testExecutionListener.beforeTestClass(getTestContext()); } catch (Throwable ex) { logException(ex, "beforeTestClass", testExecutionListener, testClass); ReflectionUtils.rethrowException(ex); } } }
logException(ex, callbackName, testExecutionListener, testInstance, testMethod); if (afterTestExecutionException == null) { afterTestExecutionException = ex;
logException(ex, callbackName, testExecutionListener, testInstance, testMethod); if (afterTestMethodException == null) { afterTestMethodException = ex;
private void handleBeforeException(Throwable ex, String callbackName, TestExecutionListener testExecutionListener, Object testInstance, Method testMethod) throws Exception { logException(ex, callbackName, testExecutionListener, testInstance, testMethod); ReflectionUtils.rethrowException(ex); }
logException(ex, "afterTestClass", testExecutionListener, testClass); if (afterTestClassException == null) { afterTestClassException = ex;
/** * Hook for pre-processing a test class <em>before</em> execution of any * tests within the class. Should be called prior to any framework-specific * <em>before class methods</em> (e.g., methods annotated with JUnit 4's * {@link org.junit.BeforeClass @BeforeClass}). * <p>An attempt will be made to give each registered * {@link TestExecutionListener} a chance to pre-process the test class * execution. If a listener throws an exception, however, the remaining * registered listeners will <strong>not</strong> be called. * @throws Exception if a registered TestExecutionListener throws an * exception * @since 3.0 * @see #getTestExecutionListeners() */ public void beforeTestClass() throws Exception { Class<?> testClass = getTestContext().getTestClass(); if (logger.isTraceEnabled()) { logger.trace("beforeTestClass(): class [" + testClass.getName() + "]"); } getTestContext().updateState(null, null, null); for (TestExecutionListener testExecutionListener : getTestExecutionListeners()) { try { testExecutionListener.beforeTestClass(getTestContext()); } catch (Throwable ex) { logException(ex, "beforeTestClass", testExecutionListener, testClass); ReflectionUtils.rethrowException(ex); } } }
logException(ex, callbackName, testExecutionListener, testInstance, testMethod); if (afterTestExecutionException == null) { afterTestExecutionException = ex;
logException(ex, callbackName, testExecutionListener, testInstance, testMethod); if (afterTestMethodException == null) { afterTestMethodException = ex;