Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b23aaf8
Make client test hierarchy.
KostyaSha Sep 6, 2017
7a78e0f
WIP
KostyaSha Sep 6, 2017
060bd55
More junit
KostyaSha Sep 7, 2017
5482c5e
fix expected
KostyaSha Sep 7, 2017
c0c63c1
WIP
KostyaSha Sep 9, 2017
5cf97ae
fixup
KostyaSha Sep 9, 2017
56ae706
WIP
KostyaSha Sep 9, 2017
9e8abeb
Remove logger
KostyaSha Sep 9, 2017
22c5982
all tests
KostyaSha Sep 9, 2017
4159b70
deps
KostyaSha Sep 9, 2017
d8525ee
logging
KostyaSha Sep 9, 2017
ed5873d
disable logging
KostyaSha Sep 9, 2017
22ccca8
Move test file
KostyaSha Sep 9, 2017
ff5f9f7
Fix tests
KostyaSha Sep 9, 2017
5cb6dee
Remove old hierarchy
KostyaSha Sep 9, 2017
a336107
parallel tests
KostyaSha Sep 9, 2017
fa7b3ed
Imports
KostyaSha Sep 9, 2017
590ad33
Change connector
KostyaSha Sep 16, 2017
581ea7c
Categories
KostyaSha Sep 17, 2017
6db5431
some fixes
KostyaSha Sep 17, 2017
23baab6
maven changes
KostyaSha Sep 17, 2017
7080280
fix factory
KostyaSha Sep 17, 2017
132aac2
Fix rule
KostyaSha Sep 17, 2017
c6ba756
pom.xml
KostyaSha Sep 17, 2017
33b32e6
fix image
KostyaSha Sep 17, 2017
695b6f4
Fix pullimagecmdtest
KostyaSha Sep 17, 2017
c3a66ad
No conflicts
KostyaSha Sep 17, 2017
d75bafb
Some fixes
KostyaSha Sep 17, 2017
c11b1e6
Fix parallel
KostyaSha Sep 17, 2017
9bc97c7
more parallel
KostyaSha Sep 17, 2017
c26ea15
no loggers
KostyaSha Sep 17, 2017
17e7ceb
no logging
KostyaSha Sep 19, 2017
e2d99ea
Make unique
KostyaSha Sep 19, 2017
b24faef
no ports
KostyaSha Sep 19, 2017
abafcd6
no run parallel
KostyaSha Sep 19, 2017
19d6ca3
More parallel
KostyaSha Sep 19, 2017
4a766b5
Ensure removed
KostyaSha Sep 19, 2017
c10f17d
Fix assume
KostyaSha Sep 20, 2017
07cabc1
no parallel
KostyaSha Sep 20, 2017
d889540
networks
KostyaSha Sep 20, 2017
36a4892
Less conflicts
KostyaSha Sep 20, 2017
81f235f
add dep
KostyaSha Sep 20, 2017
579cf35
fix parallel
KostyaSha Sep 20, 2017
da87215
Parallel tests
KostyaSha Sep 21, 2017
9a0ecd7
Fix private registry
KostyaSha Sep 21, 2017
20a7320
no parallel for test
KostyaSha Sep 27, 2017
2036dbb
Parallel subnets
KostyaSha Sep 27, 2017
0578149
Fix container name
KostyaSha Sep 27, 2017
cb9451c
no overlapping networks
KostyaSha Sep 27, 2017
f4879f3
parallel test
KostyaSha Sep 27, 2017
309e7f5
other network
KostyaSha Sep 27, 2017
2252c21
Other names
KostyaSha Sep 27, 2017
f96c593
Adjust test
KostyaSha Sep 27, 2017
82ca4db
Exclude conflict
KostyaSha Sep 27, 2017
c3a440d
Exception
KostyaSha Sep 27, 2017
cd8e66c
exception
KostyaSha Sep 28, 2017
8fda860
wip
KostyaSha Sep 28, 2017
03a26c2
new version
KostyaSha Sep 28, 2017
a09ec2d
more versions
KostyaSha Sep 28, 2017
1e33fc8
remove old apis
KostyaSha Sep 28, 2017
f3193c7
version
KostyaSha Sep 28, 2017
9985d1c
errors?
KostyaSha Sep 28, 2017
53e00ef
Adjust?
KostyaSha Sep 28, 2017
f8a60c0
Adjust versions
KostyaSha Sep 28, 2017
819f621
Defailt failsafe mask
KostyaSha Sep 29, 2017
058335a
exclude old
KostyaSha Sep 29, 2017
4d3ff99
api differences
KostyaSha Sep 29, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ env:
- COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]"

