|
|
|
@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
private org.springframework.core.task.AsyncListenableTaskExecutor executor; |
|
|
|
private org.springframework.core.task.AsyncListenableTaskExecutor executor; |
|
|
|
|
|
|
|
|
|
|
|
protected String testName; |
|
|
|
protected String testName; |
|
|
|
@ -64,7 +64,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
this.executor = buildExecutor(); |
|
|
|
this.executor = buildExecutor(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
protected abstract org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor(); |
|
|
|
protected abstract org.springframework.core.task.AsyncListenableTaskExecutor buildExecutor(); |
|
|
|
|
|
|
|
|
|
|
|
@AfterEach |
|
|
|
@AfterEach |
|
|
|
@ -125,7 +125,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
void submitListenableRunnable() { |
|
|
|
void submitListenableRunnable() { |
|
|
|
TestTask task = new TestTask(this.testName, 1); |
|
|
|
TestTask task = new TestTask(this.testName, 1); |
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
@ -156,7 +156,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
void submitFailingListenableRunnable() { |
|
|
|
void submitFailingListenableRunnable() { |
|
|
|
TestTask task = new TestTask(this.testName, 0); |
|
|
|
TestTask task = new TestTask(this.testName, 0); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future = executor.submitListenable(task); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future = executor.submitListenable(task); |
|
|
|
@ -185,7 +185,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
void submitListenableRunnableWithGetAfterShutdown() throws Exception { |
|
|
|
void submitListenableRunnableWithGetAfterShutdown() throws Exception { |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestTask(this.testName, -1)); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestTask(this.testName, -1)); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestTask(this.testName, -1)); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestTask(this.testName, -1)); |
|
|
|
@ -260,7 +260,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
void submitListenableCallable() { |
|
|
|
void submitListenableCallable() { |
|
|
|
TestCallable task = new TestCallable(this.testName, 1); |
|
|
|
TestCallable task = new TestCallable(this.testName, 1); |
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
@ -275,7 +275,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
void submitFailingListenableCallable() { |
|
|
|
void submitFailingListenableCallable() { |
|
|
|
TestCallable task = new TestCallable(this.testName, 0); |
|
|
|
TestCallable task = new TestCallable(this.testName, 0); |
|
|
|
// Act
|
|
|
|
// Act
|
|
|
|
@ -291,7 +291,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
@SuppressWarnings("removal") |
|
|
|
void submitListenableCallableWithGetAfterShutdown() throws Exception { |
|
|
|
void submitListenableCallableWithGetAfterShutdown() throws Exception { |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestCallable(this.testName, -1)); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future1 = executor.submitListenable(new TestCallable(this.testName, -1)); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestCallable(this.testName, -1)); |
|
|
|
org.springframework.util.concurrent.ListenableFuture<?> future2 = executor.submitListenable(new TestCallable(this.testName, -1)); |
|
|
|
|