@Override protected void waitUntilContainerStarted() { getWaitStrategy().waitUntilReady(this); } }
/** * {@inheritDoc} */ @Override public SELF withStartupTimeout(Duration startupTimeout) { getWaitStrategy().withStartupTimeout(startupTimeout); return self(); }
@Override public void waitUntilReady(WaitStrategyTarget waitStrategyTarget) { Timeouts.doWithTimeout((int) timeout.toMillis(), TimeUnit.MILLISECONDS, () -> { for (WaitStrategy strategy : strategies) { strategy.waitUntilReady(waitStrategyTarget); } }); }
protected GenericContainer startContainerWithCommand(String shellCommand, WaitStrategy waitStrategy, Integer... ports) { // apply WaitStrategy to container return new GenericContainer(IMAGE_NAME) .withExposedPorts(ports) .withCommand("sh", "-c", shellCommand) .waitingFor(waitStrategy.withStartupTimeout(Duration.ofMillis(WAIT_TIMEOUT_MILLIS))); }
/** * Wait until the container has started. The default implementation simply * waits for a port to start listening; other implementations are available * as implementations of {@link org.testcontainers.containers.wait.strategy.WaitStrategy} * * @see #waitingFor(org.testcontainers.containers.wait.strategy.WaitStrategy) */ protected void waitUntilContainerStarted() { org.testcontainers.containers.wait.strategy.WaitStrategy waitStrategy = getWaitStrategy(); if (waitStrategy != null) { waitStrategy.waitUntilReady(this); } }
private WaitStrategy waitStrategy() { return new WaitAllStrategy() .withStrategy(Wait.forHttp("").forPort(DEFAULT_RABBITMQ_ADMIN_PORT) .withRateLimiter(RateLimiters.TWENTIES_PER_SECOND) .withStartupTimeout(TEN_MINUTES_TIMEOUT)) .withStrategy(new RabbitMQWaitStrategy(this, TEN_MINUTES_TIMEOUT)) .withStartupTimeout(TEN_MINUTES_TIMEOUT); }
/** * Wait until the container has started. The default implementation simply * waits for a port to start listening; other implementations are available * as implementations of {@link org.testcontainers.containers.wait.strategy.WaitStrategy} * * @see #waitingFor(org.testcontainers.containers.wait.strategy.WaitStrategy) */ protected void waitUntilContainerStarted() { org.testcontainers.containers.wait.strategy.WaitStrategy waitStrategy = getWaitStrategy(); if (waitStrategy != null) { waitStrategy.waitUntilReady(this); } }
@Override public void waitUntilReady(WaitStrategyTarget waitStrategyTarget) { Timeouts.doWithTimeout((int) timeout.toMillis(), TimeUnit.MILLISECONDS, () -> { for (WaitStrategy strategy : strategies) { strategy.waitUntilReady(waitStrategyTarget); } }); }
@Override protected void waitUntilContainerStarted() { getWaitStrategy().waitUntilReady(this); } }
public void waitForReadyness() { waitStrategy().waitUntilReady(container); }