matrix:
# - repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="17.09.0~ce-0~ubuntu-trusty"
# - repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="17.09.0~ce-0~ubuntu-trusty"
# - repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="17.06.2~ce-0~ubuntu-trusty" DEPLOY=true COVERITY=true
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="17.05.0~ce-0~ubuntu-trusty" DEPLOY=true COVERITY=true
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2377" DOCKER_VERSION="17.05.0~ce-0~ubuntu-trusty" SWARM_VERSION="1.2.6"
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="17.05.0~ce-0~ubuntu-trusty"
Expand All @@ -30,10 +33,10 @@ env:
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.13.1-0~ubuntu-trusty"
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.12.6-0~ubuntu-trusty"
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.12.6-0~ubuntu-trusty"
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.11.2-0~trusty"
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.11.2-0~trusty"
- repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.10.3-0~trusty"
- repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.10.3-0~trusty"
# - repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.11.2-0~trusty"
# - repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.11.2-0~trusty"
# - repo="main" DOCKER_HOST="tcp://127.0.0.1:2375" DOCKER_VERSION="1.10.3-0~trusty"
# - repo="main" DOCKER_HOST="unix:///var/run/docker.sock" DOCKER_VERSION="1.10.3-0~trusty"
# - repo="testing" DOCKER_HOST="tcp://127.0.0.1:2375"
# - repo="testing" DOCKER_HOST="unix:///var/run/docker.sock"
# - repo="experimental" DOCKER_HOST="tcp://127.0.0.1:2375"
Expand Down
5 changes: 3 additions & 2 deletions .travis/travis-before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ sudo -E stop docker
# sudo apt-get -f install
# sudo dpkg -i "$(ls *${DOCKER_VERSION}*)"
#popd
#rm -f "src/test/resources/logback.xml"
mv "src/test/resources/travis-logback.xml" "src/test/resources/logback.xml"
rm -f "src/test/resources/logback.xml"
#rm -f "src/test/resources/travis-logback.xml"
mv "src/test/resources/travis-logback.xml" "src/test/resources/logback-test.xml"

# https://github.com/docker/docker/issues/18113
sudo rm /var/lib/docker/network/files/local-kv.db
Expand Down
43 changes: 19 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<jdk.source>1.7</jdk.source>
<jdk.target>1.7</jdk.target>

<jersey.version>2.23.1</jersey.version>
<jersey.version>2.26</jersey.version>
<jackson-jaxrs.version>2.6.4</jackson-jaxrs.version>
<httpclient.version>4.5</httpclient.version><!-- 4.5.1-4.5.2 broken -->
<commons-compress.version>1.12</commons-compress.version>
Expand All @@ -71,8 +71,7 @@
<guava.version>19.0</guava.version>

<!-- test dependencies -->
<logback.version>1.1.7</logback.version>
<testng.version>6.9.10</testng.version>
<logback.version>1.2.3</logback.version>
<netty.version>4.1.14.Final</netty.version>
<hamcrest.library.version>1.3</hamcrest.library.version>
<hamcrest.jpa-matchers>1.8</hamcrest.jpa-matchers>
Expand All @@ -83,8 +82,8 @@
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>2.20</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>2.20</maven-failsafe-plugin.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
<maven-bundlor-plugin.version>1.1.2.RELEASE</maven-bundlor-plugin.version>
<maven-build-helper-plugin.version>3.0.0</maven-build-helper-plugin.version>
Expand Down Expand Up @@ -122,6 +121,11 @@
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.kohlschutter.junixsocket</groupId>
<artifactId>junixsocket-common</artifactId>
Expand Down Expand Up @@ -189,13 +193,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
Expand Down Expand Up @@ -430,7 +427,7 @@
<version>${maven-surefire-plugin.version}</version>
<configuration>
<rerunFailingTestsCount>3</rerunFailingTestsCount>
<excludedGroups>integration,integration-auth,swarm-integration</excludedGroups>
<excludedGroups>com.github.dockerjava.junit.category.Integration</excludedGroups>
</configuration>
</plugin>

