Introduce @EnabledForTestGroups in Spring's test suite

Closes gh-23476
This commit is contained in:
Sam Brannen
2019-08-17 14:27:35 +02:00
parent bbe33832cf
commit 288461a541
33 changed files with 244 additions and 181 deletions

View File

@@ -26,10 +26,10 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.cache.AbstractCacheTests;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.tests.EnabledForTestGroups;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.tests.TestGroup.LONG_RUNNING;
/**
* @author Costin Leau
@@ -73,9 +73,8 @@ public class EhCacheCacheTests extends AbstractCacheTests<EhCacheCache> {
@Test
@EnabledForTestGroups(LONG_RUNNING)
public void testExpiredElements() throws Exception {
Assume.group(TestGroup.LONG_RUNNING);
String key = "brancusi";
String value = "constantin";
Element brancusi = new Element(key, value);

View File

@@ -37,8 +37,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.core.task.TaskExecutor;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.tests.sample.beans.TestBean;
import static org.assertj.core.api.Assertions.assertThat;
@@ -46,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.springframework.tests.TestGroup.PERFORMANCE;
/**
* @author Juergen Hoeller
@@ -95,9 +95,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerWithTaskExecutor() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
CountingTaskExecutor taskExecutor = new CountingTaskExecutor();
DummyJob.count = 0;
@@ -137,9 +136,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerWithQuartzJobBean() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -171,9 +169,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerWithSpringBeanJobFactory() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -207,9 +204,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -244,8 +240,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerWithSpringBeanJobFactoryAndQuartzJobBean() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJobBean.param = 0;
DummyJobBean.count = 0;
@@ -278,8 +274,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerWithSpringBeanJobFactoryAndJobSchedulingData() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -327,8 +323,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void twoAnonymousMethodInvokingJobDetailFactoryBeans() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
ClassPathXmlApplicationContext ctx = context("multipleAnonymousMethodInvokingJobDetailFB.xml");
Thread.sleep(3000);
try {
@@ -346,8 +342,8 @@ public class QuartzSupportTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void schedulerAccessorBean() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
ClassPathXmlApplicationContext ctx = context("schedulerAccessorBean.xml");
Thread.sleep(3000);
try {
@@ -401,8 +397,6 @@ public class QuartzSupportTests {
*/
@Test
public void schedulerWithHsqlDataSource() throws Exception {
// Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;