|
|
|
|
@ -16,6 +16,8 @@
@@ -16,6 +16,8 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.scheduling.annotation; |
|
|
|
|
|
|
|
|
|
import java.lang.annotation.Retention; |
|
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
import java.util.concurrent.Future; |
|
|
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
|
@ -200,7 +202,7 @@ public class AsyncExecutionTests {
@@ -200,7 +202,7 @@ public class AsyncExecutionTests {
|
|
|
|
|
assertTrue(Thread.currentThread().getName().startsWith("e1-")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Async("e2") |
|
|
|
|
@MyAsync |
|
|
|
|
public Future<String> returnSomething(int i) { |
|
|
|
|
assertTrue(!Thread.currentThread().getName().equals(originalThreadName)); |
|
|
|
|
assertTrue(Thread.currentThread().getName().startsWith("e2-")); |
|
|
|
|
@ -215,6 +217,12 @@ public class AsyncExecutionTests {
@@ -215,6 +217,12 @@ public class AsyncExecutionTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Async("e2") |
|
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
|
public @interface MyAsync { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Async |
|
|
|
|
public static class AsyncClassBean { |
|
|
|
|
|
|
|
|
|
|