private void prepareForAfterCallback(String callbackName, Object testInstance, Method testMethod, @Nullable Throwable exception) { if (logger.isTraceEnabled()) { logger.trace(String.format("%s(): instance [%s], method [%s], exception [%s]", callbackName, testInstance, testMethod, exception)); } getTestContext().updateState(testInstance, testMethod, exception); }
private void prepareForBeforeCallback(String callbackName, Object testInstance, Method testMethod) { if (logger.isTraceEnabled()) { logger.trace(String.format("%s(): instance [%s], method [%s]", callbackName, testInstance, testMethod)); } getTestContext().updateState(testInstance, testMethod, null); }
logger.trace("prepareTestInstance(): instance [" + testInstance + "]"); getTestContext().updateState(testInstance, null, null);
logger.trace("afterTestClass(): class [" + testClass.getName() + "]"); getTestContext().updateState(null, null, null);
/** * 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); } } }
private void prepareForAfterCallback(String callbackName, Object testInstance, Method testMethod, @Nullable Throwable exception) { if (logger.isTraceEnabled()) { logger.trace(String.format("%s(): instance [%s], method [%s], exception [%s]", callbackName, testInstance, testMethod, exception)); } getTestContext().updateState(testInstance, testMethod, exception); }
private void prepareForBeforeCallback(String callbackName, Object testInstance, Method testMethod) { if (logger.isTraceEnabled()) { logger.trace(String.format("%s(): instance [%s], method [%s]", callbackName, testInstance, testMethod)); } getTestContext().updateState(testInstance, testMethod, null); }
logger.trace("prepareTestInstance(): instance [" + testInstance + "]"); getTestContext().updateState(testInstance, null, null);
logger.trace("prepareTestInstance(): instance [" + testInstance + "]"); getTestContext().updateState(testInstance, null, null);
logger.trace("beforeTestMethod(): instance [" + testInstance + "], method [" + testMethod + "]"); getTestContext().updateState(testInstance, testMethod, null);
"], exception [" + exception + "]"); getTestContext().updateState(testInstance, testMethod, exception);
logger.trace("beforeTestClass(): class [" + testClass.getName() + "]"); getTestContext().updateState(null, null, null);
logger.trace("afterTestClass(): class [" + testClass.getName() + "]"); getTestContext().updateState(null, null, null);
logger.trace("afterTestClass(): class [" + testClass.getName() + "]"); getTestContext().updateState(null, null, null);
/** * 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); } } }