Skip to content

Commit 5c62e47

Browse files
committed
Revert "Fix unit test failures on Windows"
This reverts commit 0446591.
1 parent 6fa2a82 commit 5c62e47

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

docker-java/src/test/java/com/github/dockerjava/core/DefaultDockerClientConfigTest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.github.dockerjava.api.model.AuthConfigurations;
66
import com.google.common.io.Resources;
77
import org.apache.commons.lang3.SerializationUtils;
8-
import org.apache.commons.lang3.SystemUtils;
98
import org.junit.Test;
109

1110
import java.io.File;
@@ -98,11 +97,8 @@ public void emptyHost() {
9897

9998
DefaultDockerClientConfig config = buildConfig(env, new Properties());
10099

101-
String expectedDefaultHost = SystemUtils.IS_OS_WINDOWS ? DefaultDockerClientConfig.WINDOWS_DEFAULT_DOCKER_HOST
102-
: DefaultDockerClientConfig.DEFAULT_DOCKER_HOST;
103-
104100
assertEquals(
105-
expectedDefaultHost,
101+
DefaultDockerClientConfig.DEFAULT_DOCKER_HOST,
106102
config.getDockerHost().toString()
107103
);
108104
}
@@ -123,9 +119,7 @@ public void defaults() throws Exception {
123119
DefaultDockerClientConfig config = buildConfig(Collections.<String, String> emptyMap(), systemProperties);
124120

125121
// then the cert path is as expected
126-
URI expectedDefaultURI = SystemUtils.IS_OS_WINDOWS ? URI.create(DefaultDockerClientConfig.WINDOWS_DEFAULT_DOCKER_HOST)
127-
: URI.create(DefaultDockerClientConfig.DEFAULT_DOCKER_HOST);
128-
assertEquals(config.getDockerHost(), expectedDefaultURI);
122+
assertEquals(config.getDockerHost(), URI.create("unix:///var/run/docker.sock"));
129123
assertEquals(config.getRegistryUsername(), "someUserName");
130124
assertEquals(config.getRegistryUrl(), AuthConfig.DEFAULT_SERVER_ADDRESS);
131125
assertEquals(config.getApiVersion(), RemoteApiVersion.unknown());

docker-java/src/test/java/com/github/dockerjava/core/util/CompressArchiveUtilTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
44
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
5-
import org.apache.commons.lang3.SystemUtils;
65
import org.junit.Rule;
76
import org.junit.Test;
87
import org.junit.rules.TemporaryFolder;
@@ -23,7 +22,6 @@
2322
import static org.junit.Assert.assertEquals;
2423
import static org.junit.Assert.assertNotNull;
2524
import static org.junit.Assert.assertTrue;
26-
import static org.junit.Assume.assumeFalse;
2725

2826
public class CompressArchiveUtilTest {
2927

@@ -71,7 +69,6 @@ public void tarWithExecutableFileAsInput() throws Exception {
7169

7270
@Test
7371
public void tarWithSymbolicLinkFileAsInput() throws IOException {
74-
assumeSymbolicLinksAreUnrestrictedByDefault();
7572
Path archiveSourceFile = tempFolder.getRoot().toPath().resolve("symlinkFile");
7673
Path linkTargetFile = tempFolder.newFile("link-target").toPath();
7774
Files.createSymbolicLink(archiveSourceFile, linkTargetFile);
@@ -142,7 +139,6 @@ public void tarWithfolderAsInputAndNestedExecutableFile() throws Exception {
142139

143140
@Test
144141
public void tarWithfolderAsInputAndNestedSymbolicLinkFile() throws Exception {
145-
assumeSymbolicLinksAreUnrestrictedByDefault();
146142
Path archiveSourceDir = tempFolder.newFolder("archive-source").toPath();
147143
Path linkTargetFile = tempFolder.newFile("link-target").toPath();
148144
Path symlinkFile = archiveSourceDir.resolve("symlinkFile");
@@ -164,7 +160,6 @@ public void tarWithfolderAsInputAndNestedSymbolicLinkFile() throws Exception {
164160

165161
@Test
166162
public void tarWithfolderAsInputAndNestedSymbolicLinkDir() throws Exception {
167-
assumeSymbolicLinksAreUnrestrictedByDefault();
168163
Path archiveSourceDir = tempFolder.newFolder("archive-source").toPath();
169164
Path linkTargetDir = tempFolder.newFolder("link-target").toPath();
170165
Path symlinkFile = archiveSourceDir.resolve("symlinkFile");
@@ -209,7 +204,6 @@ public void archiveTARFilesWithExecutableFile() throws Exception {
209204

210205
@Test
211206
public void archiveTARFilesWithSymbolicLinkFile() throws Exception {
212-
assumeSymbolicLinksAreUnrestrictedByDefault();
213207
Path linkTargetFile = tempFolder.newFile("link-target").toPath();
214208
Path symlinkFile = tempFolder.getRoot().toPath().resolve("symlinkFile");
215209
Files.createSymbolicLink(symlinkFile, linkTargetFile);
@@ -221,7 +215,6 @@ public void archiveTARFilesWithSymbolicLinkFile() throws Exception {
221215

222216
@Test
223217
public void archiveTARFilesWithSymbolicLinkDir() throws Exception {
224-
assumeSymbolicLinksAreUnrestrictedByDefault();
225218
Path linkTargetDir = tempFolder.newFolder("link-target").toPath();
226219
Path symlinkFile = tempFolder.getRoot().toPath().resolve("symlinkFile");
227220
Files.createSymbolicLink(symlinkFile, linkTargetDir);
@@ -324,8 +317,4 @@ private static int getNumberOfEntryInArchive(File tarArchive) throws IOException
324317
}
325318
return numberOfEntries;
326319
}
327-
328-
private static void assumeSymbolicLinksAreUnrestrictedByDefault(){
329-
assumeFalse(SystemUtils.IS_OS_WINDOWS);
330-
}
331320
}

0 commit comments

Comments
 (0)