org.eclipse.microprofile.fault.tolerance.tck.disableEnv

## Class DisableAnnotationOnMethodsTest

- java.lang.Object
- - org.jboss.arquillian.testng.Arquillian
  - - org.eclipse.microprofile.fault.tolerance.tck.disableEnv.DisableAnnotationOnMethodsTest

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

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

Test the impact of policies disabling through config. The test assumes that the container supports both the MicroProfile Configuration API and the MicroProfile Fault Tolerance API. Some Fault tolerance policies are disabled through configuration on DisabledClient methods.

Author:
  Antoine Sabot-Durand, Neil Young, 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
`DisableAnnotationOnMethodsTest()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static org.jboss.shrinkwrap.api.spec.WebArchive` `deploy()`
`void` `testAsync()` A test to check that asynchronous is disabled In normal operation, asyncClient.asyncWaitThenReturn() is launched asynchronously.
`void` `testBulkhead()` Test whether Bulkhead is enabled on `waitWithBulkhead()`
`void` `testCircuitClosedThenOpen()` CircuitBreaker policy being disabled the policy shouldn't be applied
`void` `testFallbackDisabled()` Test that a Fallback service is ignored when service fails.
`void` `testRetryDisabled()` failAndRetryOnce is annotated with maxRetries = 1 so it is expected to execute 2 times but as Retry is disabled, then no retries should be attempted.
`void` `testTimeout()` Test Timeout is disabled, should wait two seconds and then get a TestException

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

#### DisableAnnotationOnMethodsTest

    public DisableAnnotationOnMethodsTest()

### Method Detail

#### deploy

    @Deployment
    public static org.jboss.shrinkwrap.api.spec.WebArchive deploy()

#### testRetryDisabled

    public void testRetryDisabled()

failAndRetryOnce is annotated with maxRetries = 1 so it is expected to execute 2 times but as Retry is disabled, then no retries should be attempted.

#### testFallbackDisabled

    public void testFallbackDisabled()

Test that a Fallback service is ignored when service fails. ServiceB is annotated with maxRetries = 1 so serviceB is expected to execute 2 times (Retry is not disabled on the method)

#### testCircuitClosedThenOpen

    public void testCircuitClosedThenOpen()

CircuitBreaker policy being disabled the policy shouldn't be applied

#### testTimeout

    public void testTimeout()

Test Timeout is disabled, should wait two seconds and then get a TestException

#### testAsync

    public void testAsync()
                   throws InterruptedException,
                          ExecutionException

A test to check that asynchronous is disabled In normal operation, asyncClient.asyncWaitThenReturn() is launched asynchronously. As Asynchronous operation was disabled via config, test is expecting a synchronous operation.

Throws:
  `InterruptedException` - interrupted
  `ExecutionException` - task was aborted

#### testBulkhead

    public void testBulkhead()
                      throws ExecutionException,
                             InterruptedException

Test whether Bulkhead is enabled on `waitWithBulkhead()`

Throws:
  `InterruptedException` - interrupted
  `ExecutionException` - task was aborted