Package org.eclipse.microprofile.fault.tolerance.tck

# 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
Constructor
Description
`AsynchronousTest()`

## Method Summary

Modifier and Type
Method
Description
`void`
`completeWaitingFutures()`
Ensure that any waiting futures get completed at the end of each test
`static org.jboss.shrinkwrap.api.spec.WebArchive`
`deploy()`
`void`
`testAsyncIsFinished()`
Test that the future returned by calling an asynchronous method is done if called after waiting enough time to end the operation
`void`
`testAsyncIsNotFinished()`
Test that the future returned by calling an asynchronous method is not done if called right after the operation
`void`
`testAsyncRequestContextWithCompletionStage()`
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 result
`void`
`testAsyncRequestContextWithFuture()`
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 result
`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
`void`
`testClassLevelAsyncIsNotFinished()`
Test that the future returned by calling a method in an asynchronous class is not done if called right after the operation

### Methods inherited from class org.jboss.arquillian.testng.Arquillian

`arquillianAfterClass, arquillianAfterSuite, arquillianAfterTest, arquillianArgumentProvider, arquillianBeforeClass, arquillianBeforeSuite, arquillianBeforeTest, run`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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, TimeoutException
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 result

Throws:
  `TimeoutException`
  `ExecutionException`
  `InterruptedException`

### testAsyncRequestContextWithFuture

public void testAsyncRequestContextWithFuture() throws InterruptedException, ExecutionException, TimeoutException
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 result

Throws:
  `TimeoutException`
  `ExecutionException`
  `InterruptedException`

### completeWaitingFutures

@AfterMethod public void completeWaitingFutures()
Ensure that any waiting futures get completed at the end of each test

Important in case tests end early due to an exception or failure.