public class ManagedExecutorTest
extends org.jboss.arquillian.testng.Arquillian
Constructor and Description |
---|
ManagedExecutorTest() |
Modifier and Type | Method and Description |
---|---|
void |
after() |
void |
afterMethod(Method m,
org.testng.ITestResult result) |
void |
before() |
void |
beforeMethod(Method m) |
void |
builderForManagedExecutorIsProvided() |
void |
clearUnspecifiedContexts()
Verify that the ManagedExecutor implementation clears context
types that are not configured under propagated, or cleared.
|
void |
completedFutureDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages of the completed future that is created
by the ManagedExecutor's completedFuture implementation.
|
void |
completedStageDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages of the completed future that is created
by the ManagedExecutor's completedStage implementation.
|
void |
contextControlsForManagedExecutorBuilder()
Verify the MicroProfile Context Propagation implementation of propagate(), and cleared()
for ManagedExecutor.Builder.
|
void |
contextOfContextualCallableOverridesContextOfManagedExecutor()
When an already-contextualized Callable is specified as the action/task,
the action/task runs with its already-captured context rather than
capturing and applying context per the configuration of the managed executor.
|
void |
contextOfContextualConsumerAndBiFunctionOverrideContextOfManagedExecutor()
When an already-contextualized Consumer or BiFunction is specified as the action/task,
the action/task runs with its already-captured context rather than
capturing and applying context per the configuration of the managed executor.
|
void |
contextOfContextualFunctionOverridesContextOfManagedExecutor()
When an already-contextualized Function is specified as the action/task,
the action/task runs with its already-captured context rather than
capturing and applying context per the configuration of the managed executor.
|
void |
contextOfContextualRunnableOverridesContextOfManagedExecutor()
When an already-contextualized Runnable is specified as the action/task,
the action/task runs with its already-captured context rather than
capturing and applying context per the configuration of the managed executor.
|
void |
contextOfContextualSuppplierAndBiConsumerOverrideContextOfManagedExecutor()
When an already-contextualized Supplier or BiFunction is specified as the action/task,
the action/task runs with its already-captured context rather than
capturing and applying context per the configuration of the managed executor.
|
void |
copyCompletableFuture()
Verify that we can copy a CompletableFuture and get context propagation in the copy's dependent stages.
|
void |
copyCompletionStage()
Verify that we can copy a CompletionStage and get context propagation in the copy's dependent stages.
|
static org.jboss.shrinkwrap.api.spec.WebArchive |
createDeployment() |
void |
executedTaskRunsWithClearedContext()
Verify that thread context is cleared per the configuration of the ManagedExecutor builder
for all tasks that are executed via the execute method.
|
void |
executedTaskRunsWithContext()
Verify that thread context is propagated per the configuration of the ManagedExecutor builder
for all tasks that are executed via the execute method.
|
void |
failedFutureDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages of the completed future that is created
by the ManagedExecutor's failedFuture implementation.
|
void |
failedStageDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages of the completed future that is created
by the ManagedExecutor's failedStage implementation.
|
void |
maxAsync2()
Verify that the ManagedExecutor implementation starts 2 async tasks/actions, and no more,
when maxAsync is configured to 2.
|
void |
maxAsyncInvalidValues()
Attempt to specify invalid values (less than -1 and 0) for maxAsync.
|
void |
maxQueued3()
Verify that 3 tasks/actions, and no more, can be queued when maxQueued is configured to 3.
|
void |
maxQueuedInvalidValues()
Attempt to specify invalid values (less than -1 and 0) for maxQueued.
|
void |
newIncompleteFutureDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages of the incomplete future that is created
by the ManagedExecutor's newIncompleteFuture implementation.
|
void |
propagateApplicationContext()
Verify that Application context makes the application's thread context class loader available to the task.
|
void |
propagateTransactionContextJTA()
Verify that when JTA transactions are supported and configuration of propagated=TRANSACTION
is permitted, it is at least possible to propagate the absence of a transaction,
and if context is allowed to be captured while a transaction is active, then the task or action
runs with a transaction on the thread.
|
void |
reuseManagedExecutorBuilder()
Verify that the ManagedExecutor.Builder can be used to create multiple ManagedExecutors with
different configured contexts.
|
void |
runAsyncStageAndDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages as well as the initial stage created
by the ManagedExecutor's runAsync implementation.
|
void |
shutdownNowPreventsAdditionalSubmitsAndCancelsTasks()
Verify that the ManagedExecutor shutdownNow method prevents additional tasks from being submitted
and cancels tasks that are currently in progress or queued.
|
void |
shutdownPreventsAdditionalSubmits()
Verify that the ManagedExecutor shutdown method prevents additional tasks from being submitted
but does not interfere with tasks and actions that are running or queued.
|
void |
submittedTasksRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all tasks that are submitted via the submit(Callable),
submit(Runnable) and submit(Runnable, result) methods.
|
void |
supplyAsyncStageAndDependentStagesRunWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all dependent stages as well as the initial stage created
by the ManagedExecutor's supplyAsync implementation.
|
void |
threadContextHasSamePropagationSettings()
Verify that we can obtain a ThreadContext with the same settings as the ManagedExecutor
|
void |
timedInvokeAllRunsTasksWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all tasks that are submitted via the ManagedExecutor's
timed invokeAll operation.
|
void |
timedInvokeAnyRunsTaskWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for one or more tasks that are submitted via the ManagedExecutor's
timed invokeAny operation.
|
void |
untimedInvokeAllRunsTasksWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for all tasks that are submitted via the ManagedExecutor's
untimed invokeAll operation.
|
void |
untimedInvokeAnyRunsTasksWithContext()
Verify that thread context is captured and propagated per the configuration of the
ManagedExecutor builder for one or more tasks that are submitted via the ManagedExecutor's
untimed invokeAny operation.
|
void |
withDefaultExecutorServiceIsUsedDirectlyAndViaGetThreadContext()
Verify that the presence of a default executor service implies async actions run on it.
|
@AfterClass public void after()
@AfterMethod public void afterMethod(Method m, org.testng.ITestResult result)
@BeforeClass public void before()
@BeforeMethod public void beforeMethod(Method m)
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive createDeployment()
public void builderForManagedExecutorIsProvided()
public void clearUnspecifiedContexts() throws InterruptedException, ExecutionException, TimeoutException
TimeoutException
- indicates test failureExecutionException
- indicates test failureInterruptedException
- indicates test failurepublic void completedFutureDependentStagesRunWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void completedStageDependentStagesRunWithContext() throws InterruptedException
InterruptedException
- indicates test failurepublic void contextControlsForManagedExecutorBuilder() throws InterruptedException, ExecutionException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void contextOfContextualCallableOverridesContextOfManagedExecutor() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void contextOfContextualConsumerAndBiFunctionOverrideContextOfManagedExecutor() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void contextOfContextualFunctionOverridesContextOfManagedExecutor() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void contextOfContextualRunnableOverridesContextOfManagedExecutor() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void contextOfContextualSuppplierAndBiConsumerOverrideContextOfManagedExecutor() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void executedTaskRunsWithClearedContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void executedTaskRunsWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void failedFutureDependentStagesRunWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void failedStageDependentStagesRunWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void maxAsync2() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void maxAsyncInvalidValues() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void maxQueued3() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void maxQueuedInvalidValues() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void newIncompleteFutureDependentStagesRunWithContext() throws ExecutionException, InterruptedException
ExecutionException
- indicates test failureInterruptedException
- indicates test failurepublic void propagateApplicationContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void propagateTransactionContextJTA() throws Exception
UserTransaction
via JNDI and via CDI.
Should neither work, it still doesn't throw exception but instead returns.Exception
- indicates test failurepublic void shutdownNowPreventsAdditionalSubmitsAndCancelsTasks() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void shutdownPreventsAdditionalSubmits() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void reuseManagedExecutorBuilder() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void runAsyncStageAndDependentStagesRunWithContext() throws ExecutionException, InterruptedException
ExecutionException
- indicates test failureInterruptedException
- indicates test failurepublic void submittedTasksRunWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void supplyAsyncStageAndDependentStagesRunWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void timedInvokeAllRunsTasksWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void timedInvokeAnyRunsTaskWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void untimedInvokeAllRunsTasksWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void untimedInvokeAnyRunsTasksWithContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failurepublic void copyCompletableFuture() throws InterruptedException, ExecutionException, TimeoutException
InterruptedException
- indicates test failureExecutionException
- indicates test failureTimeoutException
- indicates test failurepublic void copyCompletionStage() throws InterruptedException, ExecutionException, TimeoutException
InterruptedException
- indicates test failureExecutionException
- indicates test failureTimeoutException
- indicates test failurepublic void threadContextHasSamePropagationSettings() throws InterruptedException, ExecutionException, TimeoutException
InterruptedException
- indicates test failureExecutionException
- indicates test failureTimeoutException
- indicates test failurepublic void withDefaultExecutorServiceIsUsedDirectlyAndViaGetThreadContext() throws ExecutionException, InterruptedException, TimeoutException
ExecutionException
- indicates test failureInterruptedException
- indicates test failureTimeoutException
- indicates test failureCopyright © 2021 Eclipse Foundation. All rights reserved.