diff --git a/spring-core/src/test/java/org/springframework/tests/Assume.java b/spring-core/src/test/java/org/springframework/tests/Assume.java index e7923851a5..2b629eaf8a 100644 --- a/spring-core/src/test/java/org/springframework/tests/Assume.java +++ b/spring-core/src/test/java/org/springframework/tests/Assume.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -21,7 +21,6 @@ import java.lang.reflect.Method; import java.util.Set; import org.apache.commons.logging.Log; - import org.junit.AssumptionViolatedException; import org.springframework.util.ClassUtils; @@ -33,38 +32,8 @@ import static org.junit.Assume.*; * conditions hold {@code true}. If the assumption fails, it means the test should be * skipped. * - *
For example, if a set of tests require at least JDK 1.7 it can use - * {@code Assume#atLeast(JavaVersion.JAVA_17)} as shown below: - * - *
- * public void MyTests {
- *
- * @BeforeClass
- * public static void assumptions() {
- * Assume.atLeast(JavaVersion.JAVA_17);
- * }
- *
- * // ... all the test methods that require at least JDK 1.7
- * }
- *
- *
- * If only a single test requires at least JDK 1.7 it can use the
- * {@code Assume#atLeast(JavaVersion.JAVA_17)} as shown below:
- *
- *
- * public void MyTests {
- *
- * @Test
- * public void requiresJdk17 {
- * Assume.atLeast(JavaVersion.JAVA_17);
- * // ... perform the actual test
- * }
- * }
- *
- *
- * In addition to assumptions based on the JDK version, tests can be categorized into
- * {@link TestGroup}s. Active groups are enabled using the 'testGroups' system property,
- * usually activated from the gradle command line:
+ * Tests can be categorized into {@link TestGroup}s. Active groups are enabled using
+ * the 'testGroups' system property, usually activated from the gradle command line:
* * gradle test -PtestGroups="performance" *@@ -76,7 +45,6 @@ import static org.junit.Assume.*; * @author Phillip Webb * @author Sam Brannen * @since 3.2 - * @see #atLeast(JavaVersion) * @see #group(TestGroup) * @see #group(TestGroup, Executable) */ @@ -92,8 +60,8 @@ public abstract class Assume { */ public static void atLeast(JavaVersion version) { if (!JavaVersion.runningVersion().isAtLeast(version)) { - throw new AssumptionViolatedException("Requires JDK " + version + " but running " - + JavaVersion.runningVersion()); + throw new AssumptionViolatedException("Requires JDK " + version + " but running " + + JavaVersion.runningVersion()); } } @@ -104,8 +72,7 @@ public abstract class Assume { */ public static void group(TestGroup group) { if (!GROUPS.contains(group)) { - throw new AssumptionViolatedException("Requires unspecified group " + group - + " from " + GROUPS); + throw new AssumptionViolatedException("Requires unspecified group " + group + " from " + GROUPS); } } @@ -154,11 +121,12 @@ public abstract class Assume { } } + /** * @since 4.2 */ - @FunctionalInterface - public static interface Executable { + public interface Executable { + void execute() throws Exception; } diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java index 6888d46f03..3c22b2ec56 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 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. @@ -17,6 +17,7 @@ package org.springframework.transaction.interceptor; import java.lang.reflect.Method; +import java.util.Map; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; @@ -85,7 +86,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init new NamedThreadLocal