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

@@ -29,11 +29,11 @@ import org.springframework.expression.PropertyAccessor;
import org.springframework.expression.TypedValue;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.tests.Assume;
import org.springframework.tests.TestGroup;
import org.springframework.tests.EnabledForTestGroups;
import org.springframework.util.StopWatch;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.tests.TestGroup.PERFORMANCE;
/**
* Testing variations on map access.
@@ -99,8 +99,8 @@ public class MapAccessTests extends AbstractExpressionTests {
}
@Test
@EnabledForTestGroups(PERFORMANCE)
public void testGetValuePerformance() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
Map<String, String> map = new HashMap<>();
map.put("key", "value");
EvaluationContext context = new StandardEvaluationContext(map);

View File

@@ -22,11 +22,11 @@ import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
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.assertj.core.api.Assertions.fail;
import static org.springframework.tests.TestGroup.PERFORMANCE;
///CLOVER:OFF
@@ -35,6 +35,7 @@ import static org.assertj.core.api.Assertions.fail;
*
* @author Andy Clement
*/
@EnabledForTestGroups(PERFORMANCE)
public class PerformanceTests {
public static final int ITERATIONS = 10000;
@@ -47,8 +48,6 @@ public class PerformanceTests {
@Test
public void testPerformanceOfPropertyAccess() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
long starttime = 0;
long endtime = 0;
@@ -91,8 +90,6 @@ public class PerformanceTests {
@Test
public void testPerformanceOfMethodAccess() throws Exception {
Assume.group(TestGroup.PERFORMANCE);
long starttime = 0;
long endtime = 0;