|
|
|
@ -89,7 +89,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
executor.execute(task); |
|
|
|
executor.execute(task); |
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> task.exception.get() != null && task.exception.get().getMessage().equals( |
|
|
|
.until(() -> task.exception.get() != null && task.exception.get().getMessage().equals( |
|
|
|
"TestTask failure for test 'executeFailingRunnable': expectedRunCount:<0>, actualRunCount:<1>")); |
|
|
|
"TestTask failure for test 'executeFailingRunnable': expectedRunCount:<0>, actualRunCount:<1>")); |
|
|
|
@ -133,7 +133,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
future.addCallback(result -> outcome = result, ex -> outcome = ex); |
|
|
|
future.addCallback(result -> outcome = result, ex -> outcome = ex); |
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(future::isDone); |
|
|
|
.until(future::isDone); |
|
|
|
assertThat(outcome).isNull(); |
|
|
|
assertThat(outcome).isNull(); |
|
|
|
@ -148,7 +148,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
future.whenComplete(this::storeOutcome); |
|
|
|
future.whenComplete(this::storeOutcome); |
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(future::isDone); |
|
|
|
.until(future::isDone); |
|
|
|
assertThat(outcome).isNull(); |
|
|
|
assertThat(outcome).isNull(); |
|
|
|
@ -164,7 +164,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
assertThat(outcome.getClass()).isSameAs(RuntimeException.class); |
|
|
|
assertThat(outcome.getClass()).isSameAs(RuntimeException.class); |
|
|
|
@ -178,7 +178,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
|
|
|
|
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
assertThat(outcome.getClass()).isSameAs(CompletionException.class); |
|
|
|
assertThat(outcome.getClass()).isSameAs(CompletionException.class); |
|
|
|
@ -198,7 +198,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
// ignore
|
|
|
|
// ignore
|
|
|
|
} |
|
|
|
} |
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(4, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.untilAsserted(() -> assertThatExceptionOfType(CancellationException.class) |
|
|
|
.untilAsserted(() -> assertThatExceptionOfType(CancellationException.class) |
|
|
|
.isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS))); |
|
|
|
.isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS))); |
|
|
|
@ -217,7 +217,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
// ignore
|
|
|
|
// ignore
|
|
|
|
} |
|
|
|
} |
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(4, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.untilAsserted(() -> assertThatExceptionOfType(TimeoutException.class) |
|
|
|
.untilAsserted(() -> assertThatExceptionOfType(TimeoutException.class) |
|
|
|
.isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS))); |
|
|
|
.isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS))); |
|
|
|
@ -253,7 +253,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
// ignore
|
|
|
|
// ignore
|
|
|
|
} |
|
|
|
} |
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(4, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.untilAsserted(() -> assertThatExceptionOfType(CancellationException.class) |
|
|
|
.untilAsserted(() -> assertThatExceptionOfType(CancellationException.class) |
|
|
|
.isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS))); |
|
|
|
.isThrownBy(() -> future2.get(1000, TimeUnit.MILLISECONDS))); |
|
|
|
@ -268,7 +268,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
future.addCallback(result -> outcome = result, ex -> outcome = ex); |
|
|
|
future.addCallback(result -> outcome = result, ex -> outcome = ex); |
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
assertThat(outcome.toString().substring(0, this.threadNamePrefix.length())).isEqualTo(this.threadNamePrefix); |
|
|
|
assertThat(outcome.toString().substring(0, this.threadNamePrefix.length())).isEqualTo(this.threadNamePrefix); |
|
|
|
@ -284,7 +284,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
assertThat(outcome.getClass()).isSameAs(RuntimeException.class); |
|
|
|
assertThat(outcome.getClass()).isSameAs(RuntimeException.class); |
|
|
|
@ -310,7 +310,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
future.whenComplete(this::storeOutcome); |
|
|
|
future.whenComplete(this::storeOutcome); |
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
assertThat(outcome.toString().substring(0, this.threadNamePrefix.length())).isEqualTo(this.threadNamePrefix); |
|
|
|
assertThat(outcome.toString().substring(0, this.threadNamePrefix.length())).isEqualTo(this.threadNamePrefix); |
|
|
|
@ -325,7 +325,7 @@ abstract class AbstractSchedulingTaskExecutorTests { |
|
|
|
// Assert
|
|
|
|
// Assert
|
|
|
|
Awaitility.await() |
|
|
|
Awaitility.await() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.dontCatchUncaughtExceptions() |
|
|
|
.atMost(1, TimeUnit.SECONDS) |
|
|
|
.atMost(5, TimeUnit.SECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.pollInterval(10, TimeUnit.MILLISECONDS) |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
.until(() -> future.isDone() && outcome != null); |
|
|
|
assertThat(outcome.getClass()).isSameAs(CompletionException.class); |
|
|
|
assertThat(outcome.getClass()).isSameAs(CompletionException.class); |
|
|
|
|