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

# Class BulkheadAsynchTest

java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.fault.tolerance.tck.bulkhead.BulkheadAsynchTest

All Implemented Interfaces:
  `org.testng.IHookable`, `org.testng.ITestNGListener`

public class BulkheadAsynchTest extends org.jboss.arquillian.testng.Arquillian

Author:
  Gordon Hutchison, Andrew Rouse, carlosdlr

## 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
`BulkheadAsynchTest()`

## Method Summary

Modifier and Type
Method
Description
`static org.jboss.shrinkwrap.api.spec.WebArchive`
`deploy()`
This is the Arquillian deploy method that controls the contents of the war that contains all the tests.
`static void`
`testBulkhead(int maxRunning, int maxQueued, Function<Barrier,Future<?>> bulkheadMethod)`
Conducts a standard test to ensure that an asynchronous bulkhead with no other annotations works correctly.
`void`
`testBulkheadClassAsynchronous10()`
Tests the class asynchronous Bulkhead(10) This test will check that 10 and no more than 10 asynchronous calls are allowed into a method that is a member of a `@Bulkhead(10)` Class.
`void`
`testBulkheadClassAsynchronous3()`
Tests the class asynchronous Bulkhead(3) This test will check that 3 and no more than 3 asynchronous calls are allowed into a method that is a member of a `@Bulkhead(3)` Class.
`void`
`testBulkheadClassAsynchronousDefault()`
Tests the basic class asynchronous Bulkhead with defaulting value parameter.
`void`
`testBulkheadClassAsynchronousQueueing5()`
Tests the queueing class asynchronous Bulkhead with value parameter 10.
`void`
`testBulkheadCompletionStage()`
Test that an asynchronous method which returns an incomplete CompletionStage still reserves a slot in the bulkhead
`void`
`testBulkheadMethodAsynchronous10()`
Tests the method asynchronous Bulkhead(10).
`void`
`testBulkheadMethodAsynchronous3()`
Tests the method asynchronous Bulkhead(3).
`void`
`testBulkheadMethodAsynchronousDefault()`
Tests the basic method asynchronous Bulkhead with defaulting value parameter.
`void`
`testBulkheadMethodAsynchronousQueueing5()`
Tests the queueing method asynchronous Bulkhead with value parameter 10.

### 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

### BulkheadAsynchTest

public BulkheadAsynchTest()

## Method Details

### deploy

@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy()
This is the Arquillian deploy method that controls the contents of the war that contains all the tests.

Returns:
  the test war "ftBulkheadAsynchTest.war"

### testBulkheadClassAsynchronous10

public void testBulkheadClassAsynchronous10()
Tests the class asynchronous Bulkhead(10) This test will check that 10 and no more than 10 asynchronous calls are allowed into a method that is a member of a `@Bulkhead(10)` Class.

### testBulkheadMethodAsynchronous10

public void testBulkheadMethodAsynchronous10()
Tests the method asynchronous Bulkhead(10). This test will check that 10 and no more than 10 asynchronous calls are allowed into a method that has an individual `@Bulkhead(10)` annotation

### testBulkheadClassAsynchronous3

public void testBulkheadClassAsynchronous3()
Tests the class asynchronous Bulkhead(3) This test will check that 3 and no more than 3 asynchronous calls are allowed into a method that is a member of a `@Bulkhead(3)` Class.

### testBulkheadMethodAsynchronous3

public void testBulkheadMethodAsynchronous3()
Tests the method asynchronous Bulkhead(3). This test will check that 3 and no more than 3 asynchronous calls are allowed into a method that has an individual Bulkhead(3) annotation

### testBulkheadClassAsynchronousDefault

public void testBulkheadClassAsynchronousDefault()
Tests the basic class asynchronous Bulkhead with defaulting value parameter. This will check that exactly 10 calls can be in the bulkhead at once.

### testBulkheadMethodAsynchronousDefault

public void testBulkheadMethodAsynchronousDefault()
Tests the basic method asynchronous Bulkhead with defaulting value parameter. This will check that more than 1 but less than 10 calls get into the bulkhead at once.

### testBulkheadClassAsynchronousQueueing5

public void testBulkheadClassAsynchronousQueueing5()
Tests the queueing class asynchronous Bulkhead with value parameter 10. This will check that more than 1 but less than 5 calls get into the bulkhead at once but that 5 threads can queue to get into the bulkhead

### testBulkheadMethodAsynchronousQueueing5

public void testBulkheadMethodAsynchronousQueueing5()
Tests the queueing method asynchronous Bulkhead with value parameter 10. This will check that more than 1 but less than 5 calls get into the bulkhead at once but that 5 threads can queue to get into the bulkhead

### testBulkheadCompletionStage

public void testBulkheadCompletionStage() throws InterruptedException, ExecutionException, TimeoutException
Test that an asynchronous method which returns an incomplete CompletionStage still reserves a slot in the bulkhead

Throws:
  `InterruptedException`
  `ExecutionException`
  `TimeoutException`

### testBulkhead

public static void testBulkhead(int maxRunning, int maxQueued, Function<Barrier,Future<?>> bulkheadMethod)
Conducts a standard test to ensure that an asynchronous bulkhead with no other annotations works correctly. It asserts that the correct number of tasks are allowed to run and to queue and that when a task in the bulkhead completes a new task can be run.

The `bulkheadMethod` should be a reference to a method annotated with `Bulkhead` and `Asynchronous` which accepts a `Barrier` and calls `Barrier.await()`.

Parameters:
  `maxRunning` - expected number of tasks permitted to run
  `maxQueued` - expected number of tasks permitted to queue
  `bulkheadMethod` - a reference to the annotated method