Skip to content

Commit e02d3f3

Browse files
committed
Requalify tests as LONG_RUNNING
Prior to this commit, some tests would belong to the PERFORMANCE `TestGroup`, while they were not testing for performance but rather performing functional tests that involve long running operations or timeouts. This commit moves those tests to the LONG_RUNNING `TestGroup`. See spring-projectsgh-24830
1 parent f89bd47 commit e02d3f3

File tree

12 files changed

+47
-47
lines changed

12 files changed

+47
-47
lines changed

integration-tests/src/test/java/org/springframework/scheduling/annotation/ScheduledAndTransactionalAnnotationIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import static org.assertj.core.api.Assertions.assertThat;
4141
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
4242
import static org.mockito.Mockito.mock;
43-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
43+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
4444

4545
/**
4646
* Integration tests cornering bug SPR-8651, which revealed that @Scheduled methods may
@@ -52,7 +52,7 @@
5252
* @since 3.1
5353
*/
5454
@SuppressWarnings("resource")
55-
@EnabledForTestGroups(PERFORMANCE)
55+
@EnabledForTestGroups(LONG_RUNNING)
5656
class ScheduledAndTransactionalAnnotationIntegrationTests {
5757

5858
@Test

spring-aop/src/test/java/org/springframework/aop/target/dynamic/RefreshableTargetSourceTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.springframework.core.testfixture.EnabledForTestGroups;
2222

2323
import static org.assertj.core.api.Assertions.assertThat;
24-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
24+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
2525

2626
/**
2727
* @author Rob Harrop
@@ -77,7 +77,7 @@ public void testWithNoRefreshCheck() throws Exception {
7777
}
7878

7979
@Test
80-
@EnabledForTestGroups(PERFORMANCE)
80+
@EnabledForTestGroups(LONG_RUNNING)
8181
public void testRefreshOverTime() throws Exception {
8282
CountingRefreshableTargetSource ts = new CountingRefreshableTargetSource(true);
8383
ts.setRefreshCheckDelay(100);

spring-aspects/src/test/java/org/springframework/scheduling/aspectj/AnnotationAsyncExecutionAspectTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
import org.springframework.util.concurrent.ListenableFuture;
3939

4040
import static org.assertj.core.api.Assertions.assertThat;
41-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
41+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
4242

4343
/**
4444
* Unit tests for {@link AnnotationAsyncExecutionAspect}.
4545
*
4646
* @author Ramnivas Laddad
4747
* @author Stephane Nicoll
4848
*/
49-
@EnabledForTestGroups(PERFORMANCE)
49+
@EnabledForTestGroups(LONG_RUNNING)
5050
public class AnnotationAsyncExecutionAspectTests {
5151

5252
private static final long WAIT_TIME = 1000; //milliseconds

spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import static org.mockito.BDDMockito.given;
4747
import static org.mockito.Mockito.mock;
4848
import static org.mockito.Mockito.verify;
49-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
49+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
5050

5151
/**
5252
* @author Juergen Hoeller
@@ -96,7 +96,7 @@ protected Scheduler createScheduler(SchedulerFactory schedulerFactory, String sc
9696
}
9797

9898
@Test
99-
@EnabledForTestGroups(PERFORMANCE)
99+
@EnabledForTestGroups(LONG_RUNNING)
100100
public void schedulerWithTaskExecutor() throws Exception {
101101
CountingTaskExecutor taskExecutor = new CountingTaskExecutor();
102102
DummyJob.count = 0;
@@ -137,7 +137,7 @@ public void jobDetailWithRunnableInsteadOfJob() {
137137
}
138138

139139
@Test
140-
@EnabledForTestGroups(PERFORMANCE)
140+
@EnabledForTestGroups(LONG_RUNNING)
141141
public void schedulerWithQuartzJobBean() throws Exception {
142142
DummyJob.param = 0;
143143
DummyJob.count = 0;
@@ -170,7 +170,7 @@ public void schedulerWithQuartzJobBean() throws Exception {
170170
}
171171

172172
@Test
173-
@EnabledForTestGroups(PERFORMANCE)
173+
@EnabledForTestGroups(LONG_RUNNING)
174174
public void schedulerWithSpringBeanJobFactory() throws Exception {
175175
DummyJob.param = 0;
176176
DummyJob.count = 0;
@@ -205,7 +205,7 @@ public void schedulerWithSpringBeanJobFactory() throws Exception {
205205
}
206206

207207
@Test
208-
@EnabledForTestGroups(PERFORMANCE)
208+
@EnabledForTestGroups(LONG_RUNNING)
209209
public void schedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored() throws Exception {
210210
DummyJob.param = 0;
211211
DummyJob.count = 0;
@@ -241,7 +241,7 @@ public void schedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored() throws
241241
}
242242

243243
@Test
244-
@EnabledForTestGroups(PERFORMANCE)
244+
@EnabledForTestGroups(LONG_RUNNING)
245245
public void schedulerWithSpringBeanJobFactoryAndQuartzJobBean() throws Exception {
246246
DummyJobBean.param = 0;
247247
DummyJobBean.count = 0;
@@ -275,7 +275,7 @@ public void schedulerWithSpringBeanJobFactoryAndQuartzJobBean() throws Exception
275275
}
276276

277277
@Test
278-
@EnabledForTestGroups(PERFORMANCE)
278+
@EnabledForTestGroups(LONG_RUNNING)
279279
public void schedulerWithSpringBeanJobFactoryAndJobSchedulingData() throws Exception {
280280
DummyJob.param = 0;
281281
DummyJob.count = 0;
@@ -316,7 +316,7 @@ public void multipleSchedulersWithQuartzProperties() throws Exception {
316316
}
317317

318318
@Test
319-
@EnabledForTestGroups(PERFORMANCE)
319+
@EnabledForTestGroups(LONG_RUNNING)
320320
public void twoAnonymousMethodInvokingJobDetailFactoryBeans() throws Exception {
321321
Thread.sleep(3000);
322322
try (ClassPathXmlApplicationContext ctx = context("multipleAnonymousMethodInvokingJobDetailFB.xml")) {
@@ -331,7 +331,7 @@ public void twoAnonymousMethodInvokingJobDetailFactoryBeans() throws Exception {
331331
}
332332

333333
@Test
334-
@EnabledForTestGroups(PERFORMANCE)
334+
@EnabledForTestGroups(LONG_RUNNING)
335335
public void schedulerAccessorBean() throws Exception {
336336
Thread.sleep(3000);
337337
try (ClassPathXmlApplicationContext ctx = context("schedulerAccessorBean.xml")) {

spring-context/src/test/java/org/springframework/context/support/DefaultLifecycleProcessorTests.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.springframework.core.testfixture.EnabledForTestGroups;
3131

3232
import static org.assertj.core.api.Assertions.assertThat;
33-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
33+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
3434

3535
/**
3636
* @author Mark Fisher
@@ -252,7 +252,7 @@ public void contextRefreshThenStopAndRestartWithMixedBeans() throws Exception {
252252
}
253253

254254
@Test
255-
@EnabledForTestGroups(PERFORMANCE)
255+
@EnabledForTestGroups(LONG_RUNNING)
256256
public void smartLifecycleGroupShutdown() throws Exception {
257257
CopyOnWriteArrayList<Lifecycle> stoppedBeans = new CopyOnWriteArrayList<>();
258258
TestSmartLifecycleBean bean1 = TestSmartLifecycleBean.forShutdownTests(1, 300, stoppedBeans);
@@ -282,7 +282,7 @@ public void smartLifecycleGroupShutdown() throws Exception {
282282
}
283283

284284
@Test
285-
@EnabledForTestGroups(PERFORMANCE)
285+
@EnabledForTestGroups(LONG_RUNNING)
286286
public void singleSmartLifecycleShutdown() throws Exception {
287287
CopyOnWriteArrayList<Lifecycle> stoppedBeans = new CopyOnWriteArrayList<>();
288288
TestSmartLifecycleBean bean = TestSmartLifecycleBean.forShutdownTests(99, 300, stoppedBeans);
@@ -389,7 +389,7 @@ public void dependencyStartedFirstEvenIfItsPhaseIsHigher() throws Exception {
389389
}
390390

391391
@Test
392-
@EnabledForTestGroups(PERFORMANCE)
392+
@EnabledForTestGroups(LONG_RUNNING)
393393
public void dependentShutdownFirstEvenIfItsPhaseIsLower() throws Exception {
394394
CopyOnWriteArrayList<Lifecycle> stoppedBeans = new CopyOnWriteArrayList<>();
395395
TestSmartLifecycleBean beanMin = TestSmartLifecycleBean.forShutdownTests(Integer.MIN_VALUE, 100, stoppedBeans);
@@ -462,7 +462,7 @@ public void dependencyStartedFirstAndIsSmartLifecycle() throws Exception {
462462
}
463463

464464
@Test
465-
@EnabledForTestGroups(PERFORMANCE)
465+
@EnabledForTestGroups(LONG_RUNNING)
466466
public void dependentShutdownFirstAndIsSmartLifecycle() throws Exception {
467467
CopyOnWriteArrayList<Lifecycle> stoppedBeans = new CopyOnWriteArrayList<>();
468468
TestSmartLifecycleBean beanMin = TestSmartLifecycleBean.forShutdownTests(Integer.MIN_VALUE, 400, stoppedBeans);
@@ -526,7 +526,7 @@ public void dependencyStartedFirstButNotSmartLifecycle() throws Exception {
526526
}
527527

528528
@Test
529-
@EnabledForTestGroups(PERFORMANCE)
529+
@EnabledForTestGroups(LONG_RUNNING)
530530
public void dependentShutdownFirstButNotSmartLifecycle() throws Exception {
531531
CopyOnWriteArrayList<Lifecycle> stoppedBeans = new CopyOnWriteArrayList<>();
532532
TestSmartLifecycleBean bean1 = TestSmartLifecycleBean.forShutdownTests(1, 200, stoppedBeans);

spring-context/src/test/java/org/springframework/scheduling/annotation/EnableSchedulingTests.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.springframework.scheduling.config.TaskManagementConfigUtils;
3636

3737
import static org.assertj.core.api.Assertions.assertThat;
38-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
38+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
3939

4040
/**
4141
* Tests use of @EnableScheduling on @Configuration classes.
@@ -58,7 +58,7 @@ public void tearDown() {
5858

5959

6060
@Test
61-
@EnabledForTestGroups(PERFORMANCE)
61+
@EnabledForTestGroups(LONG_RUNNING)
6262
public void withFixedRateTask() throws InterruptedException {
6363
ctx = new AnnotationConfigApplicationContext(FixedRateTaskConfig.class);
6464
assertThat(ctx.getBean(ScheduledTaskHolder.class).getScheduledTasks().size()).isEqualTo(2);
@@ -68,7 +68,7 @@ public void withFixedRateTask() throws InterruptedException {
6868
}
6969

7070
@Test
71-
@EnabledForTestGroups(PERFORMANCE)
71+
@EnabledForTestGroups(LONG_RUNNING)
7272
public void withSubclass() throws InterruptedException {
7373
ctx = new AnnotationConfigApplicationContext(FixedRateTaskConfigSubclass.class);
7474
assertThat(ctx.getBean(ScheduledTaskHolder.class).getScheduledTasks().size()).isEqualTo(2);
@@ -78,7 +78,7 @@ public void withSubclass() throws InterruptedException {
7878
}
7979

8080
@Test
81-
@EnabledForTestGroups(PERFORMANCE)
81+
@EnabledForTestGroups(LONG_RUNNING)
8282
public void withExplicitScheduler() throws InterruptedException {
8383
ctx = new AnnotationConfigApplicationContext(ExplicitSchedulerConfig.class);
8484
assertThat(ctx.getBean(ScheduledTaskHolder.class).getScheduledTasks().size()).isEqualTo(1);
@@ -97,7 +97,7 @@ public void withExplicitSchedulerAmbiguity_andSchedulingEnabled() {
9797
}
9898

9999
@Test
100-
@EnabledForTestGroups(PERFORMANCE)
100+
@EnabledForTestGroups(LONG_RUNNING)
101101
public void withExplicitScheduledTaskRegistrar() throws InterruptedException {
102102
ctx = new AnnotationConfigApplicationContext(ExplicitScheduledTaskRegistrarConfig.class);
103103
assertThat(ctx.getBean(ScheduledTaskHolder.class).getScheduledTasks().size()).isEqualTo(1);
@@ -119,7 +119,7 @@ public void withAmbiguousTaskSchedulers_andSingleTask() {
119119
}
120120

121121
@Test
122-
@EnabledForTestGroups(PERFORMANCE)
122+
@EnabledForTestGroups(LONG_RUNNING)
123123
public void withAmbiguousTaskSchedulers_andSingleTask_disambiguatedByScheduledTaskRegistrarBean() throws InterruptedException {
124124
ctx = new AnnotationConfigApplicationContext(
125125
SchedulingEnabled_withAmbiguousTaskSchedulers_andSingleTask_disambiguatedByScheduledTaskRegistrar.class);
@@ -129,7 +129,7 @@ public void withAmbiguousTaskSchedulers_andSingleTask_disambiguatedByScheduledTa
129129
}
130130

131131
@Test
132-
@EnabledForTestGroups(PERFORMANCE)
132+
@EnabledForTestGroups(LONG_RUNNING)
133133
public void withAmbiguousTaskSchedulers_andSingleTask_disambiguatedBySchedulerNameAttribute() throws InterruptedException {
134134
ctx = new AnnotationConfigApplicationContext(
135135
SchedulingEnabled_withAmbiguousTaskSchedulers_andSingleTask_disambiguatedBySchedulerNameAttribute.class);
@@ -139,7 +139,7 @@ public void withAmbiguousTaskSchedulers_andSingleTask_disambiguatedBySchedulerNa
139139
}
140140

141141
@Test
142-
@EnabledForTestGroups(PERFORMANCE)
142+
@EnabledForTestGroups(LONG_RUNNING)
143143
public void withTaskAddedVia_configureTasks() throws InterruptedException {
144144
ctx = new AnnotationConfigApplicationContext(SchedulingEnabled_withTaskAddedVia_configureTasks.class);
145145

@@ -148,7 +148,7 @@ public void withTaskAddedVia_configureTasks() throws InterruptedException {
148148
}
149149

150150
@Test
151-
@EnabledForTestGroups(PERFORMANCE)
151+
@EnabledForTestGroups(LONG_RUNNING)
152152
public void withTriggerTask() throws InterruptedException {
153153
ctx = new AnnotationConfigApplicationContext(TriggerTaskConfig.class);
154154

@@ -157,7 +157,7 @@ public void withTriggerTask() throws InterruptedException {
157157
}
158158

159159
@Test
160-
@EnabledForTestGroups(PERFORMANCE)
160+
@EnabledForTestGroups(LONG_RUNNING)
161161
public void withInitiallyDelayedFixedRateTask() throws InterruptedException {
162162
ctx = new AnnotationConfigApplicationContext(FixedRateTaskConfig_withInitialDelay.class);
163163

spring-context/src/test/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBeanTests.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import static org.mockito.Mockito.mock;
3333
import static org.mockito.Mockito.never;
3434
import static org.mockito.Mockito.verify;
35-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
35+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
3636

3737
/**
3838
* @author Rick Evans
@@ -84,7 +84,7 @@ protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory th
8484
}
8585

8686
@Test
87-
@EnabledForTestGroups(PERFORMANCE)
87+
@EnabledForTestGroups(LONG_RUNNING)
8888
void oneTimeExecutionIsSetUpAndFiresCorrectly() throws Exception {
8989
Runnable runnable = mock(Runnable.class);
9090

@@ -98,7 +98,7 @@ void oneTimeExecutionIsSetUpAndFiresCorrectly() throws Exception {
9898
}
9999

100100
@Test
101-
@EnabledForTestGroups(PERFORMANCE)
101+
@EnabledForTestGroups(LONG_RUNNING)
102102
void fixedRepeatedExecutionIsSetUpAndFiresCorrectly() throws Exception {
103103
Runnable runnable = mock(Runnable.class);
104104

@@ -116,7 +116,7 @@ void fixedRepeatedExecutionIsSetUpAndFiresCorrectly() throws Exception {
116116
}
117117

118118
@Test
119-
@EnabledForTestGroups(PERFORMANCE)
119+
@EnabledForTestGroups(LONG_RUNNING)
120120
void fixedRepeatedExecutionIsSetUpAndFiresCorrectlyAfterException() throws Exception {
121121
Runnable runnable = mock(Runnable.class);
122122
willThrow(new IllegalStateException()).given(runnable).run();
@@ -136,7 +136,7 @@ void fixedRepeatedExecutionIsSetUpAndFiresCorrectlyAfterException() throws Excep
136136
}
137137

138138
@Test
139-
@EnabledForTestGroups(PERFORMANCE)
139+
@EnabledForTestGroups(LONG_RUNNING)
140140
void withInitialDelayRepeatedExecutionIsSetUpAndFiresCorrectly() throws Exception {
141141
Runnable runnable = mock(Runnable.class);
142142

@@ -156,7 +156,7 @@ void withInitialDelayRepeatedExecutionIsSetUpAndFiresCorrectly() throws Exceptio
156156
}
157157

158158
@Test
159-
@EnabledForTestGroups(PERFORMANCE)
159+
@EnabledForTestGroups(LONG_RUNNING)
160160
void withInitialDelayRepeatedExecutionIsSetUpAndFiresCorrectlyAfterException() throws Exception {
161161
Runnable runnable = mock(Runnable.class);
162162
willThrow(new IllegalStateException()).given(runnable).run();

spring-context/src/test/java/org/springframework/scripting/support/ScriptFactoryPostProcessorTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
3434
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
3535
import static org.mockito.Mockito.mock;
36-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
36+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
3737

3838
/**
3939
* @author Rick Evans
4040
* @author Juergen Hoeller
4141
* @author Chris Beams
4242
*/
43-
@EnabledForTestGroups(PERFORMANCE)
43+
@EnabledForTestGroups(LONG_RUNNING)
4444
public class ScriptFactoryPostProcessorTests {
4545

4646
private static final String MESSAGE_TEXT = "Bingo";

spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import static org.mockito.Mockito.mock;
5858
import static org.mockito.Mockito.times;
5959
import static org.mockito.Mockito.verify;
60-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
60+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
6161

6262
/**
6363
* @author Juergen Hoeller
@@ -973,7 +973,7 @@ public void testTransactionWithShortTimeout() throws Exception {
973973
doTestTransactionWithTimeout(1);
974974
}
975975

976-
@EnabledForTestGroups(PERFORMANCE)
976+
@EnabledForTestGroups(LONG_RUNNING)
977977
private void doTestTransactionWithTimeout(int timeout) throws Exception {
978978
PreparedStatement ps = mock(PreparedStatement.class);
979979
given(con.getAutoCommit()).willReturn(true);

spring-jdbc/src/test/java/org/springframework/jdbc/support/JdbcTransactionManagerTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
import static org.mockito.Mockito.mock;
6464
import static org.mockito.Mockito.times;
6565
import static org.mockito.Mockito.verify;
66-
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
66+
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
6767

6868
/**
6969
* @author Juergen Hoeller
@@ -979,7 +979,7 @@ public void testTransactionWithShortTimeout() throws Exception {
979979
doTestTransactionWithTimeout(1);
980980
}
981981

982-
@EnabledForTestGroups(PERFORMANCE)
982+
@EnabledForTestGroups(LONG_RUNNING)
983983
private void doTestTransactionWithTimeout(int timeout) throws Exception {
984984
PreparedStatement ps = mock(PreparedStatement.class);
985985
given(con.getAutoCommit()).willReturn(true);

0 commit comments

Comments
 (0)