Class AsynchronousTest
java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.fault.tolerance.tck.AsynchronousTest
- All Implemented Interfaces:
org.testng.IHookable
,org.testng.ITestNGListener
public class AsynchronousTest
extends org.jboss.arquillian.testng.Arquillian
Verify the asynchronous invocation
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.arquillian.testng.Arquillian
org.jboss.arquillian.testng.Arquillian.UpdateResultListener
-
Field Summary
Fields inherited from class org.jboss.arquillian.testng.Arquillian
ARQUILLIAN_DATA_PROVIDER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Ensure that any waiting futures get completed at the end of each teststatic org.jboss.shrinkwrap.api.spec.WebArchive
deploy()
void
Test that the future returned by calling an asynchronous method is done if called after waiting enough time to end the operationvoid
Test that the future returned by calling an asynchronous method is not done if called right after the operationvoid
Test that the request context is active during execution for an asynchronous method that returns a CompletionStage If the request scope is active, then an @ApplicationScoped bean should be able to asynchronously call an @Asynchronous method returning a CompletionStage on a @RequestScoped bean, and return the correct resultvoid
Test that the request context is active during execution for an asynchronous method that returns a Future If the request scope is active, then an @ApplicationScoped bean should be able to asynchronously call an @Asynchronous method returning a Future on a @RequestScoped bean, and return the correct resultvoid
Test that the future returned by calling a method in an asynchronous class is done if called after waiting enough time to end the operationvoid
Test that the future returned by calling a method in an asynchronous class is not done if called right after the operationMethods inherited from class org.jboss.arquillian.testng.Arquillian
arquillianAfterClass, arquillianAfterSuite, arquillianAfterTest, arquillianArgumentProvider, arquillianBeforeClass, arquillianBeforeSuite, arquillianBeforeTest, run
-
Constructor Details
-
AsynchronousTest
public AsynchronousTest()
-
-
Method Details
-
deploy
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy() -
testAsyncIsNotFinished
public void testAsyncIsNotFinished()Test that the future returned by calling an asynchronous method is not done if called right after the operation -
testAsyncIsFinished
public void testAsyncIsFinished()Test that the future returned by calling an asynchronous method is done if called after waiting enough time to end the operation -
testClassLevelAsyncIsNotFinished
public void testClassLevelAsyncIsNotFinished()Test that the future returned by calling a method in an asynchronous class is not done if called right after the operation -
testClassLevelAsyncIsFinished
public void testClassLevelAsyncIsFinished()Test that the future returned by calling a method in an asynchronous class is done if called after waiting enough time to end the operation -
testAsyncRequestContextWithCompletionStage
public void testAsyncRequestContextWithCompletionStage() throws InterruptedException, ExecutionException, TimeoutExceptionTest that the request context is active during execution for an asynchronous method that returns a CompletionStage If the request scope is active, then an @ApplicationScoped bean should be able to asynchronously call an @Asynchronous method returning a CompletionStage on a @RequestScoped bean, and return the correct result -
testAsyncRequestContextWithFuture
public void testAsyncRequestContextWithFuture() throws InterruptedException, ExecutionException, TimeoutExceptionTest that the request context is active during execution for an asynchronous method that returns a Future If the request scope is active, then an @ApplicationScoped bean should be able to asynchronously call an @Asynchronous method returning a Future on a @RequestScoped bean, and return the correct result -
completeWaitingFutures
@AfterMethod public void completeWaitingFutures()Ensure that any waiting futures get completed at the end of each testImportant in case tests end early due to an exception or failure.
-