Skip to content

Commit 2e2a9a0

Browse files
committed
Resolved merge conflict by incorporating both suggestions.
2 parents 038597d + e464b1a commit 2e2a9a0

15 files changed

+74
-64
lines changed

src/main/java/com/amihaiemil/docker/LocalDocker.java renamed to src/main/java/com/amihaiemil/docker/LocalUnixDocker.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* name. This class will be removed in one of the future releases.
3939
*
4040
* <pre>
41-
* final Docker docker = new LocalDocker("unix:///var/run/dicker.sock");
41+
* final Docker docker = new LocalUnixDocker("unix:///var/run/dicker.sock");
4242
* </pre>
4343
*
4444
* This implementation manages an internal pool of 10 http connections. Users
@@ -52,9 +52,9 @@
5252

5353
@Deprecated
5454
public final class LocalDocker extends RtDocker {
55-
55+
5656
/**
57-
* Local Docker engine.
57+
* Unix Docker engine.
5858
* @param unixSocket Unix socket File on disk.
5959
* (most likely /var/run/docker.sock).
6060
*/
@@ -63,7 +63,7 @@ public LocalDocker(final File unixSocket){
6363
}
6464

6565
/**
66-
* Local Docker engine.
66+
* Unix Docker engine.
6767
* @param unixSocket Unix socket File on disk.
6868
* (most likely /var/run/docker.sock).
6969
* @param version API version (e.g. v1.30).
@@ -73,7 +73,7 @@ public LocalDocker(final File unixSocket, final String version){
7373
}
7474

7575
/**
76-
* Local Docker engine.
76+
* Unix Docker engine.
7777
* <p>
7878
* Users may supply their own {@link HttpClient} that must register a
7979
* {@link UnixSocketFactory}.

src/test/java/com/amihaiemil/docker/ListedContainersTestCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public final class ListedContainersTestCase {
4949
*/
5050
@Test
5151
public void iterateAll() {
52-
Docker docker = new UnixDocker(
52+
Docker docker = new LocalDocker(
5353
new AssertRequest(
5454
new Response(
5555
HttpStatus.SC_OK,
@@ -116,7 +116,7 @@ public void includeFiltersInRequest() {
116116
"randomLabel=test"
117117
)
118118
);
119-
new UnixDocker(
119+
new LocalDocker(
120120
new AssertRequest(
121121
new Response(
122122
HttpStatus.SC_OK,
@@ -159,7 +159,7 @@ public void includeAddedFiltersInRequest() {
159159
);
160160
final Map<String, Iterable<String>> added = new HashMap<>();
161161
added.put("dangling", Collections.singletonList("true"));
162-
new UnixDocker(
162+
new LocalDocker(
163163
new AssertRequest(
164164
new Response(
165165
HttpStatus.SC_OK,

src/test/java/com/amihaiemil/docker/LocalDockerITCase.java renamed to src/test/java/com/amihaiemil/docker/LocalUnixDockerITCase.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
* @version $Id$
4444
* @since 0.0.1
4545
*/
46-
public final class LocalDockerITCase {
46+
public final class LocalUnixDockerITCase {
4747

4848
/**
49-
* LocalDocker can ping the Docker Engine.
49+
* LocalUnixDocker can ping the Docker Engine.
5050
* @throws Exception If something goes wrong.
5151
*/
5252
@Test
5353
public void pingsDocker() throws Exception {
54-
final Docker docker = new UnixDocker(
54+
final Docker docker = new LocalDocker(
5555
new File("/var/run/docker.sock")
5656
);
5757
MatcherAssert.assertThat(docker.ping(), Matchers.is(Boolean.TRUE));
@@ -64,7 +64,7 @@ public void pingsDocker() throws Exception {
6464
@Test
6565
@Ignore
6666
public void followsEvents() throws Exception {
67-
final Reader reader = new UnixDocker(
67+
final Reader reader = new LocalDocker(
6868
new File("/var/run/docker.sock")
6969
).events();
7070
final String events = IOUtils.toString(reader);
@@ -74,12 +74,12 @@ public void followsEvents() throws Exception {
7474
);
7575
}
7676
/**
77-
* LocalDocker can list {@link Volumes}.
77+
* LocalUnixDocker can list {@link Volumes}.
7878
* @throws Exception If something goes wrong.
7979
*/
8080
@Test
8181
public void listVolumes() throws Exception {
82-
final Docker docker = new UnixDocker(
82+
final Docker docker = new LocalDocker(
8383
Paths.get("/var/run/docker.sock").toFile()
8484
);
8585
MatcherAssert.assertThat(

src/test/java/com/amihaiemil/docker/LocalDockerTestCase.java renamed to src/test/java/com/amihaiemil/docker/LocalUnixDockerTestCase.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
* @version $Id$
4040
* @since 0.0.1
4141
*/
42-
public final class LocalDockerTestCase {
42+
public final class LocalUnixDockerTestCase {
4343

4444
/**
45-
* LocalDocker can be instantiated.
45+
* LocalUnixDocker can be instantiated.
4646
*/
4747
@Test
4848
public void canBeInstantiate() {
4949
MatcherAssert.assertThat(
50-
new UnixDocker(
50+
new LocalDocker(
5151
new File("/var/run/docker.sock")
5252
),
5353
Matchers.notNullValue()
@@ -61,7 +61,7 @@ public void canBeInstantiate() {
6161
@Test
6262
public void pingTrueIfResponseIsOk() throws Exception {
6363
MatcherAssert.assertThat(
64-
new UnixDocker(
64+
new LocalDocker(
6565
new AssertRequest(
6666
new Response(HttpStatus.SC_OK, "")
6767
),
@@ -78,7 +78,7 @@ public void pingTrueIfResponseIsOk() throws Exception {
7878
@Test
7979
public void pingFalseIfResponseIsNotOk() throws Exception {
8080
MatcherAssert.assertThat(
81-
new UnixDocker(
81+
new LocalDocker(
8282
new AssertRequest(
8383
new Response(HttpStatus.SC_NOT_FOUND, "")
8484
),
@@ -89,51 +89,51 @@ public void pingFalseIfResponseIsNotOk() throws Exception {
8989
}
9090

9191
/**
92-
* LocalDocker can return the Containers.
92+
* LocalUnixDocker can return the Containers.
9393
*/
9494
@Test
9595
public void getsContainers() {
9696
MatcherAssert.assertThat(
97-
new UnixDocker(
97+
new LocalDocker(
9898
new File("/var/run/docker.sock")
9999
).containers(),
100100
Matchers.notNullValue()
101101
);
102102
}
103103

104104
/**
105-
* LocalDocker can return the Swarm.
105+
* LocalUnixDocker can return the Swarm.
106106
*/
107107
@Test
108108
public void returnsSwarm() {
109109
MatcherAssert.assertThat(
110-
new UnixDocker(
110+
new LocalDocker(
111111
new File("/var/run/docker.sock")
112112
).swarm(),
113113
Matchers.notNullValue()
114114
);
115115
}
116116

117117
/**
118-
* LocalDocker can return Images.
118+
* LocalUnixDocker can return Images.
119119
*/
120120
@Test
121121
public void returnsImages() {
122122
MatcherAssert.assertThat(
123-
new UnixDocker(
123+
new LocalDocker(
124124
new File("/var/run/docker.sock")
125125
).images(),
126126
Matchers.notNullValue()
127127
);
128128
}
129129

130130
/**
131-
* LocalDocker can return its HttpClient.
131+
* LocalUnixDocker can return its HttpClient.
132132
*/
133133
@Test
134134
public void returnsHttpClient() {
135135
MatcherAssert.assertThat(
136-
new UnixDocker(
136+
new LocalDocker(
137137
new File("/var/run/docker.sock")
138138
).httpClient(),
139139
Matchers.allOf(
@@ -144,44 +144,44 @@ public void returnsHttpClient() {
144144
}
145145

146146
/**
147-
* LocalDocker can return Volumes.
147+
* LocalUnixDocker can return Volumes.
148148
*/
149149
@Test
150150
public void returnsVolumes() {
151151
MatcherAssert.assertThat(
152-
new UnixDocker(
152+
new LocalDocker(
153153
new File("/var/run/docker.sock")
154154
).volumes(),
155155
Matchers.notNullValue()
156156
);
157157
}
158158

159159
/**
160-
* LocalDocker throws UnsupportedOperationException for Networks.
160+
* LocalUnixDocker throws UnsupportedOperationException for Networks.
161161
*/
162162
@Test(expected = UnsupportedOperationException.class)
163163
public void unsupportedOperationNetworks() {
164-
new UnixDocker(
164+
new LocalDocker(
165165
new File("/var/run/docker.sock")
166166
).networks();
167167
}
168168

169169
/**
170-
* LocalDocker throws UnsupportedOperationException for Exec.
170+
* LocalUnixDocker throws UnsupportedOperationException for Exec.
171171
*/
172172
@Test(expected = UnsupportedOperationException.class)
173173
public void unsupportedOperationExec() {
174-
new UnixDocker(
174+
new LocalDocker(
175175
new File("/var/run/docker.sock")
176176
).exec();
177177
}
178178

179179
/**
180-
* LocalDocker throws UnsupportedOperationException for Plugins.
180+
* LocalUnixDocker throws UnsupportedOperationException for Plugins.
181181
*/
182182
@Test(expected = UnsupportedOperationException.class)
183183
public void unsupportedOperationPlugins() {
184-
new UnixDocker(
184+
new LocalDocker(
185185
new File("/var/run/docker.sock")
186186
).plugins();
187187
}

src/test/java/com/amihaiemil/docker/RemoteDockerTestCase.java renamed to src/test/java/com/amihaiemil/docker/RemoteTcpDockerTestCase.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
import org.mockito.Mockito;
3838

3939
/**
40+
<<<<<<< HEAD:src/test/java/com/amihaiemil/docker/RemoteDockerTestCase.java
4041
* Unit tests for {@link TcpDocker}.
42+
=======
43+
* Unit tests for {@link RemoteTcpDocker}.
44+
>>>>>>> e464b1a151c7ee5bb102fd9e5034724e7458b29d:src/test/java/com/amihaiemil/docker/RemoteTcpDockerTestCase.java
4145
* @author George Aristy ([email protected])
4246
* @version $Id$
4347
* @since 0.0.1
4448
* @checkstyle MethodName (500 lines)
4549
*/
4650

47-
public final class RemoteDockerTestCase {
51+
public final class RemoteTcpDockerTestCase {
4852

4953
/**
5054
* Ping must be TRUE if response is OK.
@@ -81,7 +85,7 @@ public void pingFalseIfResponseIsNotOk() throws Exception {
8185
}
8286

8387
/**
84-
* RemoteDocker can return the Containers.
88+
* RemoteTcpDockercan return the Containers.
8589
*/
8690
@Test
8791
public void getsContainers() {
@@ -95,7 +99,7 @@ public void getsContainers() {
9599
}
96100

97101
/**
98-
* RemoteDocker can return the Swarm.
102+
* RemoteTcpDockercan return the Swarm.
99103
*/
100104
@Test
101105
public void returnsSwarm() {
@@ -110,7 +114,7 @@ public void returnsSwarm() {
110114

111115

112116
/**
113-
* RemoteDocker can return Images.
117+
* RemoteTcpDockercan return Images.
114118
*/
115119
@Test
116120
public void returnsImages() {
@@ -124,7 +128,7 @@ public void returnsImages() {
124128
}
125129

126130
/**
127-
* LocalDocker can return its HttpClient.
131+
* LocalUnixDocker can return its HttpClient.
128132
*/
129133
@Test
130134
public void returnsHttpClient() {
@@ -142,7 +146,7 @@ public void returnsHttpClient() {
142146
}
143147

144148
/**
145-
* LocalDocker should have AuthHttpClient.
149+
* LocalUnixDocker should have AuthHttpClient.
146150
*/
147151
@Test
148152
public void returnsAuthHttpClient() {
@@ -159,7 +163,7 @@ public void returnsAuthHttpClient() {
159163
}
160164

161165
/**
162-
* RemoteDocker can return Volumes.
166+
* RemoteTcpDockercan return Volumes.
163167
*/
164168
@Test
165169
public void returnsVolumes() {

src/test/java/com/amihaiemil/docker/RtContainerITCase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public void killContainer() throws Exception {
111111
@Test
112112
public void restartContainer() throws Exception {
113113
final Container container = new UnixDocker(
114+
114115
new File("/var/run/docker.sock")
115116
).containers().create("TestRestart", this.containerJsonObject());
116117
container.start();
@@ -165,6 +166,7 @@ public void pauseContainer() throws Exception {
165166
@Test
166167
public void unpauseContainer() throws Exception {
167168
final Container container = new UnixDocker(
169+
168170
new File("/var/run/docker.sock")
169171
).containers().create("TestUnpause", this.containerJsonObject());
170172
container.start();

src/test/java/com/amihaiemil/docker/RtContainersITCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public final class RtContainersITCase {
4444
*/
4545
@Test
4646
public void iteratesContainers() {
47-
final Containers containers = new UnixDocker(
47+
final Containers containers = new LocalDocker(
4848
new File("/var/run/docker.sock")
4949
).containers();
5050
for(final Container container : containers) {

src/test/java/com/amihaiemil/docker/RtDockerSystemITCase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public final class RtDockerSystemITCase {
4545
*/
4646
@Test
4747
public void showDiskSpaceInfo() throws Exception {
48-
final Docker docker = new UnixDocker(
48+
final Docker docker = new LocalDocker(
49+
4950
new File("/var/run/docker.sock")
5051
);
5152
DiskSpaceInfo info = docker.system().diskUsage();

src/test/java/com/amihaiemil/docker/RtImageITCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class RtImageITCase {
4545
*/
4646
@Test
4747
public void returnsHistory() throws Exception {
48-
final Image img = new UnixDocker(
48+
final Image img = new LocalDocker(
4949
new File("/var/run/docker.sock")
5050
).images().pull("hello-world", "latest");
5151
for(final Image parent:img.history()) {

0 commit comments

Comments
 (0)