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

## Class BulkheadSynchTest

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

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

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

Author:
  Gordon Hutchison, Andrew Rouse

### 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 and Description
`BulkheadSynchTest()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`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, Consumer<Barrier> bulkheadMethod)` Conducts a standard test to ensure that a synchronous bulkhead with no other annotations works correctly.
`void` `testBulkheadClassSemaphore10()` Tests the class synchronous Bulkhead10.
`void` `testBulkheadClassSemaphore3()` Tests the class synchronous Bulkhead3.
`void` `testBulkheadClassSemaphoreDefault()` Tests the basic class synchronous Bulkhead.
`void` `testBulkheadMethodSemaphore10()` Tests the method synchronous Bulkhead10.
`void` `testBulkheadMethodSemaphore3()` Tests the method synchronous Bulkhead3.
`void` `testBulkheadMethodSemaphoreDefault()` Tests the basic method synchronous Bulkhead with defaulting value parameter.
`void` `testSemaphoreWaitingTaskQueueIgnored()` Test that the `waitingTaskQueue` parameter is ignored when `Bulkhead` is used without `Asynchronous`.

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

#### BulkheadSynchTest

    public BulkheadSynchTest()

### Method Detail

#### 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 "ftBulkheadSynchTest.war"

#### testBulkheadClassSemaphore3

    public void testBulkheadClassSemaphore3()

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

#### testBulkheadMethodSemaphore3

    public void testBulkheadMethodSemaphore3()

Tests the method synchronous Bulkhead3. This test will check that 3 and no more than 3 parallel synchronous calls are allowed into a method that has an individual Bulkhead(3) annotation

#### testBulkheadClassSemaphore10

    public void testBulkheadClassSemaphore10()

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

#### testBulkheadMethodSemaphore10

    public void testBulkheadMethodSemaphore10()

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

#### testBulkheadClassSemaphoreDefault

    public void testBulkheadClassSemaphoreDefault()

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

#### testBulkheadMethodSemaphoreDefault

    public void testBulkheadMethodSemaphoreDefault()

Tests the basic method synchronous Bulkhead with defaulting value parameter. This will check that more than 1 but not more than 10 threads get into the bulkhead at once.

#### testSemaphoreWaitingTaskQueueIgnored

    public void testSemaphoreWaitingTaskQueueIgnored()

Test that the `waitingTaskQueue` parameter is ignored when `Bulkhead` is used without `Asynchronous`.

#### testBulkhead

    public static void testBulkhead(int maxRunning,
                                    Consumer<Barrier> bulkheadMethod)

Conducts a standard test to ensure that a synchronous 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` which accepts a `Barrier` and calls `Barrier.await()`.

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