org.eclipse.microprofile.lra.tck

## Class TckRecoveryTests

- java.lang.Object
- - org.eclipse.microprofile.lra.tck.TckRecoveryTests

    @RunAsClient
    public class TckRecoveryTests
    extends Object

Tests for the recovery of failed LRA services. Test that LRA functions properly even in case of service failures.

This test is meant to be run in "run as client mode controlling the behaviour not via CDI injection but via HTTP calls. The @`Deployment` is defined as `managed = false` which means that Arquillian does not automatically deploy the deployment at the start of the test and the test control this step on its own.

### Field Summary

Fields
`org.junit.rules.TestName` `testName`

### Constructor Summary

Constructors
Constructor and Description
`TckRecoveryTests()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `after()`
`void` `before()`
`static org.jboss.shrinkwrap.api.spec.WebArchive` `deploy()`
`void` `testCancelWhenParticipantIsRestarted(URL deploymentURL)` This test verifies that if the microservice application fails after it enlists with a LRA and then it is restarted again the Compensate callbacks are still received correctly.
`void` `testCancelWhenParticipantIsUnavailable(URL deploymentURL)` This test verifies that if the microservice application which enlisted with the LRA fails and the LRA is ended during the time the service is still down, the Compensate callbacks are received when the microservice application is started again.

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

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

### Field Detail

#### testName

    public org.junit.rules.TestName testName

### Constructor Detail

#### TckRecoveryTests

    public TckRecoveryTests()

### Method Detail

#### before

    public void before()

#### after

    public void after()

#### deploy

    @Deployment(name="tck-recovery",
                managed=false)
    public static org.jboss.shrinkwrap.api.spec.WebArchive deploy()

#### testCancelWhenParticipantIsRestarted

    public void testCancelWhenParticipantIsRestarted(@ArquillianResource
                                                     URL deploymentURL)

This test verifies that if the microservice application fails after it enlists with a LRA and then it is restarted again the Compensate callbacks are still received correctly. Scenario: - start a new container with a single LRA resource - start a new LRA and enlist LRA resource - kill the container/application - start the container/application = cancel the LRA and verify that the callbacks have been sent

Parameters:
  `deploymentURL` - the URL of the arquillian deployment

#### testCancelWhenParticipantIsUnavailable

    public void testCancelWhenParticipantIsUnavailable(@ArquillianResource
                                                       URL deploymentURL)

This test verifies that if the microservice application which enlisted with the LRA fails and the LRA is ended during the time the service is still down, the Compensate callbacks are received when the microservice application is started again. Scenario: - start a new container with a single LRA resource - start a new LRA and enlist the LRA resource with it - kill the container - cancel the LRA while the container is still down - start the container again - replay the end phase to get Compensate calls redelivered - verify that the Compensate callbacks have been received

Parameters:
  `deploymentURL` - the URL of the arquillian deployment