testcontainers-1.12.1.jar
登录
|
org.testcontainers:testcontainers:1.12.1
META-INF
org
testcontainers
lifecycle
Testcontainers.java
utility
DockerClientFactory.java
images
containers
FailureDetectingExternalResource.java
ExecInContainerPattern.java
traits
InternetProtocol.java
ContainerFetchException.java
DockerComposeContainer.java
output
ContainerLaunchException.java
FixedHostPortGenericContainer.java
AmbassadorContainer.java
Container.java
VncRecordingContainer.java
wait
PortForwardingContainer.java
ContainerState.java
SocatContainer.java
SelinuxContext.java
startupcheck
Network.java
FutureContainer.java
GenericContainer.java
BindMode.java
ComposeServiceWaitStrategyTarget.java
dockerclient
ComposeServiceWaitStrategyTarget.java
清空
类结构
// Generated by delombok at Sun Sep 08 08:37:39 UTC 2019 package org.testcontainers.containers; import com.github.dockerjava.api.command.
InspectContainerResponse
; import com.github.dockerjava.api.model.
Container
; import lombok.
NonNull
; import org.testcontainers.
DockerClientFactory
; import org.testcontainers.containers.wait.strategy.
WaitStrategyTarget
; import java.util.
ArrayList
; import java.util.
HashMap
; import java.util.
List
; import java.util.
Map
; /** * Class to provide a wait strategy target for services started through docker-compose */ class
ComposeServiceWaitStrategyTarget
implements
WaitStrategyTarget
{ private final
Container
container
; private final
GenericContainer
proxyContainer
; @
NonNull
private
Map
<
Integer
,
Integer
>
mappedPorts
; private final java.util.concurrent.atomic.
AtomicReference
<java.lang.
Object
>
containerInfo
= new java.util.concurrent.atomic.
AtomicReference
<java.lang.
Object
>();
ComposeServiceWaitStrategyTarget
(
Container
container
,
GenericContainer
proxyContainer
, @
NonNull
Map
<
Integer
,
Integer
>
mappedPorts
) { if (
mappedPorts
== null) { throw new java.lang.
NullPointerException
("mappedPorts is marked non-null but is null"); } this.
container
=
container
; this.
proxyContainer
=
proxyContainer
; this.
mappedPorts
= new
HashMap
<>(
mappedPorts
); } /** * {@inheritDoc} */ @
Override
public
List
<
Integer
>
getExposedPorts
() { return new
ArrayList
<>(this.
mappedPorts
.
keySet
()); } /** * {@inheritDoc} */ @
Override
public
Integer
getMappedPort
(int
originalPort
) { return this.
proxyContainer
.
getMappedPort
(this.
mappedPorts
.
get
(
originalPort
)); } /** * {@inheritDoc} */ @
Override
public
String
getContainerIpAddress
() { return
proxyContainer
.
getContainerIpAddress
(); } /** * {@inheritDoc} */ @
Override
public
String
getContainerId
() { return this.
container
.
getId
(); } @java.lang.
Override
@java.lang.
SuppressWarnings
("all") public boolean
equals
(final java.lang.
Object
o
) { if (
o
== this) return true; if (!(
o
instanceof
ComposeServiceWaitStrategyTarget
)) return false; final
ComposeServiceWaitStrategyTarget
other
= (
ComposeServiceWaitStrategyTarget
)
o
; if (!
other
.
canEqual
((java.lang.
Object
) this)) return false; final java.lang.
Object
this$container
= this.
container
; final java.lang.
Object
other$container
=
other
.
container
; if (
this$container
== null ?
other$container
!= null : !
this$container
.
equals
(
other$container
)) return false; final java.lang.
Object
this$proxyContainer
= this.
proxyContainer
; final java.lang.
Object
other$proxyContainer
=
other
.
proxyContainer
; if (
this$proxyContainer
== null ?
other$proxyContainer
!= null : !
this$proxyContainer
.
equals
(
other$proxyContainer
)) return false; final java.lang.
Object
this$mappedPorts
= this.
mappedPorts
; final java.lang.
Object
other$mappedPorts
=
other
.
mappedPorts
; if (
this$mappedPorts
== null ?
other$mappedPorts
!= null : !
this$mappedPorts
.
equals
(
other$mappedPorts
)) return false; final java.lang.
Object
this$containerInfo
= this.
getContainerInfo
(); final java.lang.
Object
other$containerInfo
=
other
.
getContainerInfo
(); if (
this$containerInfo
== null ?
other$containerInfo
!= null : !
this$containerInfo
.
equals
(
other$containerInfo
)) return false; return true; } @java.lang.
SuppressWarnings
("all") protected boolean
canEqual
(final java.lang.
Object
other
) { return
other
instanceof
ComposeServiceWaitStrategyTarget
; } @java.lang.
Override
@java.lang.
SuppressWarnings
("all") public int
hashCode
() { final int
PRIME
= 59; int
result
= 1; final java.lang.
Object
$container
= this.
container
;
result
=
result
*
PRIME
+ (
$container
== null ? 43 :
$container
.
hashCode
()); final java.lang.
Object
$proxyContainer
= this.
proxyContainer
;
result
=
result
*
PRIME
+ (
$proxyContainer
== null ? 43 :
$proxyContainer
.
hashCode
()); final java.lang.
Object
$mappedPorts
= this.
mappedPorts
;
result
=
result
*
PRIME
+ (
$mappedPorts
== null ? 43 :
$mappedPorts
.
hashCode
()); final java.lang.
Object
$containerInfo
= this.
getContainerInfo
();
result
=
result
*
PRIME
+ (
$containerInfo
== null ? 43 :
$containerInfo
.
hashCode
()); return
result
; } @java.lang.
SuppressWarnings
("all") public
InspectContainerResponse
getContainerInfo
() { java.lang.
Object
value
= this.
containerInfo
.
get
(); if (
value
== null) { synchronized (this.
containerInfo
) {
value
= this.
containerInfo
.
get
(); if (
value
== null) { final
InspectContainerResponse
actualValue
=
DockerClientFactory
.
instance
().
client
().
inspectContainerCmd
(
getContainerId
()).
exec
();
value
=
actualValue
== null ? this.
containerInfo
:
actualValue
; this.
containerInfo
.
set
(
value
); } } } return (
InspectContainerResponse
) (
value
== this.
containerInfo
? null :
value
); } }
查找资源
Jre/Lib
输入类名或文件名
类结构窗口