Expand All @@ -444,19 +441,17 @@
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<rerunFailingTestsCount>3</rerunFailingTestsCount>
<useUnlimitedThreads>true</useUnlimitedThreads>
<perCoreThreadCount>true</perCoreThreadCount>
<threadCount>1</threadCount>
<groups>integration</groups>
<excludedGroups>integration-auth,swarm-integration</excludedGroups>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<rerunFailingTestsCount>3</rerunFailingTestsCount>
<!--<useUnlimitedThreads>true</useUnlimitedThreads>-->
<perCoreThreadCount>true</perCoreThreadCount>
<threadCount>1</threadCount>
<parallel>classes</parallel>
<groups>com.github.dockerjava.junit.category.Integration</groups>
<excludedGroups>com.github.dockerjava.junit.category.AuthIntegration,com.github.dockerjava.junit.category.SwarmModeIntegration</excludedGroups>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/github/dockerjava/core/RemoteApiVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public class RemoteApiVersion implements Serializable {
*/
public static final RemoteApiVersion VERSION_1_25 = RemoteApiVersion.create(1, 25);

public static final RemoteApiVersion VERSION_1_26 = RemoteApiVersion.create(1, 26);
public static final RemoteApiVersion VERSION_1_27 = RemoteApiVersion.create(1, 27);
public static final RemoteApiVersion VERSION_1_29 = RemoteApiVersion.create(1, 29);


/**
* Unknown, docker doesn't reflect reality. I.e. we implemented method, but for javadoc it not clear when it was added.
Expand All @@ -88,6 +92,11 @@ public boolean isGreaterOrEqual(final RemoteApiVersion other) {
return false;
}

@Override
public boolean isGreater(RemoteApiVersion other) {
return false;
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this).addValue("UNKNOWN_VERSION").toString();
Expand Down Expand Up @@ -146,6 +155,11 @@ public boolean isGreaterOrEqual(final RemoteApiVersion other) {
return false;
}

public boolean isGreater(final RemoteApiVersion other) {
return major > other.major || (major == other.major && minor > other.minor);

}

/**
* @return String representation of version. i.e. "1.22"
*/
Expand Down Expand Up @@ -179,4 +193,5 @@ public String toString() {
public String asWebPathPart() {
return "v" + major + "." + minor;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@
import com.github.dockerjava.api.model.Frame;

/**
* Attach to container
*
* @param logs
* - true or false, includes logs. Defaults to false.
*
* @param followStream
* - true or false, return stream. Defaults to false.
* @param stdout
* - true or false, includes stdout log. Defaults to false.
* @param stderr
* - true or false, includes stderr log. Defaults to false.
* @param stdin
* - null or {@link InputStream}, pass stream to stdin of the container.
* @param timestamps
* - true or false, if true, print timestamps for every log line. Defaults to false.
* Attach to container.
*/
public class AttachContainerCmdImpl extends AbstrAsyncDockerCmd<AttachContainerCmd, Frame> implements
AttachContainerCmd {
public class AttachContainerCmdImpl extends AbstrAsyncDockerCmd<AttachContainerCmd, Frame>
implements AttachContainerCmd {

private String containerId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import com.github.dockerjava.api.model.ResponseItem;
import com.google.common.reflect.ClassPath.ClassInfo;
import org.apache.commons.lang.reflect.FieldUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;

import java.io.IOException;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@

import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.dockerjava.api.model.Event;
import com.github.dockerjava.core.RemoteApiVersion;
import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip;
import java.io.IOException;
import org.junit.Test;

import org.testng.annotations.Test;
import java.io.IOException;

import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip;
import static com.github.dockerjava.test.serdes.JSONTestHelper.testRoundTrip;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyString;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.IsNot.not;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
* Tests for {@link InspectContainerResponse}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.dockerjava.core.RemoteApiVersion;
import org.testng.annotations.Test;
import org.junit.Test;

import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.dockerjava.api.model.ContainerConfig;
import org.testng.annotations.Test;
import org.junit.Test;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -191,7 +191,7 @@ public void serder1_22_inspect_doc() throws IOException {
}

@Test
private void testOverlayNetworkRootDir() throws IOException {
public void testOverlayNetworkRootDir() throws IOException {
final ObjectMapper mapper = new ObjectMapper();
final JavaType type = mapper.getTypeFactory().constructType(InspectImageResponse.class);

Expand Down
15 changes: 12 additions & 3 deletions src/test/java/com/github/dockerjava/api/model/AccessModeTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package com.github.dockerjava.api.model;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import static com.github.dockerjava.api.model.AccessMode.rw;
import static org.testng.Assert.assertEquals;
import static org.junit.Assert.assertEquals;

import org.testng.annotations.Test;

public class AccessModeTest {

@Rule
public ExpectedException expectedEx = ExpectedException.none();

@Test
public void defaultAccessMode() {
assertEquals(AccessMode.DEFAULT, rw);
Expand All @@ -22,8 +28,11 @@ public void fromString() {
assertEquals(AccessMode.valueOf("rw"), rw);
}

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "No enum const.*")
@Test
public void fromIllegalString() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("No enum const");

AccessMode.valueOf("xx");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.dockerjava.core.RemoteApiVersion;
import org.testng.annotations.Test;
import org.junit.Test;

import java.io.IOException;

Expand All @@ -12,7 +12,7 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.notNullValue;
import static org.testng.Assert.assertEquals;
import static org.junit.Assert.assertEquals;

public class AuthConfigTest {

Expand Down
24 changes: 19 additions & 5 deletions src/test/java/com/github/dockerjava/api/model/BindTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package com.github.dockerjava.api.model;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import static com.github.dockerjava.api.model.AccessMode.ro;
import static com.github.dockerjava.api.model.AccessMode.rw;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;

import org.testng.annotations.Test;

public class BindTest {

@Rule
public ExpectedException expectedEx = ExpectedException.none();

@Test
public void parseUsingDefaultAccessMode() {
Bind bind = Bind.parse("/host:/container");
Expand Down Expand Up @@ -128,18 +133,27 @@ public void parseReadOnlySEL() {
assertThat(bind.getPropagationMode(), is(PropagationMode.DEFAULT_MODE));
}

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Error parsing Bind.*")
@Test
public void parseInvalidAccessMode() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage( "Error parsing Bind");

Bind.parse("/host:/container:xx");
}

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Error parsing Bind 'nonsense'")
@Test
public void parseInvalidInput() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Error parsing Bind 'nonsense'");

Bind.parse("nonsense");
}

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Error parsing Bind 'null'")
@Test
public void parseNull() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Error parsing Bind 'null'");

Bind.parse(null);
}

Expand Down
Loading