forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCmdIT.java
More file actions
39 lines (33 loc) · 1.31 KB
/
Copy pathCmdIT.java
File metadata and controls
39 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.github.dockerjava.cmd;
import com.github.dockerjava.core.DockerClientBuilder;
import com.github.dockerjava.core.DockerClientConfig;
import com.github.dockerjava.core.DockerClientImpl;
import com.github.dockerjava.core.DockerRule;
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient;
import com.github.dockerjava.junit.category.Integration;
import com.github.dockerjava.transport.DockerHttpClient;
import org.junit.Rule;
import org.junit.experimental.categories.Category;
/**
* @author Kanstantsin Shautsou
*/
@Category(Integration.class)
public abstract class CmdIT {
public static DockerHttpClient createDockerHttpClient(DockerClientConfig config) {
return new TrackingDockerHttpClient(
new ApacheDockerHttpClient.Builder()
.dockerHost(config.getDockerHost())
.sslConfig(config.getSSLConfig())
.build()
);
}
public static DockerClientImpl createDockerClient(DockerClientConfig config) {
return (DockerClientImpl) DockerClientBuilder.getInstance(config)
.withDockerHttpClient(createDockerHttpClient(config))
.build();
}
@Rule
public DockerRule dockerRule = new DockerRule();
@Rule
public DockerHttpClientLeakDetector leakDetector = new DockerHttpClientLeakDetector();
}