Skip to content

Commit

Permalink
Allow to run MP LRA TCK with externally managed coordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
xstefank committed Mar 17, 2023
1 parent 351fcd3 commit fd0bd02
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ public class LRACoordinatorManager {

public void beforeClass(
@Observes(precedence = DEFAULT_PRECEDENCE) org.jboss.arquillian.test.spi.event.suite.BeforeSuite event) {
LOGGER.debug("Starting LRA coordinator on port " + coordinatorPort);
coordinatorContainer = new GenericContainer<>(DockerImageName.parse("jbosstm/lra-coordinator:latest"))
// lra-coordinator is a Quarkus service
.withEnv("QUARKUS_HTTP_PORT", String.valueOf(coordinatorPort))
// need to run with host network because coordinator calls the TCK services from the container
.withNetworkMode("host");
if (System.getProperty("lra.coordinator.url") == null) {
LOGGER.debug("Starting LRA coordinator on port " + coordinatorPort);
coordinatorContainer = new GenericContainer<>(DockerImageName.parse("jbosstm/lra-coordinator:latest"))
// lra-coordinator is a Quarkus service
.withEnv("QUARKUS_HTTP_PORT", String.valueOf(coordinatorPort))
// need to run with host network because coordinator calls the TCK services from the container
.withNetworkMode("host");

coordinatorContainer.start();
coordinatorContainer.start();

System.setProperty("lra.coordinator.url", String.format("http://localhost:%d/lra-coordinator", coordinatorPort));
System.setProperty("lra.coordinator.url", String.format("http://localhost:%d/lra-coordinator", coordinatorPort));
}
}

public void afterClass(
Expand Down

0 comments on commit fd0bd02

Please sign in to comment.