Fix tests
See gh-18490
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 the original author or authors.
|
* Copyright 2002-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -24,6 +24,7 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.core.annotation.AnnotationConfigurationException;
|
import org.springframework.core.annotation.AnnotationConfigurationException;
|
||||||
|
import org.springframework.test.context.event.EventPublishingTestExecutionListener;
|
||||||
import org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener;
|
import org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener;
|
||||||
import org.springframework.test.context.support.AbstractTestExecutionListener;
|
import org.springframework.test.context.support.AbstractTestExecutionListener;
|
||||||
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
|
||||||
@@ -54,7 +55,7 @@ public class TestExecutionListenersTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void defaultListeners() {
|
public void defaultListeners() {
|
||||||
List<Class<?>> expected = asList(ServletTestExecutionListener.class,
|
List<Class<?>> expected = asList(EventPublishingTestExecutionListener.class, ServletTestExecutionListener.class,
|
||||||
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
||||||
DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class,
|
DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class,
|
||||||
SqlScriptsTestExecutionListener.class);
|
SqlScriptsTestExecutionListener.class);
|
||||||
@@ -66,10 +67,10 @@ public class TestExecutionListenersTests {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void defaultListenersMergedWithCustomListenerPrepended() {
|
public void defaultListenersMergedWithCustomListenerPrepended() {
|
||||||
List<Class<?>> expected = asList(QuuxTestExecutionListener.class, ServletTestExecutionListener.class,
|
List<Class<?>> expected = asList(QuuxTestExecutionListener.class, EventPublishingTestExecutionListener.class,
|
||||||
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
ServletTestExecutionListener.class, DirtiesContextBeforeModesTestExecutionListener.class,
|
||||||
DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class,
|
DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class,
|
||||||
SqlScriptsTestExecutionListener.class);
|
TransactionalTestExecutionListener.class, SqlScriptsTestExecutionListener.class);
|
||||||
assertRegisteredListeners(MergedDefaultListenersWithCustomListenerPrependedTestCase.class, expected);
|
assertRegisteredListeners(MergedDefaultListenersWithCustomListenerPrependedTestCase.class, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ public class TestExecutionListenersTests {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void defaultListenersMergedWithCustomListenerAppended() {
|
public void defaultListenersMergedWithCustomListenerAppended() {
|
||||||
List<Class<?>> expected = asList(ServletTestExecutionListener.class,
|
List<Class<?>> expected = asList(EventPublishingTestExecutionListener.class, ServletTestExecutionListener.class,
|
||||||
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
||||||
DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class,
|
DirtiesContextTestExecutionListener.class, TransactionalTestExecutionListener.class,
|
||||||
SqlScriptsTestExecutionListener.class, BazTestExecutionListener.class);
|
SqlScriptsTestExecutionListener.class, BazTestExecutionListener.class);
|
||||||
@@ -90,7 +91,7 @@ public class TestExecutionListenersTests {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void defaultListenersMergedWithCustomListenerInserted() {
|
public void defaultListenersMergedWithCustomListenerInserted() {
|
||||||
List<Class<?>> expected = asList(ServletTestExecutionListener.class,
|
List<Class<?>> expected = asList(EventPublishingTestExecutionListener.class, ServletTestExecutionListener.class,
|
||||||
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
DirtiesContextBeforeModesTestExecutionListener.class, DependencyInjectionTestExecutionListener.class,
|
||||||
BarTestExecutionListener.class, DirtiesContextTestExecutionListener.class,
|
BarTestExecutionListener.class, DirtiesContextTestExecutionListener.class,
|
||||||
TransactionalTestExecutionListener.class, SqlScriptsTestExecutionListener.class);
|
TransactionalTestExecutionListener.class, SqlScriptsTestExecutionListener.class);
|
||||||
@@ -118,7 +119,7 @@ public class TestExecutionListenersTests {
|
|||||||
@Test
|
@Test
|
||||||
public void customListenersDeclaredOnInterface() {
|
public void customListenersDeclaredOnInterface() {
|
||||||
assertRegisteredListeners(ExplicitListenersOnTestInterfaceTestCase.class,
|
assertRegisteredListeners(ExplicitListenersOnTestInterfaceTestCase.class,
|
||||||
asList(FooTestExecutionListener.class, BarTestExecutionListener.class));
|
asList(FooTestExecutionListener.class, BarTestExecutionListener.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -235,7 +236,7 @@ public class TestExecutionListenersTests {
|
|||||||
static class NonInheritedListenersTestCase extends InheritedListenersTestCase {
|
static class NonInheritedListenersTestCase extends InheritedListenersTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestExecutionListeners({ FooTestExecutionListener.class, BarTestExecutionListener.class })
|
@TestExecutionListeners({FooTestExecutionListener.class, BarTestExecutionListener.class})
|
||||||
interface ExplicitListenersTestInterface {
|
interface ExplicitListenersTestInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user