testcontainers-1.12.1.jar
登录
|
org.testcontainers:testcontainers:1.12.1
META-INF
org
testcontainers
lifecycle
Testcontainers.java
utility
DockerClientFactory.java
images
containers
dockerclient
DockerMachineClientProviderStrategy.java
LogToStringContainerCallback.java
InvalidConfigurationException.java
DockerClientConfigUtils.java
NpipeSocketClientProviderStrategy.java
EnvironmentAndSystemPropertyClientProviderStrategy.java
AuditLoggingDockerClient.java
auth
UnixSocketClientProviderStrategy.java
ProxiedUnixSocketClientProviderStrategy.java
DockerClientProviderStrategy.java
WindowsClientProviderStrategy.java
transport
EnvironmentAndSystemPropertyClientProviderStrategy.java
清空
类结构
// Generated by delombok at Sun Sep 08 08:37:39 UTC 2019 package org.testcontainers.dockerclient; import com.github.dockerjava.core.
DefaultDockerClientConfig
; import com.github.dockerjava.core.
DockerClientConfig
; import org.apache.commons.
lang
.
SystemUtils
; /** * Use environment variables and system properties (as supported by the underlying DockerClient DefaultConfigBuilder) * to try and locate a docker environment. */ public class
EnvironmentAndSystemPropertyClientProviderStrategy
extends
DockerClientProviderStrategy
{ @java.lang.
SuppressWarnings
("all") private static final org.slf4j.
Logger
log
= org.slf4j.
LoggerFactory
.
getLogger
(
EnvironmentAndSystemPropertyClientProviderStrategy
.class); public static final int
PRIORITY
= 100; private static final
String
PING_TIMEOUT_DEFAULT
= "10"; private static final
String
PING_TIMEOUT_PROPERTY_NAME
= "testcontainers.environmentprovider.timeout"; public
EnvironmentAndSystemPropertyClientProviderStrategy
() { // Try using environment variables
config
=
DefaultDockerClientConfig
.
createDefaultConfigBuilder
().
build
(); } @
Override
protected boolean
isApplicable
() { return "tcp".
equalsIgnoreCase
(
config
.
getDockerHost
().
getScheme
()) ||
SystemUtils
.
IS_OS_LINUX
; } @
Override
protected int
getPriority
() { return
PRIORITY
; } @
Override
public void
test
() throws
InvalidConfigurationException
{ try {
client
=
getClientForConfig
(
config
); final int
timeout
=
Integer
.
parseInt
(
System
.
getProperty
(
PING_TIMEOUT_PROPERTY_NAME
,
PING_TIMEOUT_DEFAULT
));
ping
(
client
,
timeout
); } catch (
Exception
|
UnsatisfiedLinkError
e
) {
log
.
error
("ping failed with configuration {} due to {}",
getDescription
(),
e
.
toString
(),
e
); throw new
InvalidConfigurationException
("ping failed"); }
log
.
info
("Found docker client settings from environment"); } @
Override
public
String
getDescription
() { return "Environment variables, system properties and defaults. Resolved: \n" +
stringRepresentation
(
config
); } private
String
stringRepresentation
(
DockerClientConfig
config
) { if (
config
== null) { return ""; } return " dockerHost=" +
config
.
getDockerHost
() + "\n apiVersion=\'" +
config
.
getApiVersion
() + "\'\n registryUrl=\'" +
config
.
getRegistryUrl
() + "\'\n registryUsername=\'" +
config
.
getRegistryUsername
() + "\'\n registryPassword=\'" +
config
.
getRegistryPassword
() + "\'\n registryEmail=\'" +
config
.
getRegistryEmail
() + "\'\n dockerConfig=\'" +
config
.
toString
() + "\'\n"; } }
查找资源
Jre/Lib
输入类名或文件名
类结构窗口