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 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.
@@ -29,10 +29,11 @@ import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.Matchers.startsWith;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.*;
/**
@@ -54,6 +55,8 @@ public class AnnotationAsyncExecutionAspectTests {
@Test
public void asyncMethodGetsRoutedAsynchronously() {
Assume.group(TestGroup.PERFORMANCE);
ClassWithoutAsyncAnnotation obj = new ClassWithoutAsyncAnnotation();
obj.incrementAsync();
executor.waitForCompletion();
@@ -84,6 +87,8 @@ public class AnnotationAsyncExecutionAspectTests {
@Test
public void voidMethodInAsyncClassGetsRoutedAsynchronously() {
Assume.group(TestGroup.PERFORMANCE);
ClassWithAsyncAnnotation obj = new ClassWithAsyncAnnotation();
obj.increment();
executor.waitForCompletion();