Segregate add'l long-running and performance tests

- Add TestGroup#LONG_RUNNING to distinguish from #PERFORMANCE, the
   former being tests that simply take a long time vs the latter being
   tests that are actually dependent on certain actions happening within
   a given time window and are thefore CPU-dependent.

Issue: SPR-9984
This commit is contained in:
Chris Beams
2013-01-03 12:14:17 +01:00
parent acd86a1fd7
commit 68e3b7773c
19 changed files with 217 additions and 58 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2012 the original author or authors.
* Copyright 2010-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +20,13 @@ import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import net.sf.ehcache.config.CacheConfiguration;
import org.junit.Before;
import org.junit.Test;
import org.springframework.cache.Cache;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import static org.junit.Assert.*;
@@ -95,6 +98,7 @@ public class EhCacheCacheTests {
@Test
public void testExpiredElements() throws Exception {
Assume.group(TestGroup.LONG_RUNNING);
String key = "brancusi";
String value = "constantin";
Element brancusi = new Element(key, value);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ import java.util.Map;
import javax.sql.DataSource;
import org.junit.Ignore;
import org.junit.Test;
import org.quartz.CronTrigger;
import org.quartz.Job;
@@ -382,15 +383,19 @@ public class QuartzSupportTests {
verify(scheduler).shutdown(false);
}
/*public void testMethodInvocationWithConcurrency() throws Exception {
@Ignore @Test
public void testMethodInvocationWithConcurrency() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
methodInvokingConcurrency(true);
}*/
}
// We can't test both since Quartz somehow seems to keep things in memory
// enable both and one of them will fail (order doesn't matter).
/*public void testMethodInvocationWithoutConcurrency() throws Exception {
@Ignore @Test
public void testMethodInvocationWithoutConcurrency() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
methodInvokingConcurrency(false);
}*/
}
private void methodInvokingConcurrency(boolean concurrent) throws Exception {
// Test the concurrency flag.
@@ -637,6 +642,8 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithTaskExecutor() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
CountingTaskExecutor taskExecutor = new CountingTaskExecutor();
DummyJob.count = 0;
@@ -668,6 +675,8 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithRunnable() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyRunnable.count = 0;
JobDetail jobDetail = new JobDetailBean();
@@ -696,6 +705,8 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithQuartzJobBean() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -727,6 +738,8 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithSpringBeanJobFactory() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -760,6 +773,7 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithSpringBeanJobFactoryAndParamMismatchNotIgnored() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -794,6 +808,8 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithSpringBeanJobFactoryAndRunnable() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyRunnable.param = 0;
DummyRunnable.count = 0;
@@ -826,6 +842,7 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithSpringBeanJobFactoryAndQuartzJobBean() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJobBean.param = 0;
DummyJobBean.count = 0;
@@ -858,6 +875,7 @@ public class QuartzSupportTests {
@Test
public void testSchedulerWithSpringBeanJobFactoryAndJobSchedulingData() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
DummyJob.param = 0;
DummyJob.count = 0;
@@ -896,6 +914,7 @@ public class QuartzSupportTests {
@Test
public void testWithTwoAnonymousMethodInvokingJobDetailFactoryBeans() throws InterruptedException {
Assume.group(TestGroup.PERFORMANCE);
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext("/org/springframework/scheduling/quartz/multipleAnonymousMethodInvokingJobDetailFB.xml");
Thread.sleep(3000);
@@ -915,6 +934,7 @@ public class QuartzSupportTests {
@Test
public void testSchedulerAccessorBean() throws InterruptedException {
Assume.group(TestGroup.PERFORMANCE);
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext("/org/springframework/scheduling/quartz/schedulerAccessorBean.xml");
Thread.sleep(3000);