Java Code Examples for org.springframework.test.context.TestContext#publishEvent()

The following examples show how to use org.springframework.test.context.TestContext#publishEvent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish a {@link BeforeTestClassEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void beforeTestClass(TestContext testContext) {
	testContext.publishEvent(BeforeTestClassEvent::new);
}
 
Example 2
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish a {@link PrepareTestInstanceEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void prepareTestInstance(TestContext testContext) {
	testContext.publishEvent(PrepareTestInstanceEvent::new);
}
 
Example 3
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish a {@link BeforeTestMethodEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void beforeTestMethod(TestContext testContext) {
	testContext.publishEvent(BeforeTestMethodEvent::new);
}
 
Example 4
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish a {@link BeforeTestExecutionEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void beforeTestExecution(TestContext testContext) {
	testContext.publishEvent(BeforeTestExecutionEvent::new);
}
 
Example 5
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish an {@link AfterTestExecutionEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void afterTestExecution(TestContext testContext) {
	testContext.publishEvent(AfterTestExecutionEvent::new);
}
 
Example 6
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish an {@link AfterTestMethodEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void afterTestMethod(TestContext testContext) {
	testContext.publishEvent(AfterTestMethodEvent::new);
}
 
Example 7
Source File: EventPublishingTestExecutionListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Publish an {@link AfterTestClassEvent} to the {@code ApplicationContext}
 * for the supplied {@link TestContext}.
 */
@Override
public void afterTestClass(TestContext testContext) {
	testContext.publishEvent(AfterTestClassEvent::new);
}
 
Example 8
Source File: CustomTestEventTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public void beforeTestExecution(TestContext testContext) throws Exception {
	testContext.publishEvent(tc -> new CustomEvent(tc.getTestClass(), tc.getTestMethod()));
}