Skip to content

Commit

Permalink
Applying changes based on issue59
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaloup committed Feb 5, 2019
1 parent b1ef5b1 commit f90705e
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 91 deletions.
62 changes: 17 additions & 45 deletions tck/running_the_tck.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ The TCK uses `JUnit 4` and `Arquillian`.

The LRA TCK suite can be parametrized by following properties, handled in the suite with MicroProfile Config

`lra.tck.base.url`::
The URL where the TCK suite deployment is exposed at. The TCK suite will construct path based on this URL.
The default base URL is `http://localhost:8180`.
`lra.tck.timeout.factor`::
timeout factor of default value `1.0`. When set bigger than `1.0` then timeout value will be bigger and waiting time are longer.
Timeout factor of default value `1.0`. When set bigger than `1.0` then timeout value will be bigger and waiting time are longer.
When set-up lower then the timeouts will be shorter.
`lra.tck.coordinator.waiting`::
time that the tests waits for the coordinator start-up
`lra.tck.coordinator.hostname`::
hostname where coordinator is available at for TCK suite can run the LRA status from the coordinator
`lra.tck.coordinator.port`::
port where coordinator is available at for TCK suite can run the LRA status from the coordinator
Time that the tests waits for the LRA recovery starts-up.
`lra.http.host`, `lra.http.port`::
Hostname and port where coordinator is available at. This is used for checking if tests can be started as endpoint is ready.
`lra.http.recovery.host`, `lra.http.recovery.port`, `lra.http.recovery.path`::
Hostname, port and path for the recovery endpoint that will be contacted in tests checking recovery capabilities.

== Prerequisites for the MicroProfile LRA TCK implementation

* `pom.xml` dependencies set-up
* MicroProfile Config being available in container for the TCK to run
* Arquillian container configured in `arquillian.xml` (tests could manually deploy with `@ArquillianResource Deployer`)
* `ResourceProvider` implemented and registered providing base URL where container starts the deployments
* `pom.xml` dependencies are set-up
* MicroProfile Config is providedby runtime for the LRA TCK suite could be run
* a default Arquillian container is configured in `arquillian.xml` (tests manually deploy with use of `@ArquillianResource Deployer`)
* implementation provides one implementation of `org.eclipse.microprofile.lra.client.LRAClient` as it's injected by TCK suite
* implementation has to provide one implementation of `org.eclipse.microprofile.lra.tck.spi.ManagementSPI`. This is an interface
with definition of util methods used by the TCK suite for its run.

=== Setting-up pom.xml dependencies and running the tests

Expand Down Expand Up @@ -77,12 +82,12 @@ Here we use integration tests with `maven failsafe` where dependency to scan is

=== MicroProfile Config being available

The testsuite uses uses configuration while expecting MicroProfile Config is available. The maven coordinates
The testsuite uses configuration while expecting MicroProfile Config is available. The maven coordinates
of config are `org.eclipse.microprofile.config:microprofile-config-api`.

=== Arquillian container

The `arquillian-*.xml` has to define a container that will be starated and managed by Arquillian lifecycle
The `arquillian-*.xml` has to define a container that will be started and managed by Arquillian lifecycle
but that provide a way to deploy and undeploy deployments. That container to be expected with default type `suite`.


Expand All @@ -98,36 +103,3 @@ but that provide a way to deploy and undeploy deployments. That container to be
</container>
<arquillian>
----

=== ResourceProvider of base URL endpoint

As TCK deployment provides LRA annotated JAX-RS classes which exposes REST endpoints. The TCK suite needs to call them.
The implementation has to provide the base URL that the endpoint paths can be constructed with.
The implementation does it by using Arquillian `ResoruceProvider` which returns the base `URL`.

The LRA TCK suite uses injection

[source, java]
----
@ArquillianResource
private URL url;
----

The implementation has to define

[source, java]
----
public class TCKImplementationUrlProvider implements io.narayana.lra.tck.arquillian.ResourceProvider {
@Override
public Object lookup(ArquillianResource arquillianResource, Annotation... annotations) {
return new URL("http://localhost:8080");
}
public boolean canProvide(Class<?> type) {
return type.isAssignableFrom(URL.class);
}
}
----

Loading

0 comments on commit f90705e

Please sign in to comment.