- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getContainerIpAddress()
方法的一些代码示例,展示了WaitStrategyTarget.getContainerIpAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WaitStrategyTarget.getContainerIpAddress()
方法的具体详情如下:
包路径:org.testcontainers.containers.wait.strategy.WaitStrategyTarget
类名称:WaitStrategyTarget
方法名:getContainerIpAddress
暂无
代码示例来源:origin: testcontainers/testcontainers-java
/**
* Build the URI on which to check if the container is ready.
*
* @param livenessCheckPort the liveness port
* @return the liveness URI
*/
private URI buildLivenessUri(int livenessCheckPort) {
final String scheme = (tlsEnabled ? "https" : "http") + "://";
final String host = waitStrategyTarget.getContainerIpAddress();
final String portSuffix;
if ((tlsEnabled && 443 == livenessCheckPort) || (!tlsEnabled && 80 == livenessCheckPort)) {
portSuffix = "";
} else {
portSuffix = ":" + String.valueOf(livenessCheckPort);
}
return URI.create(scheme + host + portSuffix + path);
}
代码示例来源:origin: testcontainers/testcontainers-java
@Before
public void setUp() throws Exception {
listeningSocket1 = new ServerSocket(0);
listeningSocket2 = new ServerSocket(0);
nonListeningSocket = new ServerSocket(0);
nonListeningSocket.close();
mockContainer = mock(WaitStrategyTarget.class);
when(mockContainer.getContainerIpAddress()).thenReturn("127.0.0.1");
}
代码示例来源:origin: testcontainers/testcontainers-java
@Override
protected void waitUntilReady() {
final Set<Integer> externalLivenessCheckPorts = getLivenessCheckPorts();
if (externalLivenessCheckPorts.isEmpty()) {
log.debug("Liveness check ports of {} is empty. Not waiting.", waitStrategyTarget.getContainerInfo().getName());
return;
}
@SuppressWarnings("unchecked")
List<Integer> exposedPorts = waitStrategyTarget.getExposedPorts();
final Set<Integer> internalPorts = getInternalPorts(externalLivenessCheckPorts, exposedPorts);
Callable<Boolean> internalCheck = new InternalCommandPortListeningCheck(waitStrategyTarget, internalPorts);
Callable<Boolean> externalCheck = new ExternalPortListeningCheck(waitStrategyTarget, externalLivenessCheckPorts);
try {
Unreliables.retryUntilTrue((int) startupTimeout.getSeconds(), TimeUnit.SECONDS,
() -> getRateLimiter().getWhenReady(() -> internalCheck.call() && externalCheck.call()));
} catch (TimeoutException e) {
throw new ContainerLaunchException("Timed out waiting for container port to open (" +
waitStrategyTarget.getContainerIpAddress() +
" ports: " +
externalLivenessCheckPorts +
" should be listening)");
}
}
代码示例来源:origin: org.testcontainers/testcontainers
/**
* Build the URI on which to check if the container is ready.
*
* @param livenessCheckPort the liveness port
* @return the liveness URI
*/
private URI buildLivenessUri(int livenessCheckPort) {
final String scheme = (tlsEnabled ? "https" : "http") + "://";
final String host = waitStrategyTarget.getContainerIpAddress();
final String portSuffix;
if ((tlsEnabled && 443 == livenessCheckPort) || (!tlsEnabled && 80 == livenessCheckPort)) {
portSuffix = "";
} else {
portSuffix = ":" + String.valueOf(livenessCheckPort);
}
return URI.create(scheme + host + portSuffix + path);
}
代码示例来源:origin: org.testcontainers/testcontainers
@Override
protected void waitUntilReady() {
final Set<Integer> externalLivenessCheckPorts = getLivenessCheckPorts();
if (externalLivenessCheckPorts.isEmpty()) {
log.debug("Liveness check ports of {} is empty. Not waiting.", waitStrategyTarget.getContainerInfo().getName());
return;
}
@SuppressWarnings("unchecked")
List<Integer> exposedPorts = waitStrategyTarget.getExposedPorts();
final Set<Integer> internalPorts = getInternalPorts(externalLivenessCheckPorts, exposedPorts);
Callable<Boolean> internalCheck = new InternalCommandPortListeningCheck(waitStrategyTarget, internalPorts);
Callable<Boolean> externalCheck = new ExternalPortListeningCheck(waitStrategyTarget, externalLivenessCheckPorts);
try {
Unreliables.retryUntilTrue((int) startupTimeout.getSeconds(), TimeUnit.SECONDS, () -> getRateLimiter().getWhenReady(() -> internalCheck.call() && externalCheck.call()));
} catch (TimeoutException e) {
throw new ContainerLaunchException("Timed out waiting for container port to open (" + waitStrategyTarget.getContainerIpAddress() + " ports: " + externalLivenessCheckPorts + " should be listening)");
}
}
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getContainerId()方法的一些代码示例,展
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getContainerIpAddress()方法的一
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getBoundPortNumbers()方法的一些代
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getExposedPorts()方法的一些代码示例,
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getMappedPort()方法的一些代码示例,展示
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getLivenessCheckPortNumbers
本文整理了Java中org.testcontainers.containers.wait.strategy.WaitStrategyTarget.getContainerInfo()方法的一些代码示例
我是一名优秀的程序员,十分优秀!