From 51e255523ca45a855ad80aba1a5ea2edc46e9d9a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Feb 2025 22:17:37 +0200 Subject: [PATCH] upgrading all outdated and vulnerable dependencies to their latest stable versions --- .github/dependabot.yml | 12 +- .github/stale.yml | 1 - .github/workflows/ci.yml | 2 +- .mvn/wrapper/MavenWrapperDownloader.java | 15 +- CHANGELOG.md | 452 ++++--- CONTRIBUTING.md | 41 +- README.md | 3 +- circle.md | 28 +- docker-java-api/pom.xml | 21 +- .../dockerjava/api/async/ResultCallback.java | 12 +- .../api/async/ResultCallbackTemplate.java | 32 +- .../dockerjava/api/command/ListImagesCmd.java | 3 +- .../dockerjava/api/model/AccessMode.java | 8 +- .../dockerjava/api/model/AuthConfig.java | 1 + .../com/github/dockerjava/api/model/Bind.java | 74 +- .../github/dockerjava/api/model/Binds.java | 8 +- .../dockerjava/api/model/ChangeLog.java | 2 - .../dockerjava/api/model/ClusterInfo.java | 1 + .../github/dockerjava/api/model/Device.java | 4 +- .../github/dockerjava/api/model/Event.java | 1 - .../dockerjava/api/model/ExposedPort.java | 37 +- .../dockerjava/api/model/HealthCheck.java | 5 +- .../dockerjava/api/model/Identifier.java | 4 +- .../github/dockerjava/api/model/Image.java | 3 - .../com/github/dockerjava/api/model/Link.java | 12 +- .../github/dockerjava/api/model/Links.java | 8 +- .../github/dockerjava/api/model/Ports.java | 38 +- .../dockerjava/api/model/Repository.java | 3 +- .../dockerjava/api/model/SELContext.java | 20 +- .../dockerjava/api/model/SearchItem.java | 2 - .../dockerjava/api/model/Statistics.java | 9 +- .../github/dockerjava/api/model/Volume.java | 3 + .../github/dockerjava/api/model/VolumeRW.java | 8 +- .../github/dockerjava/api/model/Volumes.java | 14 +- .../dockerjava/api/model/VolumesRW.java | 18 +- .../api/model/DockerObjectArchTest.java | 2 +- docker-java-core/pom.xml | 7 +- docker-java-transport-httpclient5/pom.xml | 8 +- docker-java-transport-jersey/pom.xml | 9 +- .../jaxrs/JerseyDockerCmdExecFactory.java | 4 +- .../jaxrs/JerseyDockerHttpClient.java | 20 +- .../jaxrs/filter/FollowRedirectsFilter.java | 8 +- .../jaxrs/filter/JsonClientFilter.java | 8 +- .../jaxrs/filter/LoggingFilter.java | 28 +- .../filter/ResponseStatusExceptionFilter.java | 8 +- .../jaxrs/filter/SelectiveLoggingFilter.java | 6 +- .../util/WrappedResponseInputStream.java | 3 +- docker-java-transport-okhttp/pom.xml | 8 +- .../okhttp/HijackingInterceptor.java | 4 +- docker-java-transport-tck/pom.xml | 9 +- docker-java-transport-zerodep/pom.xml | 1 + docker-java-transport/pom.xml | 13 +- docker-java/pom.xml | 31 +- .../dockerjava/core/DockerClientBuilder.java | 3 - .../api/ModelsSerializableTest.java | 16 +- .../api/command/CommandJSONSamples.java | 2 +- .../command/InspectContainerResponseTest.java | 2 +- .../api/command/InspectExecResponseTest.java | 10 +- .../api/command/InspectImageResponseTest.java | 162 +-- .../dockerjava/api/model/AuthConfigTest.java | 25 +- .../api/model/BindPropagationTest.java | 2 +- .../github/dockerjava/api/model/BindTest.java | 2 +- .../dockerjava/api/model/BindsTest.java | 10 +- .../dockerjava/api/model/ContainerTest.java | 6 +- .../dockerjava/api/model/DeviceTest.java | 26 +- .../dockerjava/api/model/EventsTest.java | 24 +- .../dockerjava/api/model/HostConfigTest.java | 2 +- .../github/dockerjava/api/model/InfoTest.java | 274 ++-- .../dockerjava/api/model/LinksTest.java | 10 +- .../dockerjava/api/model/PortBindingTest.java | 2 +- .../api/model/PortsAddBindingsTest.java | 6 +- .../api/model/PullResponseItemTest.java | 10 +- .../api/model/PullResponseJSONSamples.java | 2 +- .../api/model/RestartPolicyToStringTest.java | 2 +- .../dockerjava/api/model/StatisticsTest.java | 8 +- .../dockerjava/api/model/UlimitsTest.java | 14 +- .../dockerjava/api/model/VersionTest.java | 14 +- .../dockerjava/api/model/VolumeBindsTest.java | 6 +- .../dockerjava/api/model/VolumesRWTest.java | 10 +- .../dockerjava/api/model/VolumesTest.java | 10 +- .../dockerjava/cmd/AttachContainerCmdIT.java | 3 +- .../dockerjava/cmd/BuildImageCmdIT.java | 82 +- .../github/dockerjava/cmd/CommitCmdIT.java | 18 +- .../dockerjava/cmd/ConnectToNetworkCmdIT.java | 2 +- .../dockerjava/cmd/ContainerDiffCmdIT.java | 4 +- .../cmd/CopyArchiveFromContainerCmdIT.java | 10 +- .../cmd/CopyArchiveToContainerCmdIT.java | 76 +- .../cmd/CopyFileFromContainerCmdIT.java | 6 +- .../dockerjava/cmd/CreateContainerCmdIT.java | 344 ++--- .../dockerjava/cmd/CreateNetworkCmdIT.java | 11 +- .../dockerjava/cmd/CreateVolumeCmdIT.java | 6 +- .../cmd/DisconnectFromNetworkCmdIT.java | 16 +- .../github/dockerjava/cmd/EventsCmdIT.java | 16 +- .../dockerjava/cmd/ExecCreateCmdImplIT.java | 4 +- .../github/dockerjava/cmd/ExecStartCmdIT.java | 26 +- .../github/dockerjava/cmd/HealthCmdIT.java | 4 +- .../com/github/dockerjava/cmd/InfoCmdIT.java | 6 +- .../dockerjava/cmd/InspectContainerCmdIT.java | 22 +- .../dockerjava/cmd/InspectExecCmdIT.java | 19 +- .../dockerjava/cmd/InspectVolumeCmdIT.java | 2 +- .../dockerjava/cmd/KillContainerCmdIT.java | 2 +- .../dockerjava/cmd/ListContainersCmdIT.java | 247 ++-- .../dockerjava/cmd/ListImagesCmdIT.java | 10 +- .../dockerjava/cmd/ListVolumesCmdIT.java | 4 +- .../github/dockerjava/cmd/LoadImageCmdIT.java | 6 +- .../dockerjava/cmd/LogContainerCmdIT.java | 66 +- .../com/github/dockerjava/cmd/PauseCmdIT.java | 2 +- .../github/dockerjava/cmd/PullImageCmdIT.java | 44 +- .../github/dockerjava/cmd/PushImageCmdIT.java | 48 +- .../cmd/RemoveContainerCmdImplIT.java | 2 +- .../dockerjava/cmd/RemoveImageCmdIT.java | 4 +- .../dockerjava/cmd/RemoveNetworkCmdIT.java | 4 +- .../dockerjava/cmd/RemoveVolumeCmdIT.java | 8 +- .../dockerjava/cmd/RenameContainerCmdIT.java | 8 +- .../dockerjava/cmd/ResizeExecCmdIT.java | 2 +- .../dockerjava/cmd/SaveImagesCmdIT.java | 2 +- .../dockerjava/cmd/SearchImagesCmdIT.java | 4 +- .../dockerjava/cmd/StartContainerCmdIT.java | 162 +-- .../dockerjava/cmd/StopContainerCmdIT.java | 6 +- .../dockerjava/cmd/UpdateContainerCmdIT.java | 22 +- .../github/dockerjava/cmd/VersionCmdIT.java | 2 +- .../dockerjava/cmd/WaitContainerCmdIT.java | 6 +- .../cmd/swarm/CreateSecretCmdExecIT.java | 10 +- .../cmd/swarm/CreateServiceCmdExecIT.java | 106 +- .../cmd/swarm/InitializeSwarmCmdExecIT.java | 36 +- .../cmd/swarm/JoinSwarmCmdExecIT.java | 20 +- .../cmd/swarm/LeaveSwarmCmdExecIT.java | 4 +- .../cmd/swarm/ListSecretCmdExecIT.java | 10 +- .../cmd/swarm/ListServicesCmdExecIT.java | 10 +- .../cmd/swarm/ListTasksCmdExecIT.java | 10 +- .../cmd/swarm/LogSwarmObjectIT.java | 8 +- .../cmd/swarm/RemoveSwarmNodeCmdExecIT.java | 12 +- .../cmd/swarm/UpdateSwarmCmdExecIT.java | 34 +- .../cmd/swarm/UpdateSwarmNodeIT.java | 2 +- .../cmd/swarm/UpdateSwarmServiceIT.java | 12 +- .../core/DefaultDockerClientConfigTest.java | 19 +- .../dockerjava/core/DockerConfigFileTest.java | 52 +- .../github/dockerjava/core/DockerRule.java | 36 +- .../dockerjava/core/GoLangFileMatchTest.java | 122 +- .../dockerjava/core/NameParserTest.java | 4 +- .../core/command/DockerfileFixture.java | 4 +- .../core/command/FrameReaderITest.java | 12 +- .../DockerfileAddMultipleFilesTest.java | 6 +- .../DockerfileStatementAddTest.java | 14 +- .../core/util/CertificateUtilsTest.java | 2 +- .../core/util/CompressArchiveUtilTest.java | 31 +- .../dockerjava/junit/DockerMatchers.java | 4 +- .../dockerjava/junit/PrivateRegistryRule.java | 40 +- .../suite/IntegrationDockerTestSuite.java | 28 +- .../NettyDockerCmdExecFactoryConfigTest.java | 4 +- .../dockerjava/netty/NettyWebTargetTest.java | 8 +- .../FramedResponseStreamHandlerTest.java | 316 ++--- .../test/serdes/AbstractJSONResourceRef.java | 4 +- .../test/serdes/JSONResourceRef.java | 6 +- .../dockerjava/test/serdes/JSONSamples.java | 2 +- .../test/serdes/JSONTestHelper.java | 72 +- .../registry.v2/config.json | 8 +- .../inspectContainerResponse_empty.json | 223 ++-- .../inspectContainerResponse_full.json | 295 ++--- .../inspectContainerResponse_full_1_21.json | 278 ++-- .../inspectContainerResponse_full_1_26a.json | 308 ++--- .../inspectContainerResponse_full_1_26b.json | 352 +++--- .../pullImageResponse_alreadyExists.json | 4 +- .../api/model/pullImageResponse_error.json | 7 +- .../api/model/pullImageResponse_legacy.json | 4 +- .../model/pullImageResponse_newerImage.json | 4 +- .../api/model/pullImageResponse_upToDate.json | 4 +- .../dockerContextHomeDir/.docker/config.json | 4 +- docker-java/src/test/resources/logback.xml | 26 +- .../1.22/containers/container/json/1.json | 282 ++--- .../containers/container/update/docs.json | 20 +- .../samples/1.22/containers/create/docs.json | 250 ++-- .../samples/1.22/containers/json/filter1.json | 68 +- .../resources/samples/1.22/exec/ID/1.json | 32 +- .../samples/1.22/images/docImage/doc.json | 168 +-- .../1.22/images/docImage/inspect_doc.json | 280 ++-- .../samples/1.22/images/image1/inspect1.json | 132 +- .../1.22/images/overlay/inspectOverlay.json | 176 +-- .../test/resources/samples/1.22/info/1.json | 174 +-- .../test/resources/samples/1.22/info/2.json | 325 +++-- .../resources/samples/1.22/info/docs.json | 144 +-- .../samples/1.22/other/AuthConfig/docs1.json | 6 +- .../samples/1.22/other/AuthConfig/docs2.json | 2 +- .../resources/samples/1.22/version/1.json | 16 +- .../samples/1.23/other/AuthConfig/docs1.json | 6 +- .../samples/1.24/containers/inspect/1.json | 310 ++--- .../resources/samples/1.24/events/docs1.json | 30 +- .../samples/1.25/images/windowsImage/doc.json | 138 +- .../1.25/other/AuthConfig/orchestrators.json | 4 +- .../containers/container/stats/stats1.json | 363 +++--- .../samples/1.38/containers/inspect/lcow.json | 322 ++--- .../resources/samples/1.38/info/lcow.json | 210 +-- .../resources/samples/1.38/version/lcow.json | 55 +- .../resources/someHomeDir/.docker/config.json | 9 +- .../validDockerConfig/config.json | 14 +- .../config.json | 4 +- .../validJsonWithOnlyUnknown/config.json | 2 +- .../validJsonWithUnknown/config.json | 18 +- .../src/test/resources/travis-logback.xml | 24 +- docs/getting_started.md | 19 +- docs/transports.md | 109 +- etc/certs/README.md | 10 +- etc/docker-java-formatter.xml | 1124 ++++++++--------- pom.xml | 77 +- .../checkstyle/checkstyle-config.xml | 328 ++--- 205 files changed, 5516 insertions(+), 5392 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7dec19aef..b3dc51509 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,8 @@ version: 2 updates: -- package-ecosystem: maven - directory: "/" - schedule: - interval: weekly - open-pull-requests-limit: 99 - rebase-strategy: disabled + - package-ecosystem: maven + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 99 + rebase-strategy: disabled diff --git a/.github/stale.yml b/.github/stale.yml index 23aefd1f3..61a573bb5 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,4 +1,3 @@ - daysUntilStale: 90 daysUntilClose: 30 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7aaef550..919ab79f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: - pull_request: {} + pull_request: { } push: { branches: [ main ] } workflow_dispatch: diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java index b901097f2..f7179fce9 100644 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import java.net.*; import java.io.*; import java.nio.channels.*; @@ -32,13 +33,13 @@ public class MavenWrapperDownloader { * use instead of the default one. */ private static final String MAVEN_WRAPPER_PROPERTIES_PATH = - ".mvn/wrapper/maven-wrapper.properties"; + ".mvn/wrapper/maven-wrapper.properties"; /** * Path where the maven-wrapper.jar will be saved to. */ private static final String MAVEN_WRAPPER_JAR_PATH = - ".mvn/wrapper/maven-wrapper.jar"; + ".mvn/wrapper/maven-wrapper.jar"; /** * Name of the property which should be used to override the default download url for the wrapper. @@ -54,7 +55,7 @@ public static void main(String args[]) { // wrapperUrl parameter. File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); String url = DEFAULT_DOWNLOAD_URL; - if(mavenWrapperPropertyFile.exists()) { + if (mavenWrapperPropertyFile.exists()) { FileInputStream mavenWrapperPropertyFileInputStream = null; try { mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); @@ -65,7 +66,7 @@ public static void main(String args[]) { System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); } finally { try { - if(mavenWrapperPropertyFileInputStream != null) { + if (mavenWrapperPropertyFileInputStream != null) { mavenWrapperPropertyFileInputStream.close(); } } catch (IOException e) { @@ -76,10 +77,10 @@ public static void main(String args[]) { System.out.println("- Downloading from: " + url); File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); - if(!outputFile.getParentFile().exists()) { - if(!outputFile.getParentFile().mkdirs()) { + if (!outputFile.getParentFile().exists()) { + if (!outputFile.getParentFile().mkdirs()) { System.out.println( - "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); } } System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d344d93b..2fd0245fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,17 @@ Change Log === - ## 3.2.0 + - **Changelog is not maintained in this file. Please follow git diff or github releases.** - Library was split into multiple modules to get ability to choose transports. -Okhttp was added (say thanks to @bsideup). -- Various cleanup, tests de-duplication internally. Planned binary compatibility breakage was reverted by @testcontainers project, so migration should work smoothly. Please switch to non-deprecated methods. + Okhttp was added (say thanks to @bsideup). +- Various cleanup, tests de-duplication internally. Planned binary compatibility breakage was reverted by @testcontainers project, so + migration should work smoothly. Please switch to non-deprecated methods. - Appeared various new commands and Fields(command options for existing commands). ## 3.1.2 + - update unix-socket to 2.2.0 - Remove `JacksonJaxbJsonProvider` from `FiltersEncoder` - BuildImageCmdImpl: Fix an exception message @@ -17,23 +19,28 @@ Okhttp was added (say thanks to @bsideup). - Add prune operations - Updating Jackson due to CVEs - Make StatsConfig public -- Set 3 mb as limit for json responce. +- Set 3 mb as limit for json responce. ## 3.1.1 + - Patch save image with tag - [api/healthcheck] startPeriod is now a long -## 3.1.0 +## 3.1.0 + - Release ## 3.1.0-rc-8 + - Do awaitCompletion upon socket close exception - Fix `X-Registry-Auth` base64 encoding ## 3.1.0-rc-7 + - Fix NPE when docker config file doesn't exist ## 3.1.0-rc-6 + - Add resize feature to container and exec - Update part of apis to 1.37 - Update dependencies @@ -48,6 +55,7 @@ Okhttp was added (say thanks to @bsideup). - Fix for ignore all files except specified ## 3.1.0-rc-5 + - Add missing properties in InspectContainer response - Add withFilter methods in ListNetworksCmd & ListVolumesCmd - Add WorkingDir property in containers exec @@ -59,6 +67,7 @@ Okhttp was added (say thanks to @bsideup). - Allow netty to handle compressed response bodies ## 3.1.0-rc-4 + - Update deps - fix HTTP/1.1 compliance (missing Host header) - support rollback_completed value in ServiceUpdateState @@ -66,7 +75,7 @@ Okhttp was added (say thanks to @bsideup). - Encode spaces as %20 rather than + in URL params - Add tmpfs mount support since v1.29 - Add support for swarm service/task logs -- Add mapping annotations to custom constructor +- Add mapping annotations to custom constructor - Support network mode as part of the docker build - support "rollback" as value for UpdateFailureAction - Add "Pid" field to InspectExecResponse @@ -74,117 +83,141 @@ Okhttp was added (say thanks to @bsideup). - Add AutoRemove to HostConfig - follow symbolic links when walking dir - Use path from the configured docker host instead of hardcoded "/var/run/docker.sock" in netty factory -- Configure JerseyDockerCmdExecFactory to avoid chunked encoding +- Configure JerseyDockerCmdExecFactory to avoid chunked encoding ## 3.1.0-rc-3 + - export TmpFs configuration for HostConfig and DockerClient - avoid double encoding for url query string ## 3.1.0-rc-2 + - https://github.com/docker-java/docker-java/pulls?q=is%3Apr+milestone%3A3.1.0-rc-2+is%3Aclosed ## 3.1.0-rc-1 - A lot of changes... + +A lot of changes... + - Swarm Mode support. - Classic swarm support. - various netty improvements -- Implement AbstractDockerCmdExecFactory - - +- Implement AbstractDockerCmdExecFactory + ## 3.0.14 + - Encode spaces as %20 rather than + in URL params ## 3.0.13 + - Fix .dockerignore handling on Windows - Include empty directories in build context - + ## 3.0.12 + - Make NettyDockerCmdExecFactory has compatibility both Linux and OSX automatically - Fix double encoding for netty. - filter config.json before unmarshalling (creds/auth) ## 3.0.11 + - Add labels and attachable properties to network. - Set default socket timeout for RequestConfig. - Netty skip instead of throw error on non-linux os. - Clean tmp file after upload. - Filters ignore application/x-tar. - Allow user to call connectionManager's closeIdleConnections. - + ## 3.0.10 + - Support for cache-from in build image command -- Allow multiple tags in build image command -- Custom `db` logging type +- Allow multiple tags in build image command +- Custom `db` logging type - Allow an explicit Dockerfile location string to be specified to theuild command - Fix image build for docker 17 with 'tagged' word. - + ## 3.0.9 -- NettyDockerCmdExecFactory ignores API version + +- NettyDockerCmdExecFactory ignores API version - exclude commons-logging from httpclient since docker-java uses slf4j/logback - Generate OSGi compliant manifest - AuthResponse may contains token. ## 3.0.8 - - Use TLSv1.2 by default - - Health api - - Labels - - Support for multiple certificates + +- Use TLSv1.2 by default +- Health api +- Labels +- Support for multiple certificates ## 3.0.7 - * https://github.com/docker-java/docker-java/milestone/17?closed=1 - * HostConfig pidLimits - * Label image during build - * Expose 'User' property on ExecCreateCmd #707 #708 + +* https://github.com/docker-java/docker-java/milestone/17?closed=1 +* HostConfig pidLimits +* Label image during build +* Expose 'User' property on ExecCreateCmd #707 #708 ## 3.0.6 - * Fixed issue with jersey and unix domain sockets. - * [#703](https://github.com/docker-java/docker-java/pull/703) Allow to configure connection pool timeout. - * Make all models Serializable. - * [NETTY] Fix loadImage responce on 1.24 API. - * LogPath field for inspect container. - * [#700] (https://github.com/docker-java/docker-java/pull/700) Bugfix:donot throw RuntimeException when a error occured in awaitCompletion(long,TimeUnit) + +* Fixed issue with jersey and unix domain sockets. +* [#703](https://github.com/docker-java/docker-java/pull/703) Allow to configure connection pool timeout. +* Make all models Serializable. +* [NETTY] Fix loadImage responce on 1.24 API. +* LogPath field for inspect container. +* [#700] (https://github.com/docker-java/docker-java/pull/700) Bugfix:donot throw RuntimeException when a error occured in awaitCompletion( + long,TimeUnit) ## 3.0.5 - * Events updated to 1.24 API model. + +* Events updated to 1.24 API model. ## 3.0.4 - * Make cert util methods public. + +* Make cert util methods public. ## 3.0.3 - * [JERSEY] Don't send body for start container request. + +* [JERSEY] Don't send body for start container request. ## 3.0.2 - * Enhanced Dockerignore filtering. - * Added shmsize for hostconfig. - * Exposed HostConfig instead of spaghetty calls. + +* Enhanced Dockerignore filtering. +* Added shmsize for hostconfig. +* Exposed HostConfig instead of spaghetty calls. ## 3.0.1 All changes + * Updated all dependencies -* [#643] (https://github.com/docker-java/docker-java/pull/643) Fixes for .dockerignore filtering -* [#627] (https://github.com/docker-java/docker-java/pull/627) Implementation of POST /images/load endpoint -* [#630] (https://github.com/docker-java/docker-java/pull/630) Fix: Second execution of a docker command in Netty implementation always fails -* [#596] (https://github.com/docker-java/docker-java/pull/596) Refactor configuration of SSL to allow override with custom config -* [#529] (https://github.com/docker-java/docker-java/pull/529) Refactor CertUtils. Support ECDSA and PrivateKey +* [#643] (https://github.com/docker-java/docker-java/pull/643) Fixes for .dockerignore filtering +* [#627] (https://github.com/docker-java/docker-java/pull/627) Implementation of POST /images/load endpoint +* [#630] (https://github.com/docker-java/docker-java/pull/630) Fix: Second execution of a docker command in Netty implementation always + fails +* [#596] (https://github.com/docker-java/docker-java/pull/596) Refactor configuration of SSL to allow override with custom config +* [#529] (https://github.com/docker-java/docker-java/pull/529) Refactor CertUtils. Support ECDSA and PrivateKey * [#593] (https://github.com/docker-java/docker-java/pull/593) Added Device.parse() method with simple verification. v3.0.0 --- Notes -* The 3.0.0 release contains multiple API breaking changes compared to 2.x therefore the major version switch. It supports a subset of v.1.22 of the docker remote API. It also includes an experimental netty based implementation of `DockerCmdExecFactory` that probably will replace the current jersey/httpclient based one in a later release. Take a look at the [Wiki](https://github.com/docker-java/docker-java/wiki#intialize-docker-client-advanced) how to use it. -* The configuration has been changed to better match the docker CLI configuration options. The properties file was renamed from `docker.io.properties` to `docker-java.properties`. See README.md for details. +* The 3.0.0 release contains multiple API breaking changes compared to 2.x therefore the major version switch. It supports a subset of + v.1.22 of the docker remote API. It also includes an experimental netty based implementation of `DockerCmdExecFactory` that probably will + replace the current jersey/httpclient based one in a later release. Take a look at + the [Wiki](https://github.com/docker-java/docker-java/wiki#intialize-docker-client-advanced) how to use it. +* The configuration has been changed to better match the docker CLI configuration options. The properties file was renamed from + `docker.io.properties` to `docker-java.properties`. See README.md for details. All changes -* [#590] (https://github.com/docker-java/docker-java/pull/590) Fix default docker.properties to match with docker CLI defaults + +* [#590] (https://github.com/docker-java/docker-java/pull/590) Fix default docker.properties to match with docker CLI defaults * [#585] (https://github.com/docker-java/docker-java/pull/585) Add RootDir property to GraphData -* [#580] (https://github.com/docker-java/docker-java/pull/580) Fixes execute permissions for files when copied to container -* [#579] (https://github.com/docker-java/docker-java/pull/579) Adds missing name filter evaluation to netty version of ListImagesCmdExec +* [#580] (https://github.com/docker-java/docker-java/pull/580) Fixes execute permissions for files when copied to container +* [#579] (https://github.com/docker-java/docker-java/pull/579) Adds missing name filter evaluation to netty version of ListImagesCmdExec * [#578] (https://github.com/docker-java/docker-java/pull/578) Fix error during image build when Dockerfile in subdirectory of build context * [#575] (https://github.com/docker-java/docker-java/pull/575) Support binding of port ranges * [#574] (https://github.com/docker-java/docker-java/pull/574) Fix for copyArchiveToContainerCmd bug -* [#572] (https://github.com/docker-java/docker-java/pull/572) Inspect container command now shows sizes if requested +* [#572] (https://github.com/docker-java/docker-java/pull/572) Inspect container command now shows sizes if requested * [#563] (https://github.com/docker-java/docker-java/pull/563) Fix memory leak in netty implementation of DockerCmdExecFactory * [#550] (https://github.com/docker-java/docker-java/pull/550) Add ability to configure IPAM config for CreateNetworkCmd * [#484] (https://github.com/docker-java/docker-java/pull/484) Implement missing network api options for v1.22 @@ -192,107 +225,124 @@ All changes Included in 3.0.0-RC5 * [#542] (https://github.com/docker-java/docker-java/pull/542) Fix large volumes of output from "docker exec" trigger out of memory error -* [#541] (https://github.com/docker-java/docker-java/pull/541) ImageInspectResponse.GraphDriver.Data is more complex structure +* [#541] (https://github.com/docker-java/docker-java/pull/541) ImageInspectResponse.GraphDriver.Data is more complex structure * [#534] (https://github.com/docker-java/docker-java/pull/534) Fix create volume command doesn't assign passed in volume driverOpts to field -* [#533] (https://github.com/docker-java/docker-java/pull/533) Added shmsize build option +* [#533] (https://github.com/docker-java/docker-java/pull/533) Added shmsize build option Included in 3.0.0-RC4 + * [#528] (https://github.com/docker-java/docker-java/pull/528) Fix DOCKER_TLS_VERIFY cannot be 'false' or empty -* [#527] (https://github.com/docker-java/docker-java/pull/527) Fix `mirrors` field is list and not a single string #527 +* [#527] (https://github.com/docker-java/docker-java/pull/527) Fix `mirrors` field is list and not a single string #527 * [#510] (https://github.com/docker-java/docker-java/pull/510) Add CgroupParent option for create cmd -* [#509] (https://github.com/docker-java/docker-java/pull/509) Implement container rename api -* [#501] (https://github.com/docker-java/docker-java/pull/501) Fix execution of copy file/archive command skips 0xFF bytes +* [#509] (https://github.com/docker-java/docker-java/pull/509) Implement container rename api +* [#501] (https://github.com/docker-java/docker-java/pull/501) Fix execution of copy file/archive command skips 0xFF bytes * [#500] (https://github.com/docker-java/docker-java/pull/500) Add aux to ResponseItem * [#498] (https://github.com/docker-java/docker-java/issues/498) Update image inspect response - Included in 3.0.0-RC3 + * [#488] (https://github.com/docker-java/docker-java/pull/488) Support remote API 1.22 subset Included in 3.0.0-RC2 + * [#486] (https://github.com/docker-java/docker-java/pull/486) Fix NegativeArraySizeException in awaitCompletion() -* [#472] (https://github.com/docker-java/docker-java/pull/472) Exec start command: detect end of STDIN stream -* [#466] (https://github.com/docker-java/docker-java/pull/466) Fix exec start stdin encoding +* [#472] (https://github.com/docker-java/docker-java/pull/472) Exec start command: detect end of STDIN stream +* [#466] (https://github.com/docker-java/docker-java/pull/466) Fix exec start stdin encoding Included in 3.0.0-RC1 + * [#463] (https://github.com/docker-java/docker-java/pull/463) More logging drivers -* [#447] (https://github.com/docker-java/docker-java/pull/447) Refactoring of DockerClientConfig -* [#430] (https://github.com/docker-java/docker-java/pull/430) Fix ExecStartCmd failure -* [#426] (https://github.com/docker-java/docker-java/pull/426) Refactored filters API +* [#447] (https://github.com/docker-java/docker-java/pull/447) Refactoring of DockerClientConfig +* [#430] (https://github.com/docker-java/docker-java/pull/430) Fix ExecStartCmd failure +* [#426] (https://github.com/docker-java/docker-java/pull/426) Refactored filters API * [#425] (https://github.com/docker-java/docker-java/pull/425) Implement Network API -* [#410] (https://github.com/docker-java/docker-java/pull/410) Support for build-args of docker build +* [#410] (https://github.com/docker-java/docker-java/pull/410) Support for build-args of docker build * [#408] (https://github.com/docker-java/docker-java/pull/408) Support for volume API * [#406] (https://github.com/docker-java/docker-java/pull/406) Added RestartCount to InspectContainerResponse -* [#396] (https://github.com/docker-java/docker-java/pull/396) Disable evaluation of http.proxy... variables when using unix socket connection -* [#393] (https://github.com/docker-java/docker-java/pull/393) Support ONBUILD instruction in Dockerfiles +* [#396] (https://github.com/docker-java/docker-java/pull/396) Disable evaluation of http.proxy... variables when using unix socket + connection +* [#393] (https://github.com/docker-java/docker-java/pull/393) Support ONBUILD instruction in Dockerfiles * [#392] (https://github.com/docker-java/docker-java/pull/392) Introduce InspectContainerResponse.Mounts * [#387] (https://github.com/docker-java/docker-java/pull/387) Make ProgressDetails attributes public * [#386] (https://github.com/docker-java/docker-java/pull/386) Basic http proxy configuration support -* [#362] (https://github.com/docker-java/docker-java/pull/362) Deprecate "network" and enable "networks" stats (remote Docker API 1.21) -* [#359] (https://github.com/docker-java/docker-java/pull/359) Fix performance issue of build command by adding bulk-read variant of InputStream.read() +* [#362] (https://github.com/docker-java/docker-java/pull/362) Deprecate "network" and enable "networks" stats (remote Docker API 1.21) +* [#359] (https://github.com/docker-java/docker-java/pull/359) Fix performance issue of build command by adding bulk-read variant of + InputStream.read() * [#357] (https://github.com/docker-java/docker-java/pull/357) Wait container command needs possibility to abort operation -* [#347] (https://github.com/docker-java/docker-java/pull/347) Implementation of copy archive to/from container commands +* [#347] (https://github.com/docker-java/docker-java/pull/347) Implementation of copy archive to/from container commands * [#313] (https://github.com/docker-java/docker-java/pull/313) Refactor primitive type fields to be of object type in JSON objects v2.2.3 --- -* [#487] (https://github.com/docker-java/docker-java/pull/487) Fix NegativeArraySizeException in awaitCompletion() + +* [#487] (https://github.com/docker-java/docker-java/pull/487) Fix NegativeArraySizeException in awaitCompletion() v2.2.2 --- + * [#478] (https://github.com/docker-java/docker-java/pull/478) Remove debug println v2.2.1 --- + * [#474] (https://github.com/docker-java/docker-java/pull/474) Fix periodic pull failure (2.x) v2.2.0 --- -* [#457] (https://github.com/docker-java/docker-java/pull/457) Input configuration should not be altered as it breaks unix socket support + +* [#457] (https://github.com/docker-java/docker-java/pull/457) Input configuration should not be altered as it breaks unix socket support * [#430] (https://github.com/docker-java/docker-java/pull/430) Fix ExecStartCmd failure (backported from 3.0.0) v2.1.4 --- -* [#396] (https://github.com/docker-java/docker-java/pull/396) Disable evaluation of http.proxy... variables when using unix socket connection -* [#359] (https://github.com/docker-java/docker-java/pull/359) Fix performance issue of build command by adding bulk-read variant of InputStream.read() +* [#396] (https://github.com/docker-java/docker-java/pull/396) Disable evaluation of http.proxy... variables when using unix socket + connection +* [#359] (https://github.com/docker-java/docker-java/pull/359) Fix performance issue of build command by adding bulk-read variant of + InputStream.read() v2.1.3 --- + * [#387] (https://github.com/docker-java/docker-java/pull/387) Make ProgressDetails attributes public * [#386] (https://github.com/docker-java/docker-java/pull/386) Basic http proxy configuration support * [#362] (https://github.com/docker-java/docker-java/pull/362) Deprecate "network" and enable "networks" stats (remote Docker API 1.21) v2.1.2 --- + * [#350] (https://github.com/docker-java/docker-java/pull/350) Remove ServiceLoader logic * [#344] (https://github.com/docker-java/docker-java/pull/344) Implement equals/hashCode for Filters * [#335] (https://github.com/docker-java/docker-java/pull/335) Improve backward-compatibility support for older API versions -* [#333] (https://github.com/docker-java/docker-java/pull/333) Adding support for withPidMode +* [#333] (https://github.com/docker-java/docker-java/pull/333) Adding support for withPidMode v2.1.1 --- -* [#326] (https://github.com/docker-java/docker-java/pull/326) Add all missing fields to ResponseItem and related classes + +* [#326] (https://github.com/docker-java/docker-java/pull/326) Add all missing fields to ResponseItem and related classes * [#320] (https://github.com/docker-java/docker-java/pull/320) Support "since" field for logs command v2.1.0 --- + * [#306] (https://github.com/docker-java/docker-java/pull/306) fix(core): fix NPE if latestItem is null in result callback * [#305] (https://github.com/docker-java/docker-java/pull/305) chore(core): do not expect default DockerCmdExecFactory service * [#304] (https://github.com/docker-java/docker-java/pull/304) Throw original exception when command.close() throws Exception too * [#299] (https://github.com/docker-java/docker-java/pull/299) BuildImage sync to 1.20 API -* [#291] (https://github.com/docker-java/docker-java/pull/291) Moved "Memory", "MemorySwap" and "CpuShares" mappings from ContainerConfig to HostConfig +* [#291] (https://github.com/docker-java/docker-java/pull/291) Moved "Memory", "MemorySwap" and "CpuShares" mappings from ContainerConfig to + HostConfig v2.0.1 --- Release notes + * This is a bugfix release. With this release docker >= v1.7.0 is recommended. All changes * [#301] (https://github.com/docker-java/docker-java/pull/301) Respect exception rules in .dockerignore file while build images * [#298] (https://github.com/docker-java/docker-java/pull/298) Fix repository name validation errors -* [#296] (https://github.com/docker-java/docker-java/pull/296) Fix Build FROM private registry broken with docker 1.7.x +* [#296] (https://github.com/docker-java/docker-java/pull/296) Fix Build FROM private registry broken with docker 1.7.x * [#295] (https://github.com/docker-java/docker-java/pull/295) Support certificate chains in cert.pem * [#287] (https://github.com/docker-java/docker-java/pull/287) Using the oomKillDisable flag throws a null pointer exception @@ -300,36 +350,47 @@ v2.0.0 --- Release notes -* Some commands APIs has been changed to be callback-driven now to simplify the processing of the result streams for the client application. This affects namely the events, stats, log, attach, build, push and pull commands. Look at the Wiki how to [process events](https://github.com/docker-java/docker-java/wiki#handle-events) or how to [build an image](https://github.com/docker-java/docker-java/wiki#build-image-from-dockerfile) from dockerfile for example. -* The `DockerClientConfig` API has changed to free it from implementation specific configuration options like `readTimeout`, `maxTotalConnections`, `maxPerRouteConnections` and `enableLoggingFilter`. Most options can be configured via `DockerCmdExecFactoryImpl` [programmatically](https://github.com/docker-java/docker-java/wiki#intialize-docker-client-advanced) now. Logging is configurable via [logback](https://github.com/docker-java/docker-java/blob/main/src/test/resources/logback.xml) configuration file in the classpath. +* Some commands APIs has been changed to be callback-driven now to simplify the processing of the result streams for the client application. + This affects namely the events, stats, log, attach, build, push and pull commands. Look at the Wiki how + to [process events](https://github.com/docker-java/docker-java/wiki#handle-events) or how + to [build an image](https://github.com/docker-java/docker-java/wiki#build-image-from-dockerfile) from dockerfile for example. +* The `DockerClientConfig` API has changed to free it from implementation specific configuration options like `readTimeout`, + `maxTotalConnections`, `maxPerRouteConnections` and `enableLoggingFilter`. Most options can be configured via + `DockerCmdExecFactoryImpl` [programmatically](https://github.com/docker-java/docker-java/wiki#intialize-docker-client-advanced) now. + Logging is configurable via [logback](https://github.com/docker-java/docker-java/blob/main/src/test/resources/logback.xml) configuration + file in the classpath. All changes * [#284](https://github.com/docker-java/docker-java/pull/284) Added GZIP compression for build context creation -* [#282](https://github.com/docker-java/docker-java/pull/282) Remove JAXRS/ApacheConnector implementation specific properties from DockerClientConfig -* [#280](https://github.com/docker-java/docker-java/pull/280) Handle multiple source files in ADD command +* [#282](https://github.com/docker-java/docker-java/pull/282) Remove JAXRS/ApacheConnector implementation specific properties from + DockerClientConfig +* [#280](https://github.com/docker-java/docker-java/pull/280) Handle multiple source files in ADD command * [#278](https://github.com/docker-java/docker-java/pull/278) Stop leaking tar files in temporary folder -* [#275](https://github.com/docker-java/docker-java/pull/275) Implemented LogConfig (create and inspect containers) +* [#275](https://github.com/docker-java/docker-java/pull/275) Implemented LogConfig (create and inspect containers) * [#272](https://github.com/docker-java/docker-java/pull/272) remove withHostConfig() from create container command * [#270](https://github.com/docker-java/docker-java/pull/270) Passing result callbacks for async commands via commands exec() -* [#269](https://github.com/docker-java/docker-java/pull/269) Add filters option to events operation +* [#269](https://github.com/docker-java/docker-java/pull/269) Add filters option to events operation * [#268](https://github.com/docker-java/docker-java/pull/268) Concurrent DockerCmdExecFactory.getDefaultDockerCmdExecFactory fails on reload * [#263](https://github.com/docker-java/docker-java/pull/263) Refactoring of streaming commands APIs (event, stats, log, attach) -* [#262](https://github.com/docker-java/docker-java/pull/262) Accept filters in list containers +* [#262](https://github.com/docker-java/docker-java/pull/262) Accept filters in list containers * [#260](https://github.com/docker-java/docker-java/pull/260) Add labels to create and inspect container v1.4.0 --- + * [#248](https://github.com/docker-java/docker-java/pull/248) Removed deprecated start options * [#247](https://github.com/docker-java/docker-java/pull/247) Add Domainname attribute on create command * [#245](https://github.com/docker-java/docker-java/pull/245) Added ReadonlyRootfs option -* [#233](https://github.com/docker-java/docker-java/pull/233) Labels are array of Strings (fixes #232) -* [#189](https://github.com/docker-java/docker-java/pull/189) Add docker stats support +* [#233](https://github.com/docker-java/docker-java/pull/233) Labels are array of Strings (fixes #232) +* [#189](https://github.com/docker-java/docker-java/pull/189) Add docker stats support v1.3.0 --- + * [#213](https://github.com/docker-java/docker-java/pull/213) Add ulimit support -* [#208](https://github.com/docker-java/docker-java/pull/208) Added PullEventStreamItem and EventStreamReader to stream the reading of events +* [#208](https://github.com/docker-java/docker-java/pull/208) Added PullEventStreamItem and EventStreamReader to stream the reading of + events * [#205](https://github.com/docker-java/docker-java/issues/205) Access mode of VolumesRW incorrectly deserialized * [#204] (https://github.com/docker-java/docker-java/pull/204) Added support to use the credentials from .dockercfg during build * [#203](https://github.com/docker-java/docker-java/issues/203) Missing 'MacAddress' option in create container command @@ -337,145 +398,149 @@ v1.3.0 v1.2.0 --- + * [#194](https://github.com/docker-java/docker-java/pull/194) Fixed remove intermediate containers bug on build goal * [#193](https://github.com/docker-java/docker-java/pull/193) Add HostConfig related methods from start command to create command * [#192](https://github.com/docker-java/docker-java/pull/192) Added a Links constructor accepting a List object v1.1.0 --- - - * [#186](https://github.com/docker-java/docker-java/pull/186) Added withPull method to BuilImageCmd - * [#185](https://github.com/docker-java/docker-java/pull/185) Introduce WrappedResponseInputStream to close underlying Response - * [#180](https://github.com/docker-java/docker-java/pull/180) Dockerfiles not called 'dockerfile' - * [#179](https://github.com/docker-java/docker-java/pull/179) Add support for cpuset in CreateContainerCmd - * [#170](https://github.com/docker-java/docker-java/pull/170) Allow to specify alternative files other than 'Dockerfile' for building images - * [#165](https://github.com/docker-java/docker-java/pull/165) PushImageCmd assumes that you have an auth config setup - * [#161](https://github.com/docker-java/docker-java/pull/161) Inspect exec command - * [#159](https://github.com/docker-java/docker-java/pull/159) Add missing Info fields - * [#156](https://github.com/docker-java/docker-java/pull/156) Add support for configuring ExtraHosts - * [#146](https://github.com/docker-java/docker-java/pull/146) Create Identifier type +* [#186](https://github.com/docker-java/docker-java/pull/186) Added withPull method to BuilImageCmd +* [#185](https://github.com/docker-java/docker-java/pull/185) Introduce WrappedResponseInputStream to close underlying Response +* [#180](https://github.com/docker-java/docker-java/pull/180) Dockerfiles not called 'dockerfile' +* [#179](https://github.com/docker-java/docker-java/pull/179) Add support for cpuset in CreateContainerCmd +* [#170](https://github.com/docker-java/docker-java/pull/170) Allow to specify alternative files other than 'Dockerfile' for building images +* [#165](https://github.com/docker-java/docker-java/pull/165) PushImageCmd assumes that you have an auth config setup +* [#161](https://github.com/docker-java/docker-java/pull/161) Inspect exec command +* [#159](https://github.com/docker-java/docker-java/pull/159) Add missing Info fields +* [#156](https://github.com/docker-java/docker-java/pull/156) Add support for configuring ExtraHosts +* [#146](https://github.com/docker-java/docker-java/pull/146) Create Identifier type v1.0.0 --- - * [#152](https://github.com/docker-java/docker-java/pull/152) Restore guava as a dependency - * [#149](https://github.com/docker-java/docker-java/pull/149) Handle HTTP-Redirects - * [#148](https://github.com/docker-java/docker-java/pull/148) Save image functionality - * [#142](https://github.com/docker-java/docker-java/pull/142) Reduce Logging Level - * [#138](https://github.com/docker-java/docker-java/pull/138) Apache CXF interopabilty - * [#137](https://github.com/docker-java/docker-java/pull/137) Multiple volumesFrom option when creating a container - * [#135](https://github.com/docker-java/docker-java/pull/135) Update to latest unix-socket-factory - * [#134](https://github.com/docker-java/docker-java/pull/134) Remove Google Guava as dependency - * [#131](https://github.com/docker-java/docker-java/pull/128) Utility classes and streamed JSON representations - * [#128](https://github.com/docker-java/docker-java/pull/128) Allow unauthorized pullImageCmd + +* [#152](https://github.com/docker-java/docker-java/pull/152) Restore guava as a dependency +* [#149](https://github.com/docker-java/docker-java/pull/149) Handle HTTP-Redirects +* [#148](https://github.com/docker-java/docker-java/pull/148) Save image functionality +* [#142](https://github.com/docker-java/docker-java/pull/142) Reduce Logging Level +* [#138](https://github.com/docker-java/docker-java/pull/138) Apache CXF interopabilty +* [#137](https://github.com/docker-java/docker-java/pull/137) Multiple volumesFrom option when creating a container +* [#135](https://github.com/docker-java/docker-java/pull/135) Update to latest unix-socket-factory +* [#134](https://github.com/docker-java/docker-java/pull/134) Remove Google Guava as dependency +* [#131](https://github.com/docker-java/docker-java/pull/128) Utility classes and streamed JSON representations +* [#128](https://github.com/docker-java/docker-java/pull/128) Allow unauthorized pullImageCmd v0.10.5 --- - * [#125](https://github.com/docker-java/docker-java/pull/125) Unixsocket support - * [#123](https://github.com/docker-java/docker-java/pull/123) support DOCKER_TLS_VERIFY to detect ssl - * [#121](https://github.com/docker-java/docker-java/pull/121) Implemented support for commands: Exec-start, Exec-create - * [#120](https://github.com/docker-java/docker-java/pull/120) Command resource cleanup after command execution - * [#118](https://github.com/docker-java/docker-java/pull/118) Use chunked encoding when passing the docker image - * [#116](https://github.com/docker-java/docker-java/pull/116) Allow SSL configuration from pre-existing keystore to be used - * [#115](https://github.com/docker-java/docker-java/pull/115) Polish RestartPolicy - * [#114](https://github.com/docker-java/docker-java/pull/114) Fix CreateContainerCmdImpl.withVolumesFrom() - * [#111](https://github.com/docker-java/docker-java/pull/111) Allow to send empty messages in StartContainerCmd + +* [#125](https://github.com/docker-java/docker-java/pull/125) Unixsocket support +* [#123](https://github.com/docker-java/docker-java/pull/123) support DOCKER_TLS_VERIFY to detect ssl +* [#121](https://github.com/docker-java/docker-java/pull/121) Implemented support for commands: Exec-start, Exec-create +* [#120](https://github.com/docker-java/docker-java/pull/120) Command resource cleanup after command execution +* [#118](https://github.com/docker-java/docker-java/pull/118) Use chunked encoding when passing the docker image +* [#116](https://github.com/docker-java/docker-java/pull/116) Allow SSL configuration from pre-existing keystore to be used +* [#115](https://github.com/docker-java/docker-java/pull/115) Polish RestartPolicy +* [#114](https://github.com/docker-java/docker-java/pull/114) Fix CreateContainerCmdImpl.withVolumesFrom() +* [#111](https://github.com/docker-java/docker-java/pull/111) Allow to send empty messages in StartContainerCmd v0.10.4 --- - * [#109](https://github.com/docker-java/docker-java/pull/109) Support tag in push image command - * [#106](https://github.com/docker-java/docker-java/pull/106) Allow to manage Linux capabilities in CreateContainerCmd - * [#105](https://github.com/docker-java/docker-java/pull/105) Allow to pass HostConfig when creating a container - * [#103](https://github.com/docker-java/docker-java/pull/103) Make GoLangMatchFileFilter work on Windows - * [#102](https://github.com/docker-java/docker-java/pull/102) Downgraded jackson-jaxrs dependency version - * [#101](https://github.com/docker-java/docker-java/pull/101) list filtered images as described in the remote api docs - * [#100](https://github.com/docker-java/docker-java/pull/100) Add support for .dockercfg files to handle auth for push command - * [#95](https://github.com/docker-java/docker-java/pull/95) Add support for .dockerignore files - * [#92](https://github.com/docker-java/docker-java/pull/92) Add travis-ci support - * [#90](https://github.com/docker-java/docker-java/pull/90) Update DockerClientBuilder.java - * [#88](https://github.com/docker-java/docker-java/pull/88) Add support for private repositories and pull/push authentication +* [#109](https://github.com/docker-java/docker-java/pull/109) Support tag in push image command +* [#106](https://github.com/docker-java/docker-java/pull/106) Allow to manage Linux capabilities in CreateContainerCmd +* [#105](https://github.com/docker-java/docker-java/pull/105) Allow to pass HostConfig when creating a container +* [#103](https://github.com/docker-java/docker-java/pull/103) Make GoLangMatchFileFilter work on Windows +* [#102](https://github.com/docker-java/docker-java/pull/102) Downgraded jackson-jaxrs dependency version +* [#101](https://github.com/docker-java/docker-java/pull/101) list filtered images as described in the remote api docs +* [#100](https://github.com/docker-java/docker-java/pull/100) Add support for .dockercfg files to handle auth for push command +* [#95](https://github.com/docker-java/docker-java/pull/95) Add support for .dockerignore files +* [#92](https://github.com/docker-java/docker-java/pull/92) Add travis-ci support +* [#90](https://github.com/docker-java/docker-java/pull/90) Update DockerClientBuilder.java +* [#88](https://github.com/docker-java/docker-java/pull/88) Add support for private repositories and pull/push authentication v0.10.3 --- - * [#87](https://github.com/docker-java/docker-java/pull/87) Improve adding of port bindings - * [#83](https://github.com/docker-java/docker-java/pull/83) Loading of custom DockerCmdExecFactory - * [#81](https://github.com/docker-java/docker-java/pull/81) Env config - * [#82](https://github.com/docker-java/docker-java/pull/82) Allow multiple port bindings per ExposedPort - * [#80](https://github.com/docker-java/docker-java/pull/80) explicitly use the latest image version - * [#79](https://github.com/docker-java/docker-java/pull/79) Move slow tests to integration test phase, enable tests by default - * [#76](https://github.com/docker-java/docker-java/pull/76) New enum \"InternetProtocol\" for supported IP protocols replaces \"scheme\" - * [#75](https://github.com/docker-java/docker-java/pull/75) Use ExposedPort.toString() in serialization - * [#74](https://github.com/docker-java/docker-java/pull/74) Use project.build.sourceEncoding in compiler - * [#73](https://github.com/docker-java/docker-java/pull/73) Improve parsing and serialization of Link - * [#70](https://github.com/docker-java/docker-java/pull/70) Improve instantiation and serialization of Bind +* [#87](https://github.com/docker-java/docker-java/pull/87) Improve adding of port bindings +* [#83](https://github.com/docker-java/docker-java/pull/83) Loading of custom DockerCmdExecFactory +* [#81](https://github.com/docker-java/docker-java/pull/81) Env config +* [#82](https://github.com/docker-java/docker-java/pull/82) Allow multiple port bindings per ExposedPort +* [#80](https://github.com/docker-java/docker-java/pull/80) explicitly use the latest image version +* [#79](https://github.com/docker-java/docker-java/pull/79) Move slow tests to integration test phase, enable tests by default +* [#76](https://github.com/docker-java/docker-java/pull/76) New enum \"InternetProtocol\" for supported IP protocols replaces \"scheme\" +* [#75](https://github.com/docker-java/docker-java/pull/75) Use ExposedPort.toString() in serialization +* [#74](https://github.com/docker-java/docker-java/pull/74) Use project.build.sourceEncoding in compiler +* [#73](https://github.com/docker-java/docker-java/pull/73) Improve parsing and serialization of Link +* [#70](https://github.com/docker-java/docker-java/pull/70) Improve instantiation and serialization of Bind v0.10.2 --- - * [#69](https://github.com/docker-java/docker-java/pull/69) Use canonical form of Docker folder when building TAR files - * [#68](https://github.com/docker-java/docker-java/pull/68) Set Jersey client CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE - * [#67](https://github.com/docker-java/docker-java/pull/67) typo in README.md - * [#65](https://github.com/docker-java/docker-java/pull/65) Added static method udp in ExposedPort - * [#63](https://github.com/docker-java/docker-java/pull/63) Bind.parse() fails when access mode is specified - * [#57](https://github.com/docker-java/docker-java/pull/57) Add streaming events API - * [#59](https://github.com/docker-java/docker-java/pull/59) Update readme to include corrected api example - * [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java - * [#56](https://github.com/docker-java/docker-java/pull/56) Update README.md - * [#58](https://github.com/docker-java/docker-java/pull/58) Code clear and bug fix +* [#69](https://github.com/docker-java/docker-java/pull/69) Use canonical form of Docker folder when building TAR files +* [#68](https://github.com/docker-java/docker-java/pull/68) Set Jersey client CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE +* [#67](https://github.com/docker-java/docker-java/pull/67) typo in README.md +* [#65](https://github.com/docker-java/docker-java/pull/65) Added static method udp in ExposedPort +* [#63](https://github.com/docker-java/docker-java/pull/63) Bind.parse() fails when access mode is specified +* [#57](https://github.com/docker-java/docker-java/pull/57) Add streaming events API +* [#59](https://github.com/docker-java/docker-java/pull/59) Update readme to include corrected api example +* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java +* [#56](https://github.com/docker-java/docker-java/pull/56) Update README.md +* [#58](https://github.com/docker-java/docker-java/pull/58) Code clear and bug fix v0.10.1 --- - * [#49](https://github.com/docker-java/docker-java/pull/49) Allow user to check where volume is binded on host - * [#47](https://github.com/docker-java/docker-java/pull/47) let CompressArchiveUtil preserve executable flags - * [#46](https://github.com/docker-java/docker-java/pull/46) Fixes to AttachContainerCmd and CreateContainerCmd. +* [#49](https://github.com/docker-java/docker-java/pull/49) Allow user to check where volume is binded on host +* [#47](https://github.com/docker-java/docker-java/pull/47) let CompressArchiveUtil preserve executable flags +* [#46](https://github.com/docker-java/docker-java/pull/46) Fixes to AttachContainerCmd and CreateContainerCmd. v0.10.0 --- - * [#45](https://github.com/docker-java/docker-java/pull/45) Fix Issue #44 Adjusting DNS property type to be a String array as specified by the Doc... - * [#38](https://github.com/docker-java/docker-java/pull/38) Remove special-case for one \":\" from PullCommand - * [#37](https://github.com/docker-java/docker-java/pull/37) Starts v0.10.0 - * [#35](https://github.com/docker-java/docker-java/pull/35) Exposing the withTTY method for container creation. +* [#45](https://github.com/docker-java/docker-java/pull/45) Fix Issue #44 Adjusting DNS property type to be a String array as specified by + the Doc... +* [#38](https://github.com/docker-java/docker-java/pull/38) Remove special-case for one \":\" from PullCommand +* [#37](https://github.com/docker-java/docker-java/pull/37) Starts v0.10.0 +* [#35](https://github.com/docker-java/docker-java/pull/35) Exposing the withTTY method for container creation. v0.9.1 --- - * [#31](https://github.com/docker-java/docker-java/pull/31) Change VolumesFrom to handle array - * [#29](https://github.com/docker-java/docker-java/pull/29) Makes Config a public, immutable class with a builder - * [#22](https://github.com/docker-java/docker-java/pull/22) Fixes for startContainerCmd - * [#19](https://github.com/docker-java/docker-java/pull/19) Add missing options to BuildCmd and set them to match Docker client. - * [#16](https://github.com/docker-java/docker-java/pull/16) Build image improvements +* [#31](https://github.com/docker-java/docker-java/pull/31) Change VolumesFrom to handle array +* [#29](https://github.com/docker-java/docker-java/pull/29) Makes Config a public, immutable class with a builder +* [#22](https://github.com/docker-java/docker-java/pull/22) Fixes for startContainerCmd +* [#19](https://github.com/docker-java/docker-java/pull/19) Add missing options to BuildCmd and set them to match Docker client. +* [#16](https://github.com/docker-java/docker-java/pull/16) Build image improvements v0.9.0 --- - * [#14](https://github.com/docker-java/docker-java/pull/14) Use RegEx to match ADD command from Dockerfile. - * [#9](https://github.com/docker-java/docker-java/pull/9) Add a build command accepting a tar as a InputStream, so we can build the Dockerfile TAR on the fly without a temporary folder. +* [#14](https://github.com/docker-java/docker-java/pull/14) Use RegEx to match ADD command from Dockerfile. +* [#9](https://github.com/docker-java/docker-java/pull/9) Add a build command accepting a tar as a InputStream, so we can build the + Dockerfile TAR on the fly without a temporary folder. v0.8.2 --- - * [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java - * [#1](https://github.com/docker-java/docker-java/pull/1) Merge - * [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java - * [#66](https://github.com/docker-java/docker-java/pull/66) Backport the new structure to Jersey 1.18 - * [#65](https://github.com/docker-java/docker-java/pull/65) Added static method udp in ExposedPort - * [#61](https://github.com/docker-java/docker-java/pull/61) - * [#60](https://github.com/docker-java/docker-java/pull/60) Added additional callback methods to EventCallback - * [#1](https://github.com/docker-java/docker-java/pull/1) Merge - * [#55](https://github.com/docker-java/docker-java/pull/55) - * [#58](https://github.com/docker-java/docker-java/pull/58) Code clear and bug fix - * [#54](https://github.com/docker-java/docker-java/pull/54) - * [#3](https://github.com/docker-java/docker-java/pull/3) - * [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java - * [#1](https://github.com/docker-java/docker-java/pull/1) Merge - * [#34](https://github.com/docker-java/docker-java/pull/34) - * [#36](https://github.com/docker-java/docker-java/pull/36) - * [#37](https://github.com/docker-java/docker-java/pull/37) Starts v0.10.0 - * [#32](https://github.com/docker-java/docker-java/pull/32) +* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java +* [#1](https://github.com/docker-java/docker-java/pull/1) Merge +* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java +* [#66](https://github.com/docker-java/docker-java/pull/66) Backport the new structure to Jersey 1.18 +* [#65](https://github.com/docker-java/docker-java/pull/65) Added static method udp in ExposedPort +* [#61](https://github.com/docker-java/docker-java/pull/61) +* [#60](https://github.com/docker-java/docker-java/pull/60) Added additional callback methods to EventCallback +* [#1](https://github.com/docker-java/docker-java/pull/1) Merge +* [#55](https://github.com/docker-java/docker-java/pull/55) +* [#58](https://github.com/docker-java/docker-java/pull/58) Code clear and bug fix +* [#54](https://github.com/docker-java/docker-java/pull/54) +* [#3](https://github.com/docker-java/docker-java/pull/3) +* [#2](https://github.com/docker-java/docker-java/pull/2) Move to new maven coordinate com.github.docker-java:docker-java +* [#1](https://github.com/docker-java/docker-java/pull/1) Merge +* [#34](https://github.com/docker-java/docker-java/pull/34) +* [#36](https://github.com/docker-java/docker-java/pull/36) +* [#37](https://github.com/docker-java/docker-java/pull/37) Starts v0.10.0 +* [#32](https://github.com/docker-java/docker-java/pull/32) v0.8.1 --- @@ -484,19 +549,20 @@ v0.8.1 v0.8.1 --- - * [#28](https://github.com/docker-java/docker-java/pull/28) Improves use of docker-java in unit tests - * [#30](https://github.com/docker-java/docker-java/pull/30) Add ping method - * [#27](https://github.com/docker-java/docker-java/pull/27) Added a close method to DockerClient - * [#26](https://github.com/docker-java/docker-java/pull/26) - * [#24](https://github.com/docker-java/docker-java/pull/24) - * [#23](https://github.com/docker-java/docker-java/pull/23) - * [#22](https://github.com/docker-java/docker-java/pull/22) Fixes for startContainerCmd - * [#20](https://github.com/docker-java/docker-java/pull/20) - * [#19](https://github.com/docker-java/docker-java/pull/19) Add missing options to BuildCmd and set them to match Docker client. - * [#18](https://github.com/docker-java/docker-java/pull/18) Added Container-Linking - * [#16](https://github.com/docker-java/docker-java/pull/16) Build image improvements - * [#15](https://github.com/docker-java/docker-java/pull/15) Collection of changes driven by use in gradle-docker and on Windows - * [#14](https://github.com/docker-java/docker-java/pull/14) Use RegEx to match ADD command from Dockerfile. - * [#9](https://github.com/docker-java/docker-java/pull/9) Add a build command accepting a tar as a InputStream, so we can build the Dockerfile TAR on the fly without a temporary folder. - * [#5](https://github.com/docker-java/docker-java/pull/5) add paused field in ContainerInspectResponse - * [#6](https://github.com/docker-java/docker-java/pull/6) +* [#28](https://github.com/docker-java/docker-java/pull/28) Improves use of docker-java in unit tests +* [#30](https://github.com/docker-java/docker-java/pull/30) Add ping method +* [#27](https://github.com/docker-java/docker-java/pull/27) Added a close method to DockerClient +* [#26](https://github.com/docker-java/docker-java/pull/26) +* [#24](https://github.com/docker-java/docker-java/pull/24) +* [#23](https://github.com/docker-java/docker-java/pull/23) +* [#22](https://github.com/docker-java/docker-java/pull/22) Fixes for startContainerCmd +* [#20](https://github.com/docker-java/docker-java/pull/20) +* [#19](https://github.com/docker-java/docker-java/pull/19) Add missing options to BuildCmd and set them to match Docker client. +* [#18](https://github.com/docker-java/docker-java/pull/18) Added Container-Linking +* [#16](https://github.com/docker-java/docker-java/pull/16) Build image improvements +* [#15](https://github.com/docker-java/docker-java/pull/15) Collection of changes driven by use in gradle-docker and on Windows +* [#14](https://github.com/docker-java/docker-java/pull/14) Use RegEx to match ADD command from Dockerfile. +* [#9](https://github.com/docker-java/docker-java/pull/9) Add a build command accepting a tar as a InputStream, so we can build the + Dockerfile TAR on the fly without a temporary folder. +* [#5](https://github.com/docker-java/docker-java/pull/5) add paused field in ContainerInspectResponse +* [#6](https://github.com/docker-java/docker-java/pull/6) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5072b0864..423639c91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,45 +14,50 @@ If you do not have access to a Docker server or just want to execute the build q $ mvn clean install -DskipITs By default the docker engine is using local UNIX sockets for communication with the docker CLI so docker-java -client also uses UNIX domain sockets to connect to the docker daemon by default. To make the docker daemon listening on a TCP (http/https) port you have to configure it by setting the DOCKER_OPTS environment variable to something like the following: +client also uses UNIX domain sockets to connect to the docker daemon by default. To make the docker daemon listening on a TCP (http/https) +port you have to configure it by setting the DOCKER_OPTS environment variable to something like the following: DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock" - + More details about setting up Docker Engine can be found in the official documentation: https://docs.docker.com/engine/admin/ -To force docker-java to use TCP (http) configure the following (see [Configuration](https://github.com/docker-java/docker-java#configuration) for details): +To force docker-java to use TCP (http) configure the following ( +see [Configuration](https://github.com/docker-java/docker-java#configuration) for details): DOCKER_HOST=tcp://127.0.0.1:2375 - -For secure tls (https) communication: + +For secure tls (https) communication: DOCKER_HOST=tcp://127.0.0.1:2376 DOCKER_TLS_VERIFY=1 DOCKER_CERT_PATH=/Users/marcus/.docker/machine/machines/docker-1.11.2 - # Code Design - * Model is based on Objects and not primitives that allows nullify requests and have null values for data + +* Model is based on Objects and not primitives that allows nullify requests and have null values for data that wasn't provided by docker daemon. - * For null safeness findbugs annotations are used. +* For null safeness findbugs annotations are used. ** Every method that may return `null` (and we are unsure in any fields as docker daemon may change something) - should be annotated with `@CheckForNull` return qualifier from `javax.annotation` package. + should be annotated with `@CheckForNull` return qualifier from `javax.annotation` package. ** Methods that can't return `null` must be annotated with `@Nonnull`. ** The same for Arguments. ** `@Nullable` must be used only for changing inherited (other typed) qualifier. - * Setters in builder style must be prefixed with `withXX`. - * All classes should provide `toString()` `equals()` and `hashCode()` defined methods. - * Javadocs +* Setters in builder style must be prefixed with `withXX`. +* All classes should provide `toString()` `equals()` and `hashCode()` defined methods. +* Javadocs ** Provide full information on field: *** For models define API version with `@since {@link RemoteApiVersion#VERSION_1_X}`. ** getters/setters should refernce to field `@see #$field`. - * If it is `Serializable` it shall have a `serialVersionUID` field. Unless code has shipped to users, the initial value of the `serialVersionUID` field shall be `1L`. +* If it is `Serializable` it shall have a `serialVersionUID` field. Unless code has shipped to users, the initial value of the + `serialVersionUID` field shall be `1L`. # Coding style - * Some initial styling already enforced with checkstyle. Please aim for consistency with the existing code. + +* Some initial styling already enforced with checkstyle. Please aim for consistency with the existing code. # Testing - * Unit tests for serder (serialization-deserialization). - * Integration tests for commands. - * If model object has builders, then fill it with data and compare by `equals()` with expected response - from docker daemon. If failed, then some fields mappings are wrong. \ No newline at end of file + +* Unit tests for serder (serialization-deserialization). +* Integration tests for commands. +* If model object has builders, then fill it with data and compare by `equals()` with expected response + from docker daemon. If failed, then some fields mappings are wrong. diff --git a/README.md b/README.md index b1fa9c89e..712208dd6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ [![Maven Central](https://img.shields.io/maven-central/v/com.github.docker-java/docker-java.svg)](https://mvnrepository.com/artifact/com.github.docker-java/docker-java) [![codecov.io](http://codecov.io/github/docker-java/docker-java/coverage.svg?branch=main)](http://codecov.io/github/docker-java/docker-java?branch=master) [![License](http://img.shields.io/:license-apache-blue.svg?style=flat)](https://github.com/docker-java/docker-java/blob/main/LICENSE) -# docker-java + +# docker-java Java API client for [Docker](http://docs.docker.io/ "Docker") diff --git a/circle.md b/circle.md index d2d671d84..c80fab25b 100644 --- a/circle.md +++ b/circle.md @@ -3,49 +3,53 @@ The build including tests and integration tests can be automatically run on [circleCI](https://circleci.com/). ## Setup + 1. create an account on circle CI using your github account. 2. select docker-java from the github projects listed in your profile. 3. go to the project settings for docker-java (click on the gear-wheel icon beside the docker-java title). 4. open the *Environment variable* page. 5. add the following environment variables: - - DOCKER_EMAIL - - DOCKER_PASSWORD - - DOCKER_USERNAME + +- DOCKER_EMAIL +- DOCKER_PASSWORD +- DOCKER_USERNAME ## Ignored Tests + ExecCreateCmdImplTest.execCreateTest - - Exec is not supported by the lxc driver +- Exec is not supported by the lxc driver ExecStartCmdImplTest.execStartTest - - Exec is not supported by the lxc driver +- Exec is not supported by the lxc driver KillContainerCmdImplTest.killContainer - - Killed container has ExitCode 0 +- Killed container has ExitCode 0 ListImagesCmdImplTest.listDanglingImages - - caused by [docker#9939](https://github.com/docker/docker/issues/9939) +- caused by [docker#9939](https://github.com/docker/docker/issues/9939) RemoveContainerCmdImplTest.removeContainer - - caused by [docker#9939](https://github.com/docker/docker/issues/9939) +- caused by [docker#9939](https://github.com/docker/docker/issues/9939) RemoveImageCmdImplTest.removeImage - - caused by [docker#9939](https://github.com/docker/docker/issues/9939) +- caused by [docker#9939](https://github.com/docker/docker/issues/9939) ContainerDiffCmdImplTest.testContainerDiff - - too many diffs [{"Kind":0,"Path":"/dev"} ,{"Kind":1,"Path":"/dev/fuse"} ,{"Kind":1,"Path":"/dev/ptmx"} ,{"Kind":1,"Path":"/dev/tty"} ,{"Kind":1,"Path":"/dev/tty1"} ,{"Kind":1,"Path":"/dev/stdout"} ,{"Kind":1,"Path":"/dev/urandom"} ,{"Kind":1,"Path":"/dev/full"} ,{"Kind":1,"Path":"/dev/kmsg"} ,{"Kind":1,"Path":"/dev/null"} ,{"Kind":1,"Path":"/dev/stdin"} ,{"Kind":1,"Path":"/dev/stderr"} ,{"Kind":1,"Path":"/dev/zero"} ,{"Kind":1,"Path":"/dev/fd"} ,{"Kind":1,"Path":"/dev/random"} ,{"Kind":1,"Path":"/test"} ] +- too many + diffs [{"Kind":0,"Path":"/dev"} ,{"Kind":1,"Path":"/dev/fuse"} ,{"Kind":1,"Path":"/dev/ptmx"} ,{"Kind":1,"Path":"/dev/tty"} ,{"Kind":1,"Path":"/dev/tty1"} ,{"Kind":1,"Path":"/dev/stdout"} ,{"Kind":1,"Path":"/dev/urandom"} ,{"Kind":1,"Path":"/dev/full"} ,{"Kind":1,"Path":"/dev/kmsg"} ,{"Kind":1,"Path":"/dev/null"} ,{"Kind":1,"Path":"/dev/stdin"} ,{"Kind":1,"Path":"/dev/stderr"} ,{"Kind":1,"Path":"/dev/zero"} ,{"Kind":1,"Path":"/dev/fd"} ,{"Kind":1,"Path":"/dev/random"} ,{"Kind":1,"Path":"/test"} ] BuildImageCmdImplTest.testDockerIgnore - - ignore is not working +- ignore is not working StopContainerCmdImplTest.testStopContainer - - Stopped container has ExitCode 0 +- Stopped container has ExitCode 0 diff --git a/docker-java-api/pom.xml b/docker-java-api/pom.xml index 82d176e38..a2882374d 100644 --- a/docker-java-api/pom.xml +++ b/docker-java-api/pom.xml @@ -33,38 +33,32 @@ - com.google.code.findbugs - annotations - 3.0.1u2 - provided + com.github.spotbugs + spotbugs-annotations + ${spotbugs-annotations.version} - org.projectlombok lombok - 1.18.30 + ${lombok.version} provided - - org.junit.jupiter junit-jupiter - 5.10.0 + ${junit-jupiter-api.version} test - com.tngtech.archunit archunit-junit5 - 0.18.0 + ${archunit-junit5.version} test - com.tngtech.archunit archunit - 0.18.0 + ${archunit-junit5.version} test @@ -84,6 +78,7 @@ com.github.siom79.japicmp japicmp-maven-plugin + ${japicmp-maven-plugin.version} diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallback.java b/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallback.java index 6a244d620..f3cf35885 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallback.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallback.java @@ -20,12 +20,18 @@ public void onNext(A_RES_T object) { */ void onStart(Closeable closeable); - /** Called when an async result event occurs */ + /** + * Called when an async result event occurs + */ void onNext(A_RES_T object); - /** Called when an exception occurs while processing */ + /** + * Called when an exception occurs while processing + */ void onError(Throwable throwable); - /** Called when processing was finished either by reaching the end or by aborting it */ + /** + * Called when processing was finished either by reaching the end or by aborting it + */ void onComplete(); } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallbackTemplate.java b/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallbackTemplate.java index 911e67826..5554d492e 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallbackTemplate.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/async/ResultCallbackTemplate.java @@ -15,10 +15,9 @@ * Abstract template implementation of {@link ResultCallback} * * @author Marcus Linke - * */ public abstract class ResultCallbackTemplate, A_RES_T> implements - ResultCallback { + ResultCallback { private static final Logger LOGGER = LoggerFactory.getLogger(ResultCallbackTemplate.class); @@ -71,14 +70,14 @@ public void onComplete() { @Override public void close() throws IOException { if (!closed) { - closed = true; - try { - if (stream != null) { - stream.close(); - } - } finally { - completed.countDown(); - } + closed = true; + try { + if (stream != null) { + stream.close(); + } + } finally { + completed.countDown(); + } } } @@ -103,8 +102,9 @@ public RC_T awaitCompletion() throws InterruptedException { /** * Blocks until {@link ResultCallback#onComplete()} was called or the given timeout occurs + * * @return {@code true} if completed and {@code false} if the waiting time elapsed - * before {@link ResultCallback#onComplete()} was called. + * before {@link ResultCallback#onComplete()} was called. */ public boolean awaitCompletion(long timeout, TimeUnit timeUnit) throws InterruptedException { try { @@ -135,8 +135,9 @@ public RC_T awaitStarted() throws InterruptedException { * Blocks until {@link ResultCallback#onStart(Closeable)} was called or the given timeout occurs. * {@link ResultCallback#onStart(Closeable)} is called when the request was processed on the server side * and the response is incoming. + * * @return {@code true} if started and {@code false} if the waiting time elapsed - * before {@link ResultCallback#onStart(Closeable)} was called. + * before {@link ResultCallback#onStart(Closeable)} was called. */ public boolean awaitStarted(long timeout, TimeUnit timeUnit) throws InterruptedException { return started.await(timeout, timeUnit); @@ -144,16 +145,17 @@ public boolean awaitStarted(long timeout, TimeUnit timeUnit) throws InterruptedE /** * Throws the first occurred error as a runtime exception + * * @throws com.github.dockerjava.api.exception.DockerException The first docker based Error - * @throws RuntimeException on any other occurred error + * @throws RuntimeException on any other occurred error */ protected void throwFirstError() { if (firstError != null) { if (firstError instanceof Error) { - throw (Error) firstError; + throw (Error) firstError; } if (firstError instanceof RuntimeException) { - throw (RuntimeException) firstError; + throw (RuntimeException) firstError; } throw new RuntimeException(firstError); } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/command/ListImagesCmd.java b/docker-java-api/src/main/java/com/github/dockerjava/api/command/ListImagesCmd.java index cc60a5bcc..fd22ee090 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/command/ListImagesCmd.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/command/ListImagesCmd.java @@ -4,10 +4,11 @@ import java.util.List; import java.util.Map; -import javax.annotation.CheckForNull; import com.github.dockerjava.api.model.Image; +import javax.annotation.CheckForNull; + /** * List images */ diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/AccessMode.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/AccessMode.java index e87494215..a3cca659d 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/AccessMode.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/AccessMode.java @@ -4,10 +4,14 @@ * The access mode of a file system or file: read-write or read-only. */ public enum AccessMode { - /** read-write */ + /** + * read-write + */ rw, - /** read-only */ + /** + * read-only + */ ro; /** diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/AuthConfig.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/AuthConfig.java index cbb108571..9e6de27b1 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/AuthConfig.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/AuthConfig.java @@ -107,6 +107,7 @@ public AuthConfig withAuth(String auth) { public String getIdentitytoken() { return identitytoken; } + /** * @see #identitytoken */ diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Bind.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Bind.java index a7c8dba26..b6a6453e5 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Bind.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Bind.java @@ -91,47 +91,45 @@ public PropagationMode getPropagationMode() { /** * Parses a bind mount specification to a {@link Bind}. * - * @param serialized - * the specification, e.g. /host:/container:ro + * @param serialized the specification, e.g. /host:/container:ro * @return a {@link Bind} matching the specification - * @throws IllegalArgumentException - * if the specification cannot be parsed + * @throws IllegalArgumentException if the specification cannot be parsed */ public static Bind parse(String serialized) { try { // Split by ':' but not ':\' (Windows-style path) String[] parts = serialized.split(":(?!\\\\)"); switch (parts.length) { - case 2: { - return new Bind(parts[0], new Volume(parts[1])); - } - case 3: { - String[] flags = parts[2].split(","); - AccessMode accessMode = AccessMode.DEFAULT; - SELContext seMode = SELContext.DEFAULT; - Boolean nocopy = null; - PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; - for (String p : flags) { - if (p.length() == 2) { - accessMode = AccessMode.valueOf(p.toLowerCase()); - } else if ("nocopy".equals(p)) { - nocopy = true; - } else if (PropagationMode.SHARED.toString().equals(p)) { - propagationMode = PropagationMode.SHARED; - } else if (PropagationMode.SLAVE.toString().equals(p)) { - propagationMode = PropagationMode.SLAVE; - } else if (PropagationMode.PRIVATE.toString().equals(p)) { - propagationMode = PropagationMode.PRIVATE; - } else { - seMode = SELContext.fromString(p); - } + case 2: { + return new Bind(parts[0], new Volume(parts[1])); } + case 3: { + String[] flags = parts[2].split(","); + AccessMode accessMode = AccessMode.DEFAULT; + SELContext seMode = SELContext.DEFAULT; + Boolean nocopy = null; + PropagationMode propagationMode = PropagationMode.DEFAULT_MODE; + for (String p : flags) { + if (p.length() == 2) { + accessMode = AccessMode.valueOf(p.toLowerCase()); + } else if ("nocopy".equals(p)) { + nocopy = true; + } else if (PropagationMode.SHARED.toString().equals(p)) { + propagationMode = PropagationMode.SHARED; + } else if (PropagationMode.SLAVE.toString().equals(p)) { + propagationMode = PropagationMode.SLAVE; + } else if (PropagationMode.PRIVATE.toString().equals(p)) { + propagationMode = PropagationMode.PRIVATE; + } else { + seMode = SELContext.fromString(p); + } + } - return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); - } - default: { - throw new IllegalArgumentException(); - } + return new Bind(parts[0], new Volume(parts[1]), accessMode, seMode, nocopy, propagationMode); + } + default: { + throw new IllegalArgumentException(); + } } } catch (Exception e) { throw new IllegalArgumentException("Error parsing Bind '" + serialized + "'", e); @@ -148,11 +146,11 @@ public static Bind parse(String serialized) { @Override public String toString() { return String.format("%s:%s:%s%s%s%s", - path, - volume.getPath(), - accessMode.toString(), - secMode != SELContext.none ? "," + secMode.toString() : "", - noCopy != null ? ",nocopy" : "", - propagationMode != PropagationMode.DEFAULT_MODE ? "," + propagationMode.toString() : ""); + path, + volume.getPath(), + accessMode.toString(), + secMode != SELContext.none ? "," + secMode.toString() : "", + noCopy != null ? ",nocopy" : "", + propagationMode != PropagationMode.DEFAULT_MODE ? "," + propagationMode.toString() : ""); } } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Binds.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Binds.java index 06aff4ecf..b866f5dff 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Binds.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Binds.java @@ -1,11 +1,11 @@ package com.github.dockerjava.api.model; -import java.io.Serializable; -import java.util.stream.Stream; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; +import java.io.Serializable; +import java.util.stream.Stream; + public class Binds implements Serializable { private static final long serialVersionUID = 1L; @@ -27,7 +27,7 @@ public String[] toPrimitive() { @JsonCreator public static Binds fromPrimitive(String[] binds) { return new Binds( - Stream.of(binds).map(Bind::parse).toArray(Bind[]::new) + Stream.of(binds).map(Bind::parse).toArray(Bind[]::new) ); } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/ChangeLog.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/ChangeLog.java index c8a5be890..9dd107184 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/ChangeLog.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/ChangeLog.java @@ -7,9 +7,7 @@ import java.io.Serializable; /** - * * @author Konstantin Pelykh (kpelykh@gmail.com) - * */ @EqualsAndHashCode @ToString diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java index b6e1e5566..5cd5298ab 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java @@ -81,6 +81,7 @@ public ClusterInfo withSpec(SwarmSpec spec) { this.spec = spec; return this; } + /** * @see #id */ diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Device.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Device.java index b6f16029e..dfbf58e46 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Device.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Device.java @@ -1,7 +1,5 @@ package com.github.dockerjava.api.model; -import static java.util.Objects.requireNonNull; - import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,6 +10,8 @@ import java.util.Map; import java.util.StringTokenizer; +import static java.util.Objects.requireNonNull; + @EqualsAndHashCode @ToString public class Device extends DockerObject implements Serializable { diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Event.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Event.java index 0eedbc553..c5d922cbd 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Event.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Event.java @@ -5,7 +5,6 @@ import lombok.ToString; import javax.annotation.CheckForNull; - import java.io.Serializable; /** diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/ExposedPort.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/ExposedPort.java index 4226fd94b..60a934afd 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/ExposedPort.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/ExposedPort.java @@ -1,16 +1,16 @@ package com.github.dockerjava.api.model; -import static com.github.dockerjava.api.model.InternetProtocol.TCP; -import static com.github.dockerjava.api.model.InternetProtocol.UDP; -import static com.github.dockerjava.api.model.InternetProtocol.SCTP; - -import java.io.Serializable; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.github.dockerjava.api.model.Ports.Binding; import lombok.EqualsAndHashCode; +import java.io.Serializable; + +import static com.github.dockerjava.api.model.InternetProtocol.SCTP; +import static com.github.dockerjava.api.model.InternetProtocol.TCP; +import static com.github.dockerjava.api.model.InternetProtocol.UDP; + /** * Represents a container port that Docker exposes to external clients. The port is defined by its {@link #getPort() port number} and an * {@link InternetProtocol}. It can be published by Docker by {@link Ports#bind(ExposedPort, Binding) binding} it to a host port, @@ -27,10 +27,8 @@ public class ExposedPort implements Serializable { /** * Creates an {@link ExposedPort} for the given parameters. * - * @param port - * the {@link #getPort() port number} - * @param protocol - * the {@link InternetProtocol} + * @param port the {@link #getPort() port number} + * @param protocol the {@link InternetProtocol} */ public ExposedPort(int port, InternetProtocol protocol) { this.port = port; @@ -40,8 +38,7 @@ public ExposedPort(int port, InternetProtocol protocol) { /** * Creates an {@link ExposedPort} for the given {@link #getPort() port number} and {@link InternetProtocol#DEFAULT}. * - * @param port - * the {@link #getPort() port number} + * @param port the {@link #getPort() port number} */ public ExposedPort(int port) { this(port, InternetProtocol.DEFAULT); @@ -50,10 +47,8 @@ public ExposedPort(int port) { /** * Creates an {@link ExposedPort} for the given parameters. * - * @param scheme - * the {@link #getScheme() scheme}, tcp, udp or sctp - * @param port - * the {@link #getPort() port number} + * @param scheme the {@link #getScheme() scheme}, tcp, udp or sctp + * @param port the {@link #getPort() port number} * @deprecated use {@link #ExposedPort(int, InternetProtocol)} */ @Deprecated @@ -77,7 +72,9 @@ public String getScheme() { return protocol.toString(); } - /** @return the port number that the container exposes */ + /** + * @return the port number that the container exposes + */ public int getPort() { return port; } @@ -109,11 +106,9 @@ public static ExposedPort sctp(int port) { /** * Parses a textual port specification (as used by the Docker CLI) to an {@link ExposedPort}. * - * @param serialized - * the specification, e.g. 80/tcp + * @param serialized the specification, e.g. 80/tcp * @return an {@link ExposedPort} matching the specification - * @throws IllegalArgumentException - * if the specification cannot be parsed + * @throws IllegalArgumentException if the specification cannot be parsed */ @JsonCreator public static ExposedPort parse(String serialized) throws IllegalArgumentException { diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java index 0e41b873f..bfcf65132 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/HealthCheck.java @@ -23,7 +23,6 @@ import java.util.List; /** - * * @author cdancy */ @EqualsAndHashCode @@ -71,6 +70,7 @@ public Long getTimeout() { /** * Set interval in nanoseconds + * * @return this {@link HealthCheck} instance */ public HealthCheck withInterval(Long interval) { @@ -80,6 +80,7 @@ public HealthCheck withInterval(Long interval) { /** * Set timeout in nanoseconds + * * @return this {@link HealthCheck} instance */ public HealthCheck withTimeout(Long timeout) { @@ -111,6 +112,7 @@ public Long getStartPeriod() { /** * Set startPeriod in nanoseconds + * * @return this {@link HealthCheck} instance */ public HealthCheck withStartPeriod(Long startPeriod) { @@ -124,6 +126,7 @@ public Long getStartInterval() { /** * Set startInterval in nanoseconds + * * @return this {@link HealthCheck} instance */ public HealthCheck withStartInterval(Long startInterval) { diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Identifier.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Identifier.java index a690548b4..1a7959b58 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Identifier.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Identifier.java @@ -28,9 +28,7 @@ public Identifier(Repository repository, String tag) { * Return an identifier that correctly splits up the repository and tag. There can be > 1 ":" fred/jim --> fred/jim, [] * fred/jim:123 --> fred/jim, 123 fred:123/jim:123 --> fred:123/jim, 123 * - * - * @param identifier - * as a string + * @param identifier as a string * @return parsed identifier. */ public static Identifier fromCompoundString(String identifier) { diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Image.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Image.java index 732dcfe4f..6c9b1c099 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Image.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Image.java @@ -1,7 +1,6 @@ package com.github.dockerjava.api.model; import com.fasterxml.jackson.annotation.JsonProperty; - import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,9 +8,7 @@ import java.util.Map; /** - * * @author Konstantin Pelykh (kpelykh@gmail.com) - * */ @EqualsAndHashCode @ToString diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Link.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Link.java index 4b9b27acf..ca6ee32aa 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Link.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Link.java @@ -22,10 +22,8 @@ public class Link extends DockerObject implements Serializable { /** * Creates a {@link Link} for the container with the given name and an aliased name for use in the target container. * - * @param name - * the name of the container that you want to link into the target container - * @param alias - * the aliased name under which the linked container will be available in the target container + * @param name the name of the container that you want to link into the target container + * @param alias the aliased name under which the linked container will be available in the target container */ public Link(final String name, final String alias) { this.name = name; @@ -49,11 +47,9 @@ public String getAlias() { /** * Parses a textual link specification (as used by the Docker CLI) to a {@link Link}. * - * @param serialized - * the specification, e.g. name:alias or /name1:/name2/alias + * @param serialized the specification, e.g. name:alias or /name1:/name2/alias * @return a {@link Link} matching the specification - * @throws IllegalArgumentException - * if the specification cannot be parsed + * @throws IllegalArgumentException if the specification cannot be parsed */ public static Link parse(final String serialized) throws IllegalArgumentException { try { diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Links.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Links.java index 18bfc75ba..766b0b9de 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Links.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Links.java @@ -1,12 +1,12 @@ package com.github.dockerjava.api.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + import java.io.Serializable; import java.util.List; import java.util.stream.Stream; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - public class Links implements Serializable { private static final long serialVersionUID = 1L; @@ -27,7 +27,7 @@ public Link[] getLinks() { @JsonCreator public static Links fromPrimitive(String[] links) { return new Links( - Stream.of(links).map(Link::parse).toArray(Link[]::new) + Stream.of(links).map(Link::parse).toArray(Link[]::new) ); } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Ports.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Ports.java index 0411ca218..839ad627a 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Ports.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Ports.java @@ -59,7 +59,7 @@ public void bind(ExposedPort exposedPort, Binding binding) { if (binding == null) { ports.put(exposedPort, null); } else { - ports.put(exposedPort, new Binding[] {binding}); + ports.put(exposedPort, new Binding[]{binding}); } } } @@ -182,7 +182,7 @@ public Binding(String hostIp, String hostPortSpec) { /** * @return the IP address on the Docker host. May be null, in which case Docker will bind the port to all interfaces ( - * 0.0.0.0). + * 0.0.0.0). */ public String getHostIp() { return hostIp; @@ -190,7 +190,7 @@ public String getHostIp() { /** * @return the port spec for the binding on the Docker host. May reference a single port ("1234"), a port range ("1234-2345") or - * null, in which case Docker will dynamically assign a port. + * null, in which case Docker will dynamically assign a port. */ public String getHostPortSpec() { return hostPortSpec; @@ -201,11 +201,9 @@ public String getHostPortSpec() { *

* Legal syntax: IP|IP:portSpec|portSpec where portSpec is either a single port or a port range * - * @param serialized - * serialized the specification, e.g. 127.0.0.1:80 + * @param serialized serialized the specification, e.g. 127.0.0.1:80 * @return a {@link Binding} matching the specification - * @throws IllegalArgumentException - * if the specification cannot be parsed + * @throws IllegalArgumentException if the specification cannot be parsed */ public static Binding parse(String serialized) throws IllegalArgumentException { try { @@ -269,19 +267,19 @@ public static Ports fromPrimitive(Map>> map) { public Map>> toPrimitive() { // Use reduce-like collect to be able to put nulls into the values return ports.entrySet().stream().collect( - HashMap::new, - (map, entry) -> { - List> value = entry.getValue() == null ? null : Stream.of(entry.getValue()) - .map(binding -> { - Map result = new HashMap<>(); - result.put("HostIp", binding.getHostIp() == null ? "" : binding.getHostIp()); - result.put("HostPort", binding.getHostPortSpec() == null ? "" : binding.getHostPortSpec()); - return result; - }) - .collect(Collectors.toList()); - map.put(entry.getKey().toString(), value); - }, - HashMap::putAll + HashMap::new, + (map, entry) -> { + List> value = entry.getValue() == null ? null : Stream.of(entry.getValue()) + .map(binding -> { + Map result = new HashMap<>(); + result.put("HostIp", binding.getHostIp() == null ? "" : binding.getHostIp()); + result.put("HostPort", binding.getHostPortSpec() == null ? "" : binding.getHostPortSpec()); + return result; + }) + .collect(Collectors.toList()); + map.put(entry.getKey().toString(), value); + }, + HashMap::putAll ); } } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Repository.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Repository.java index 5dd636981..67c4b543e 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Repository.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Repository.java @@ -20,8 +20,7 @@ public class Repository extends DockerObject implements Serializable { /** * Name may be eg. 'busybox' or '10.0.0.1:5000/fred' * - * @param name - * Repository name + * @param name Repository name */ public Repository(String name) { this.name = name; diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/SELContext.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/SELContext.java index b3d199f6f..a9d833e2d 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/SELContext.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/SELContext.java @@ -8,13 +8,19 @@ * @since 1.17 */ public enum SELContext { - /** no selinux */ + /** + * no selinux + */ none(""), - /** z option */ + /** + * z option + */ shared("z"), - /** Z option */ + /** + * Z option + */ single("Z"); /** @@ -35,10 +41,10 @@ public String toString() { public static SELContext fromString(String p) { switch (p) { - case "z": - return shared; - case "Z": - return single; + case "z": + return shared; + case "Z": + return single; } return none; } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/SearchItem.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/SearchItem.java index 23a5c3bbf..e1b74fbf2 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/SearchItem.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/SearchItem.java @@ -7,9 +7,7 @@ import java.io.Serializable; /** - * * @author Konstantin Pelykh (kpelykh@gmail.com) - * */ @EqualsAndHashCode @ToString diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Statistics.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Statistics.java index 3800363eb..cf5c75b5c 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Statistics.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Statistics.java @@ -1,14 +1,13 @@ package com.github.dockerjava.api.model; -import java.io.Serializable; -import java.util.Map; - -import javax.annotation.CheckForNull; - import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.ToString; +import javax.annotation.CheckForNull; +import java.io.Serializable; +import java.util.Map; + /** * Representation of a Docker statistics. */ diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volume.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volume.java index bc511476f..eeed099e8 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volume.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volume.java @@ -27,6 +27,7 @@ public class Volume implements Serializable { /** * Handles the {@code { "Destination" : { "path" : "/path/to/mount" } }} variant. + * * @param path the destination path of the bind mounted volume * @return a volume instance referring to the given path. * @deprecated use {@link #parse(Map)} @@ -39,6 +40,7 @@ public static Volume parse(@JsonProperty("path") String path) { /** * Handles the {@code { "Destination" : { "path" : "/path/to/mount" } }} variant. + * * @param path the destination path of the bind mounted volume * @return a volume instance referring to the given path. */ @@ -53,6 +55,7 @@ public static Volume parse(Map primitive) { /** * Creates a volume referring to the given path. * Handles the {@code { "Destination" : "/path/to/mount" }} variant. + * * @param path the destination path of the bind mounted volume */ public Volume(String path) { diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumeRW.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumeRW.java index 66ba57ced..5b89b8f80 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumeRW.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumeRW.java @@ -1,14 +1,14 @@ package com.github.dockerjava.api.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.EqualsAndHashCode; + import java.io.Serializable; import java.util.Collections; import java.util.Map; import java.util.Map.Entry; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import lombok.EqualsAndHashCode; - /** * Represents a bind mounted volume in a Docker container. * diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volumes.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volumes.java index 825b8481a..914adac49 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volumes.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/Volumes.java @@ -1,15 +1,15 @@ package com.github.dockerjava.api.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.ToString; + import java.io.Serializable; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import lombok.ToString; - @ToString public class Volumes implements Serializable { private static final long serialVersionUID = 1L; @@ -31,15 +31,15 @@ public Volume[] getVolumes() { @JsonCreator public static Volumes fromPrimitive(Map map) { return new Volumes( - map.keySet().stream().map(Volume::new).toArray(Volume[]::new) + map.keySet().stream().map(Volume::new).toArray(Volume[]::new) ); } @JsonValue public Map toPrimitive() { return Stream.of(volumes).collect(Collectors.toMap( - Volume::getPath, - __ -> new Object() + Volume::getPath, + __ -> new Object() )); } diff --git a/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumesRW.java b/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumesRW.java index 93e95b68c..ba19a8895 100644 --- a/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumesRW.java +++ b/docker-java-api/src/main/java/com/github/dockerjava/api/model/VolumesRW.java @@ -1,14 +1,14 @@ package com.github.dockerjava.api.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.ToString; + import java.io.Serializable; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import lombok.ToString; - // This is not going to be serialized @ToString public class VolumesRW implements Serializable { @@ -27,17 +27,17 @@ public VolumeRW[] getVolumesRW() { @JsonCreator public static VolumesRW fromPrimitive(Map map) { return new VolumesRW( - map.entrySet().stream() - .map(entry -> new VolumeRW(new Volume(entry.getKey()), AccessMode.fromBoolean(entry.getValue()))) - .toArray(VolumeRW[]::new) + map.entrySet().stream() + .map(entry -> new VolumeRW(new Volume(entry.getKey()), AccessMode.fromBoolean(entry.getValue()))) + .toArray(VolumeRW[]::new) ); } @JsonValue public Map toPrimitive() { return Stream.of(volumesRW).collect(Collectors.toMap( - it -> it.getVolume().getPath(), - it -> it.getAccessMode().toBoolean() + it -> it.getVolume().getPath(), + it -> it.getAccessMode().toBoolean() )); } } diff --git a/docker-java-api/src/test/java/com/github/dockerjava/api/model/DockerObjectArchTest.java b/docker-java-api/src/test/java/com/github/dockerjava/api/model/DockerObjectArchTest.java index 2df7051e9..8429bca52 100644 --- a/docker-java-api/src/test/java/com/github/dockerjava/api/model/DockerObjectArchTest.java +++ b/docker-java-api/src/test/java/com/github/dockerjava/api/model/DockerObjectArchTest.java @@ -34,7 +34,7 @@ void modelClassMustExtendDockerObject() { .and().doNotBelongToAnyOf(DockerObjectAccessor.class) .and(new DescribedPredicate("not @JsonCreator-based object") { @Override - public boolean apply(JavaClass input) { + public boolean test(JavaClass input) { return input.getAllMethods().stream().noneMatch(method -> { return method.isAnnotatedWith(JsonCreator.class); }); diff --git a/docker-java-core/pom.xml b/docker-java-core/pom.xml index 290a1fed9..28ca6199f 100644 --- a/docker-java-core/pom.xml +++ b/docker-java-core/pom.xml @@ -74,10 +74,9 @@ - com.google.code.findbugs - annotations - 3.0.1u2 - provided + com.github.spotbugs + spotbugs-annotations + ${spotbugs-annotations.version} diff --git a/docker-java-transport-httpclient5/pom.xml b/docker-java-transport-httpclient5/pom.xml index 48b751d56..2bc130b7e 100644 --- a/docker-java-transport-httpclient5/pom.xml +++ b/docker-java-transport-httpclient5/pom.xml @@ -25,17 +25,15 @@ docker-java-transport ${project.version} - org.apache.httpcomponents.client5 httpclient5 - 5.0.3 + ${httpclient5.version} - net.java.dev.jna jna - 5.13.0 + ${jna.version} @@ -51,6 +49,8 @@ com.github.siom79.japicmp japicmp-maven-plugin + ${japicmp-maven-plugin.version} + true diff --git a/docker-java-transport-jersey/pom.xml b/docker-java-transport-jersey/pom.xml index fbef13f1e..696f5163d 100644 --- a/docker-java-transport-jersey/pom.xml +++ b/docker-java-transport-jersey/pom.xml @@ -39,7 +39,7 @@ org.apache.httpcomponents httpcore - 4.4.13 + ${httpcore.version} org.apache.httpcomponents @@ -76,7 +76,7 @@ org.slf4j jcl-over-slf4j - 1.7.30 + ${jcl-over-slf4j.version} test @@ -94,10 +94,15 @@ com.github.siom79.japicmp japicmp-maven-plugin + ${japicmp-maven-plugin.version} + jakarta.ws.rs.WebApplicationException + javax.ws.rs.WebApplicationException + javax.ws.rs.core.Response + javax.ws.rs.core.Response.Status com.github.dockerjava.jaxrs.ApacheUnixSocket com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier com.github.dockerjava.jaxrs.async.GETCallbackNotifier diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerCmdExecFactory.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerCmdExecFactory.java index 6298cae3b..5382f308d 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerCmdExecFactory.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerCmdExecFactory.java @@ -7,10 +7,10 @@ import com.github.dockerjava.core.DockerClientConfigAware; import com.github.dockerjava.core.DockerClientImpl; import com.github.dockerjava.transport.DockerHttpClient; +import jakarta.ws.rs.client.ClientRequestFilter; +import jakarta.ws.rs.client.ClientResponseFilter; import org.glassfish.jersey.client.RequestEntityProcessing; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.ClientResponseFilter; //import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; // see https://github.com/docker-java/docker-java/issues/196 diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerHttpClient.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerHttpClient.java index 78a65cf63..e3d0dbf32 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerHttpClient.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerHttpClient.java @@ -6,6 +6,14 @@ import com.github.dockerjava.transport.SSLConfig; import com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter; import com.github.dockerjava.jaxrs.filter.SelectiveLoggingFilter; +import jakarta.ws.rs.ProcessingException; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.ClientRequestFilter; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.MediaType; import org.apache.http.client.config.RequestConfig; import org.apache.http.config.Registry; import org.apache.http.config.RegistryBuilder; @@ -24,14 +32,6 @@ import org.slf4j.LoggerFactory; import javax.net.ssl.SSLContext; -import javax.ws.rs.ProcessingException; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.MediaType; import java.io.InputStream; import java.net.InetSocketAddress; import java.net.Proxy; @@ -361,9 +361,9 @@ public void close() { private static class JerseyResponse implements Response { - private final javax.ws.rs.core.Response response; + private final jakarta.ws.rs.core.Response response; - JerseyResponse(javax.ws.rs.core.Response response) { + JerseyResponse(jakarta.ws.rs.core.Response response) { this.response = response; } diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/FollowRedirectsFilter.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/FollowRedirectsFilter.java index 64f5e88f8..a0094934a 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/FollowRedirectsFilter.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/FollowRedirectsFilter.java @@ -3,10 +3,10 @@ import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientResponseContext; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.client.ClientResponseContext; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.core.Response; /** * Default implementation of RedirectStrategy honors the restrictions on automatic redirection of entity enclosing methods such as POST and diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/JsonClientFilter.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/JsonClientFilter.java index a62034d27..e5c7465b9 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/JsonClientFilter.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/JsonClientFilter.java @@ -2,10 +2,10 @@ import java.io.IOException; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientResponseContext; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.client.ClientResponseContext; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.core.MediaType; /** * diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/LoggingFilter.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/LoggingFilter.java index 986b4c10a..46c2631cb 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/LoggingFilter.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/LoggingFilter.java @@ -53,20 +53,20 @@ import java.util.TreeSet; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Priority; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.ClientResponseContext; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.container.ContainerResponseFilter; -import javax.ws.rs.container.PreMatching; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.WriterInterceptor; -import javax.ws.rs.ext.WriterInterceptorContext; +import jakarta.annotation.Priority; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.client.ClientRequestFilter; +import jakarta.ws.rs.client.ClientResponseContext; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.container.PreMatching; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.WriterInterceptor; +import jakarta.ws.rs.ext.WriterInterceptorContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/ResponseStatusExceptionFilter.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/ResponseStatusExceptionFilter.java index 8cc0a0746..c1b5d7a15 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/ResponseStatusExceptionFilter.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/ResponseStatusExceptionFilter.java @@ -14,10 +14,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientResponseContext; -import javax.ws.rs.client.ClientResponseFilter; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.client.ClientResponseContext; +import jakarta.ws.rs.client.ClientResponseFilter; +import jakarta.ws.rs.core.MediaType; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/SelectiveLoggingFilter.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/SelectiveLoggingFilter.java index 862bdf0a9..31a9b803c 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/SelectiveLoggingFilter.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/filter/SelectiveLoggingFilter.java @@ -5,9 +5,9 @@ import java.util.HashSet; import java.util.Set; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.client.ClientRequestContext; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; import org.slf4j.Logger; diff --git a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/util/WrappedResponseInputStream.java b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/util/WrappedResponseInputStream.java index 11e9f8684..fcfc4c261 100644 --- a/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/util/WrappedResponseInputStream.java +++ b/docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/util/WrappedResponseInputStream.java @@ -1,9 +1,10 @@ package com.github.dockerjava.jaxrs.util; +import jakarta.ws.rs.core.Response; + import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.core.Response; /** * This is a wrapper around {@link Response} that acts as a {@link InputStream}. When this {@link WrappedResponseInputStream} is closed it diff --git a/docker-java-transport-okhttp/pom.xml b/docker-java-transport-okhttp/pom.xml index df14ad077..a950f3f3f 100644 --- a/docker-java-transport-okhttp/pom.xml +++ b/docker-java-transport-okhttp/pom.xml @@ -25,19 +25,16 @@ docker-java-core ${project.version} - com.squareup.okhttp3 okhttp - 3.14.9 + ${okhttp.version} - net.java.dev.jna jna - 5.13.0 + ${jna.version} - ${project.groupId} docker-java-transport-tck @@ -51,6 +48,7 @@ com.github.siom79.japicmp japicmp-maven-plugin + ${japicmp-maven-plugin.version} diff --git a/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/HijackingInterceptor.java b/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/HijackingInterceptor.java index 275d8290b..2ff4dd202 100644 --- a/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/HijackingInterceptor.java +++ b/docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp/HijackingInterceptor.java @@ -37,10 +37,10 @@ public Response intercept(Chain chain) throws IOException { chain.call().timeout().clearTimeout().clearDeadline(); - Exchange exchange = ((RealInterceptorChain) chain).exchange(); + Exchange exchange = ((RealInterceptorChain) chain).getExchange$okhttp(); RealWebSocket.Streams streams = exchange.newWebSocketStreams(); Thread thread = new Thread(() -> { - try (BufferedSink sink = streams.sink) { + try (BufferedSink sink = streams.getSink()) { while (sink.isOpen()) { int aByte = stdin.read(); if (aByte < 0) { diff --git a/docker-java-transport-tck/pom.xml b/docker-java-transport-tck/pom.xml index 2e4bd79ce..5a6efea19 100644 --- a/docker-java-transport-tck/pom.xml +++ b/docker-java-transport-tck/pom.xml @@ -30,23 +30,20 @@ docker-java-transport ${project.version} - org.assertj assertj-core - 3.24.2 + ${assertj-core.version} - com.squareup.okhttp3 mockwebserver - 3.14.9 + ${okhttp.version} - org.testcontainers testcontainers - 1.19.1 + ${testcontainers.version} diff --git a/docker-java-transport-zerodep/pom.xml b/docker-java-transport-zerodep/pom.xml index 3cccafa33..2b1238f73 100644 --- a/docker-java-transport-zerodep/pom.xml +++ b/docker-java-transport-zerodep/pom.xml @@ -32,6 +32,7 @@ com.github.siom79.japicmp japicmp-maven-plugin + ${japicmp-maven-plugin.version} true diff --git a/docker-java-transport/pom.xml b/docker-java-transport/pom.xml index 2ca377dd6..9db05d095 100644 --- a/docker-java-transport/pom.xml +++ b/docker-java-transport/pom.xml @@ -21,23 +21,20 @@ - com.google.code.findbugs - annotations - 3.0.1u2 - provided + com.github.spotbugs + spotbugs-annotations + ${spotbugs-annotations.version} - org.immutables value - 2.8.2 + ${org.immutables.version} provided - net.java.dev.jna jna - 5.13.0 + ${jna.version} provided diff --git a/docker-java/pom.xml b/docker-java/pom.xml index e3c3690f1..ca203b350 100644 --- a/docker-java/pom.xml +++ b/docker-java/pom.xml @@ -20,6 +20,11 @@ + + net.jcip + jcip-annotations + ${jcip-annotations.version} + ${project.groupId} docker-java-core @@ -35,13 +40,11 @@ docker-java-transport-netty ${project.version} - org.slf4j jcl-over-slf4j ${slf4j-api.version} - ${project.groupId} @@ -61,21 +64,18 @@ ${logback.version} test - ch.qos.logback logback-classic ${logback.version} test - org.hamcrest hamcrest-library ${hamcrest.library.version} test - com.googlecode.lambdaj lambdaj @@ -88,14 +88,12 @@ - org.testinfected.hamcrest-matchers jpa-matchers ${hamcrest.jpa-matchers} test - org.mockito mockito-core @@ -104,29 +102,27 @@ - com.google.code.findbugs - annotations - 3.0.1u2 - provided + com.github.spotbugs + spotbugs-annotations + 4.9.1 junit junit - 4.13 + ${junit.version} test org.awaitility awaitility - 4.0.1 + ${awaitility.version} test com.fasterxml.jackson.core jackson-databind - - 2.8.8 + ${jackson.version} test @@ -134,7 +130,7 @@ com.fasterxml.jackson.core jackson-annotations - 2.8.8 + ${jackson.version} test @@ -184,7 +180,8 @@ true - !com.github.dockerjava.jaxrs.*,!com.github.dockerjava.netty.*,com.github.dockerjava.* + !com.github.dockerjava.jaxrs.*,!com.github.dockerjava.netty.*,com.github.dockerjava.* + org.newsclub.net.unix;resolution:="optional",* diff --git a/docker-java/src/main/java/com/github/dockerjava/core/DockerClientBuilder.java b/docker-java/src/main/java/com/github/dockerjava/core/DockerClientBuilder.java index a3e4c3909..2d02970b4 100644 --- a/docker-java/src/main/java/com/github/dockerjava/core/DockerClientBuilder.java +++ b/docker-java/src/main/java/com/github/dockerjava/core/DockerClientBuilder.java @@ -27,7 +27,6 @@ public static DockerClientBuilder getInstance() { } /** - * * @deprecated use {@link #getInstance(DockerClientConfig)} */ @Deprecated @@ -40,7 +39,6 @@ public static DockerClientBuilder getInstance(DockerClientConfig dockerClientCon } /** - * * @deprecated use {@link DefaultDockerClientConfig.Builder#withDockerHost(String)} */ @Deprecated @@ -53,7 +51,6 @@ public static DockerClientBuilder getInstance(String serverUrl) { } /** - * * @deprecated no replacement, use one of {@link DockerHttpClient} */ @Deprecated diff --git a/docker-java/src/test/java/com/github/dockerjava/api/ModelsSerializableTest.java b/docker-java/src/test/java/com/github/dockerjava/api/ModelsSerializableTest.java index 1c7c1de6c..6c232318b 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/ModelsSerializableTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/ModelsSerializableTest.java @@ -33,13 +33,13 @@ public class ModelsSerializableTest { private static final Logger LOG = LoggerFactory.getLogger(ModelsSerializableTest.class); private List excludeClasses = Arrays.asList( - Binds.class.getName(), - BuildResponseItem.class.getName(), - PullResponseItem.class.getName(), - PushResponseItem.class.getName(), - ResponseItem.class.getName(), - ResponseItem.ErrorDetail.class.getName(), - ResponseItem.ProgressDetail.class.getName() + Binds.class.getName(), + BuildResponseItem.class.getName(), + PullResponseItem.class.getName(), + PushResponseItem.class.getName(), + ResponseItem.class.getName(), + ResponseItem.ErrorDetail.class.getName(), + ResponseItem.ProgressDetail.class.getName() ); @Test @@ -60,7 +60,7 @@ public void allModelsSerializable() throws IOException, NoSuchFieldException, Il final Class aClass = classInfo.load(); if (aClass.getProtectionDomain().getCodeSource().getLocation().getPath().endsWith("test-classes/") - || aClass.isEnum()) { + || aClass.isEnum()) { continue; } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/command/CommandJSONSamples.java b/docker-java/src/test/java/com/github/dockerjava/api/command/CommandJSONSamples.java index 0cf5141d4..960bf85ba 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/command/CommandJSONSamples.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/command/CommandJSONSamples.java @@ -19,7 +19,7 @@ /** * References test resources and provides basic tests functionality. - * + * * @author Oleg Nenashev */ public enum CommandJSONSamples implements JSONResourceRef { diff --git a/docker-java/src/test/java/com/github/dockerjava/api/command/InspectContainerResponseTest.java b/docker-java/src/test/java/com/github/dockerjava/api/command/InspectContainerResponseTest.java index 12105e8a1..7a4d52a3c 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/command/InspectContainerResponseTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/command/InspectContainerResponseTest.java @@ -58,7 +58,7 @@ public void roundTrip_full() throws IOException { // Check volumes: https://github.com/docker-java/docker-java/issues/211 assertEquals(2, response.getVolumes().length); assertEquals(2, response.getVolumesRW().length); - assertEquals("/bar/foo/myvol2" ,response.getVolumes()[1].getContainerPath()); + assertEquals("/bar/foo/myvol2", response.getVolumes()[1].getContainerPath()); assertEquals("/path2", response.getVolumes()[1].getHostPath()); assertEquals("/bar/foo/myvol2", response.getVolumesRW()[1].getVolume().getPath()); assertFalse(response.getVolumesRW()[1].getAccessMode().toBoolean()); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/command/InspectExecResponseTest.java b/docker-java/src/test/java/com/github/dockerjava/api/command/InspectExecResponseTest.java index 2449d39be..75865b9a6 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/command/InspectExecResponseTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/command/InspectExecResponseTest.java @@ -7,9 +7,9 @@ import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.core.IsNull.notNullValue; import static org.hamcrest.core.IsNull.nullValue; @@ -23,14 +23,14 @@ public void test_1_22_SerDer1() throws Exception { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(InspectExecResponse.class); final InspectExecResponse execResponse = testRoundTrip(RemoteApiVersion.VERSION_1_22, - "/exec/ID/1.json", - type + "/exec/ID/1.json", + type ); assertThat(execResponse, notNullValue()); assertThat(execResponse.getId(), - is("1ca2ca598fab202f86dd9281196c405456069013958a475396b707e85c56473b")); + is("1ca2ca598fab202f86dd9281196c405456069013958a475396b707e85c56473b")); assertThat(execResponse.isRunning(), is(false)); assertThat(execResponse.getExitCode(), is(nullValue())); @@ -48,7 +48,7 @@ public void test_1_22_SerDer1() throws Exception { assertThat(execResponse.isOpenStdout(), is(true)); assertThat(execResponse.getCanRemove(), is(false)); assertThat(execResponse.getContainerID(), - is("ffa39805f089af3099e36452a985481f96170a9dff40be69d34d1722c7660d38")); + is("ffa39805f089af3099e36452a985481f96170a9dff40be69d34d1722c7660d38")); assertThat(execResponse.getDetachKeys(), is(emptyString())); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/command/InspectImageResponseTest.java b/docker-java/src/test/java/com/github/dockerjava/api/command/InspectImageResponseTest.java index a7ec3a78d..742398894 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/command/InspectImageResponseTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/command/InspectImageResponseTest.java @@ -14,11 +14,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @@ -31,55 +31,55 @@ public void serder1_22Json() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(InspectImageResponse.class); final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, - "images/image1/inspect1.json", - type + "images/image1/inspect1.json", + type ); final ContainerConfig config = new ContainerConfig() - .withAttachStderr(false) - .withAttachStdin(false) - .withAttachStdout(false) - .withCmd(null) - .withDomainName("") - .withEntrypoint(null) - .withEnv(new String[]{"HOME=/", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}) - .withExposedPorts(null) - .withHostName("aee9ba801acc") - .withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158") - .withLabels(null) - .withMacAddress(null) - .withNetworkDisabled(null) - .withOnBuild(new String[]{}) - .withStdinOpen(false) - .withPortSpecs(null) - .withStdInOnce(false) - .withTty(false) - .withUser("") - .withVolumes(null) - .withWorkingDir(""); + .withAttachStderr(false) + .withAttachStdin(false) + .withAttachStdout(false) + .withCmd(null) + .withDomainName("") + .withEntrypoint(null) + .withEnv(new String[]{"HOME=/", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}) + .withExposedPorts(null) + .withHostName("aee9ba801acc") + .withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158") + .withLabels(null) + .withMacAddress(null) + .withNetworkDisabled(null) + .withOnBuild(new String[]{}) + .withStdinOpen(false) + .withPortSpecs(null) + .withStdInOnce(false) + .withTty(false) + .withUser("") + .withVolumes(null) + .withWorkingDir(""); final ContainerConfig containerConfig = new ContainerConfig() - .withAttachStderr(false) - .withAttachStdin(false) - .withAttachStdout(false) - .withCmd(new String[]{"/bin/sh", "-c", "#(nop) MAINTAINER hack@worldticket.net"}) - .withDomainName("") - .withEntrypoint(null) - .withEnv(new String[]{"HOME=/", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}) - .withExposedPorts(null) - .withHostName("aee9ba801acc") - .withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158") - .withLabels(null) - .withMacAddress(null) - .withNetworkDisabled(null) - .withOnBuild(new String[]{}) - .withStdinOpen(false) - .withPortSpecs(null) - .withStdInOnce(false) - .withTty(false) - .withUser("") - .withVolumes(null) - .withWorkingDir(""); + .withAttachStderr(false) + .withAttachStdin(false) + .withAttachStdout(false) + .withCmd(new String[]{"/bin/sh", "-c", "#(nop) MAINTAINER hack@worldticket.net"}) + .withDomainName("") + .withEntrypoint(null) + .withEnv(new String[]{"HOME=/", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}) + .withExposedPorts(null) + .withHostName("aee9ba801acc") + .withImage("511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158") + .withLabels(null) + .withMacAddress(null) + .withNetworkDisabled(null) + .withOnBuild(new String[]{}) + .withStdinOpen(false) + .withPortSpecs(null) + .withStdInOnce(false) + .withTty(false) + .withUser("") + .withVolumes(null) + .withWorkingDir(""); assertThat(inspectImage, notNullValue()); assertThat(inspectImage.getArch(), is("amd64")); @@ -115,21 +115,21 @@ public void serder1_22Json() throws IOException { final InspectImageResponse inspectImageResponse = new InspectImageResponse().withArch("amd64") - .withAuthor("hack@worldticket.net") - .withComment("") - .withConfig(config) - .withContainer("aee9ba801acca0e648ffd91df204ba82ae85d97608a4864a019e2004d7e1b133") - .withContainerConfig(containerConfig) - .withCreated("2014-04-29T19:59:10.84997669Z") - .withDockerVersion("0.8.1") - .withId("sha256:ee45fe0d1fcdf1a0f9c2d1e36c6f4b3202bbb2032f14d7c9312b27bfcf6aee24") - .withOs("linux") - .withParent("") - .withSize(0L) - .withRepoTags(Collections.singletonList("hackmann/empty:latest")) - .withRepoDigests(Collections.emptyList()) - .withVirtualSize(0L) - .withGraphDriver(aufsGraphDriver); + .withAuthor("hack@worldticket.net") + .withComment("") + .withConfig(config) + .withContainer("aee9ba801acca0e648ffd91df204ba82ae85d97608a4864a019e2004d7e1b133") + .withContainerConfig(containerConfig) + .withCreated("2014-04-29T19:59:10.84997669Z") + .withDockerVersion("0.8.1") + .withId("sha256:ee45fe0d1fcdf1a0f9c2d1e36c6f4b3202bbb2032f14d7c9312b27bfcf6aee24") + .withOs("linux") + .withParent("") + .withSize(0L) + .withRepoTags(Collections.singletonList("hackmann/empty:latest")) + .withRepoDigests(Collections.emptyList()) + .withVirtualSize(0L) + .withGraphDriver(aufsGraphDriver); assertThat(inspectImage, equalTo(inspectImageResponse)); } @@ -140,23 +140,23 @@ public void serder1_22_doc() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(InspectImageResponse.class); final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, - "images/docImage/doc.json", - type + "images/docImage/doc.json", + type ); assertThat(inspectImage, notNullValue()); assertThat(inspectImage.getRepoDigests(), hasSize(1)); assertThat(inspectImage.getRepoDigests(), - contains("localhost:5000/test/busybox/example@" + - "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf") + contains("localhost:5000/test/busybox/example@" + + "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf") ); assertThat(inspectImage.getRepoTags(), hasSize(3)); assertThat(inspectImage.getRepoTags(), containsInAnyOrder( - "example:1.0", - "example:latest", - "example:stable" + "example:1.0", + "example:latest", + "example:stable" )); } @@ -165,14 +165,14 @@ public void serder1_22_inspect_doc() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(InspectImageResponse.class); final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, - "images/docImage/inspect_doc.json", - type + "images/docImage/inspect_doc.json", + type ); GraphData newGraphData = new GraphData() - .withDeviceId("5") - .withDeviceName("docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47") - .withDeviceSize("171798691840"); + .withDeviceId("5") + .withDeviceName("docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47") + .withDeviceSize("171798691840"); assertThat(inspectImage, notNullValue()); GraphDriver graphDriver = inspectImage.getGraphDriver(); @@ -183,9 +183,9 @@ public void serder1_22_inspect_doc() throws IOException { assertThat(data.getDeviceId(), is("5")); assertThat(data.getDeviceName(), - is("docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47")); + is("docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47")); assertThat(data.getDeviceSize(), - is("171798691840")); + is("171798691840")); } @Test @@ -195,7 +195,7 @@ public void testOverlayNetworkRootDir() throws IOException { final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_22, "images/overlay/inspectOverlay.json", type); final GraphData overlayGraphData = new GraphData() - .withRootDir("/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root"); + .withRootDir("/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root"); final GraphDriver overlayGraphDriver = new GraphDriver().withName("overlay").withData(overlayGraphData); final GraphDriver graphDriver = inspectImage.getGraphDriver(); assertThat(graphDriver, notNullValue()); @@ -209,20 +209,20 @@ public void inspectWindowsImage() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(InspectImageResponse.class); final InspectImageResponse inspectImage = testRoundTrip(VERSION_1_25, - "images/windowsImage/doc.json", - type + "images/windowsImage/doc.json", + type ); assertThat(inspectImage, notNullValue()); assertThat(inspectImage.getRepoTags(), hasSize(1)); assertThat(inspectImage.getRepoTags(), contains( - "microsoft/nanoserver:latest" + "microsoft/nanoserver:latest" )); assertThat(inspectImage.getRepoDigests(), hasSize(1)); assertThat(inspectImage.getRepoDigests(), contains("microsoft/nanoserver@" + - "sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b") + "sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b") ); assertThat(inspectImage.getConfig(), notNullValue()); @@ -237,14 +237,14 @@ public void inspectWindowsImage() throws IOException { assertThat(inspectImage.getGraphDriver().getName(), is("windowsfilter")); assertThat(inspectImage.getGraphDriver().getData(), notNullValue()); assertThat(inspectImage.getGraphDriver().getData().getDir(), is("C:\\control\\windowsfilter\\" + - "6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf" + "6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf" )); assertThat(inspectImage.getRootFS(), notNullValue()); assertThat(inspectImage.getRootFS().getType(), is("layers")); assertThat(inspectImage.getRootFS().getLayers(), hasSize(1)); assertThat(inspectImage.getRootFS().getLayers(), contains( - "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063" + "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063" )); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/AuthConfigTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/AuthConfigTest.java index ae3e4a91b..136d12835 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/AuthConfigTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/AuthConfigTest.java @@ -8,7 +8,10 @@ import java.io.IOException; import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip; -import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; @@ -26,8 +29,8 @@ public void serderDocs1() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(AuthConfig.class); final AuthConfig authConfig = testRoundTrip(RemoteApiVersion.VERSION_1_22, - "/other/AuthConfig/docs1.json", - type + "/other/AuthConfig/docs1.json", + type ); assertThat(authConfig, notNullValue()); @@ -36,8 +39,8 @@ public void serderDocs1() throws IOException { assertThat(authConfig.getEmail(), is("jdoe@acme.com")); final AuthConfig authConfig1 = new AuthConfig().withUsername("jdoe") - .withPassword("secret") - .withEmail("jdoe@acme.com"); + .withPassword("secret") + .withEmail("jdoe@acme.com"); assertThat(authConfig1, equalTo(authConfig)); } @@ -47,8 +50,8 @@ public void serderDocs2() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(AuthConfig.class); final AuthConfig authConfig = testRoundTrip(RemoteApiVersion.VERSION_1_22, - "/other/AuthConfig/docs2.json", - type + "/other/AuthConfig/docs2.json", + type ); assertThat(authConfig, notNullValue()); @@ -64,8 +67,8 @@ public void serderDocs2() throws IOException { public void compatibleWithIdentitytoken() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(AuthConfig.class); final AuthConfig authConfig = testRoundTrip(RemoteApiVersion.VERSION_1_23, - "/other/AuthConfig/docs1.json", - type + "/other/AuthConfig/docs1.json", + type ); String auth = "YWRtaW46"; String identitytoken = "1cba468e-8cbe-4c55-9098-2c2ed769e885"; @@ -80,8 +83,8 @@ public void compatibleWithIdentitytoken() throws IOException { public void shouldNotFailWithStackOrchestratorInConfig() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(AuthConfig.class); final AuthConfig authConfig = testRoundTrip(RemoteApiVersion.VERSION_1_25, - "/other/AuthConfig/orchestrators.json", - type + "/other/AuthConfig/orchestrators.json", + type ); assertThat(authConfig, notNullValue()); assertThat(authConfig.getAuth(), is(nullValue())); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/BindPropagationTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/BindPropagationTest.java index 0fe65c048..5c7bede89 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/BindPropagationTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/BindPropagationTest.java @@ -3,8 +3,8 @@ import com.github.dockerjava.test.serdes.JSONTestHelper; import org.junit.Test; -import static org.hamcrest.Matchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; public class BindPropagationTest { diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/BindTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/BindTest.java index 663231151..706f647df 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/BindTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/BindTest.java @@ -243,7 +243,7 @@ public void parseReadOnlySEL() { @Test public void parseInvalidAccessMode() { expectedEx.expect(IllegalArgumentException.class); - expectedEx.expectMessage( "Error parsing Bind"); + expectedEx.expectMessage("Error parsing Bind"); Bind.parse("/host:/container:xx"); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/BindsTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/BindsTest.java index 83c5ba788..90f8e6063 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/BindsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/BindsTest.java @@ -3,18 +3,18 @@ import com.github.dockerjava.test.serdes.JSONTestHelper; import org.junit.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; public class BindsTest { @Test public void usesToJson() throws Exception { Binds binds = new Binds( - Bind.parse("/foo:/bar:rw"), - Bind.parse("/bip:/bop:ro") + Bind.parse("/foo:/bar:rw"), + Bind.parse("/bip:/bop:ro") ); String json = JSONTestHelper.getMapper().writeValueAsString(binds); @@ -27,8 +27,8 @@ public void usesFromJson() throws Exception { assertThat(binds, notNullValue()); assertThat(binds.getBinds(), arrayContaining( - Bind.parse("/foo:/bar:rw"), - Bind.parse("/bip:/bop:ro") + Bind.parse("/foo:/bar:rw"), + Bind.parse("/bip:/bop:ro") )); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/ContainerTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/ContainerTest.java index 7b1e22f0d..d9649d518 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/ContainerTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/ContainerTest.java @@ -23,8 +23,8 @@ public void serderJson1() throws IOException { final CollectionType type = JSONTestHelper.getMapper().getTypeFactory().constructCollectionType(List.class, Container.class); final List containers = testRoundTrip(RemoteApiVersion.VERSION_1_22, - "containers/json/filter1.json", - type + "containers/json/filter1.json", + type ); assertThat(containers.size(), equalTo(1)); @@ -32,7 +32,7 @@ public void serderJson1() throws IOException { final Container container = containers.get(0); assertThat(container.getImageId(), - equalTo("sha256:0cb40641836c461bc97c793971d84d758371ed682042457523e4ae701efe7ec9")); + equalTo("sha256:0cb40641836c461bc97c793971d84d758371ed682042457523e4ae701efe7ec9")); assertThat(container.getSizeRootFs(), equalTo(1113554L)); final ContainerHostConfig hostConfig = container.getHostConfig(); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/DeviceTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/DeviceTest.java index 9d191fe52..ce9145026 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/DeviceTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/DeviceTest.java @@ -19,15 +19,15 @@ public class DeviceTest { public static List validPaths = Arrays.asList( - "/home", - "/home:/home", - "/home:/something/else", - "/with space", - "/home:/with space", - "relative:/absolute-path", - "hostPath:/containerPath:r", - "/hostPath:/containerPath:rw", - "/hostPath:/containerPath:mrw" + "/home", + "/home:/home", + "/home:/something/else", + "/with space", + "/home:/with space", + "relative:/absolute-path", + "hostPath:/containerPath:r", + "/hostPath:/containerPath:rw", + "/hostPath:/containerPath:mrw" ); public static HashMap badPaths = new LinkedHashMap() {{ @@ -56,16 +56,16 @@ public class DeviceTest { @Test public void testParse() { assertThat(Device.parse("/dev/sda:/dev/xvdc:r"), - equalTo(new Device("r", "/dev/xvdc", "/dev/sda"))); + equalTo(new Device("r", "/dev/xvdc", "/dev/sda"))); assertThat(Device.parse("/dev/snd:rw"), - equalTo(new Device("rw", "/dev/snd", "/dev/snd"))); + equalTo(new Device("rw", "/dev/snd", "/dev/snd"))); assertThat(Device.parse("/dev/snd:/something"), - equalTo(new Device("rwm", "/something", "/dev/snd"))); + equalTo(new Device("rwm", "/something", "/dev/snd"))); assertThat(Device.parse("/dev/snd:/something:rw"), - equalTo(new Device("rw", "/something", "/dev/snd"))); + equalTo(new Device("rw", "/something", "/dev/snd"))); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/EventsTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/EventsTest.java index 0f0b2456d..7e3f949ae 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/EventsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/EventsTest.java @@ -26,8 +26,8 @@ public void serderDocs1() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Event.class); final Event event = testRoundTrip(RemoteApiVersion.VERSION_1_24, - "/events/docs1.json", - type + "/events/docs1.json", + type ); assertThat(event, notNullValue()); @@ -45,18 +45,18 @@ public void serderDocs1() throws IOException { attributes.put("name", "my-container"); final EventActor actor = new EventActor() - .withId("ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743") - .withAttributes(attributes); + .withId("ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743") + .withAttributes(attributes); final Event event1 = new Event() - .withType(CONTAINER) - .withStatus("create") - .withId("ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743") - .withFrom("alpine") - .withTime(1461943101L) - .withTimenano(1461943101381709551L) - .withAction("create") - .withEventActor(actor); + .withType(CONTAINER) + .withStatus("create") + .withId("ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743") + .withFrom("alpine") + .withTime(1461943101L) + .withTimenano(1461943101381709551L) + .withAction("create") + .withEventActor(actor); assertThat(event1, equalTo(event)); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/HostConfigTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/HostConfigTest.java index 5e13103dd..f162910e3 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/HostConfigTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/HostConfigTest.java @@ -10,6 +10,6 @@ public class HostConfigTest { @Test public void testNewObjectsEqual() { assertThat(HostConfig.newHostConfig(), - equalTo(HostConfig.newHostConfig())); + equalTo(HostConfig.newHostConfig())); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/InfoTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/InfoTest.java index 71d4d60d4..aecbae013 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/InfoTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/InfoTest.java @@ -21,10 +21,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @@ -38,15 +38,15 @@ public void serder1Json() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Info.class); final Info info = testRoundTrip(VERSION_1_22, - "info/1.json", - type + "info/1.json", + type ); final List> driverStatus = asList( - asList("Root Dir", "/mnt/sda1/var/lib/docker/aufs"), - asList("Backing Filesystem", "extfs"), - asList("Dirs", "31"), - asList("Dirperm1 Supported", "true") + asList("Root Dir", "/mnt/sda1/var/lib/docker/aufs"), + asList("Backing Filesystem", "extfs"), + asList("Dirs", "31"), + asList("Dirperm1 Supported", "true") ); final Map> plugins = new LinkedHashMap<>(); @@ -95,7 +95,7 @@ public void serder1Json() throws IOException { final Map indexConfigs = registryConfig.getIndexConfigs(); assertThat(indexConfigs, notNullValue()); final IndexConfig indexConfig = new IndexConfig().withMirrors(null).withName("docker.io") - .withSecure(true).withOfficial(true); + .withSecure(true).withOfficial(true); assertThat(indexConfigs, hasEntry("docker.io", indexConfig)); assertThat(registryConfig.getMirrors(), nullValue()); @@ -112,62 +112,61 @@ public void serder1Json() throws IOException { assertThat(info.getOomKillDisable(), is(true)); assertThat(info.getLoggingDriver(), is("json-file")); assertThat(info.getOperatingSystem(), - is("Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016")); + is("Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016")); assertThat(info.getClusterStore(), is("")); final Info withInfo = new Info().withArchitecture("x86_64") - .withContainers(2) - .withContainersRunning(2) - .withContainersPaused(10) - .withContainersStopped(3) - .withImages(13) - .withId("HLN2:5SBU:SRQR:CQI6:AB52:LZZ2:DED5:REDM:BU73:JFHE:R37A:5HMX") - .withDriver("aufs") - .withDriverStatuses(driverStatus) - .withSystemStatus(null) - .withPlugins(plugins) - .withMemoryLimit(true) - .withSwapLimit(true) - .withCpuCfsPeriod(true) - .withCpuCfsQuota(true) - .withCpuShares(true) - .withCpuSet(true) - .withIPv4Forwarding(true) - .withBridgeNfIptables(true) - .withBridgeNfIp6tables(true) - .withDebug(true) - .withNFd(24) - .withOomKillDisable(true) - .withNGoroutines(40) - .withSystemTime("2016-02-17T14:56:35.212841831Z") - .withExecutionDriver("native-0.2") - .withLoggingDriver("json-file") - .withNEventsListener(0) - .withKernelVersion("4.1.17-boot2docker") - .withOperatingSystem("Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016") - .withOsType("linux") - .withIndexServerAddress("https://index.docker.io/v1/") - .withRegistryConfig(registryConfig) - .withInitSha1("") - .withInitPath("/usr/local/bin/docker") - .withNCPU(1) - .withMemTotal(1044574208L) - .withDockerRootDir("/mnt/sda1/var/lib/docker") - .withHttpProxy("") - .withHttpsProxy("") - .withNoProxy("") - .withName("docker-java") - .withLabels(new String[]{"provider=virtualbox"}) - .withExperimentalBuild(false) - .withServerVersion("1.10.1") - .withClusterStore("") - .withClusterAdvertise("") - //shredinger-fields - .withDiscoveryBackend(null) - .withOomScoreAdj(null) - .withSockets(null) - ; + .withContainers(2) + .withContainersRunning(2) + .withContainersPaused(10) + .withContainersStopped(3) + .withImages(13) + .withId("HLN2:5SBU:SRQR:CQI6:AB52:LZZ2:DED5:REDM:BU73:JFHE:R37A:5HMX") + .withDriver("aufs") + .withDriverStatuses(driverStatus) + .withSystemStatus(null) + .withPlugins(plugins) + .withMemoryLimit(true) + .withSwapLimit(true) + .withCpuCfsPeriod(true) + .withCpuCfsQuota(true) + .withCpuShares(true) + .withCpuSet(true) + .withIPv4Forwarding(true) + .withBridgeNfIptables(true) + .withBridgeNfIp6tables(true) + .withDebug(true) + .withNFd(24) + .withOomKillDisable(true) + .withNGoroutines(40) + .withSystemTime("2016-02-17T14:56:35.212841831Z") + .withExecutionDriver("native-0.2") + .withLoggingDriver("json-file") + .withNEventsListener(0) + .withKernelVersion("4.1.17-boot2docker") + .withOperatingSystem("Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016") + .withOsType("linux") + .withIndexServerAddress("https://index.docker.io/v1/") + .withRegistryConfig(registryConfig) + .withInitSha1("") + .withInitPath("/usr/local/bin/docker") + .withNCPU(1) + .withMemTotal(1044574208L) + .withDockerRootDir("/mnt/sda1/var/lib/docker") + .withHttpProxy("") + .withHttpsProxy("") + .withNoProxy("") + .withName("docker-java") + .withLabels(new String[]{"provider=virtualbox"}) + .withExperimentalBuild(false) + .withServerVersion("1.10.1") + .withClusterStore("") + .withClusterAdvertise("") + //shredinger-fields + .withDiscoveryBackend(null) + .withOomScoreAdj(null) + .withSockets(null); assertThat(info, is(withInfo)); } @@ -177,30 +176,30 @@ public void serder2Json() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Info.class); final Info info = testRoundTrip(VERSION_1_22, - "info/2.json", - type + "info/2.json", + type ); final List> driverStatus = asList( - asList("Pool Name", "docker-253:2-17567992-pool"), - asList("Pool Blocksize", "65.54 kB"), - asList("Base Device Size", "107.4 GB"), - asList("Backing Filesystem", "ext4"), - asList("Data file", "/dev/loop0"), - asList("Metadata file", "/dev/loop1"), - asList("Data Space Used", "3.89 GB"), - asList("Data Space Total", "107.4 GB"), - asList("Data Space Available", "103.5 GB"), - asList("Metadata Space Used", "5.46 MB"), - asList("Metadata Space Total", "2.147 GB"), - asList("Metadata Space Available", "2.142 GB"), - asList("Udev Sync Supported", "true"), - asList("Deferred Removal Enabled", "false"), - asList("Deferred Deletion Enabled", "false"), - asList("Deferred Deleted Device Count", "0"), - asList("Data loop file", "/var/lib/docker/devicemapper/devicemapper/data"), - asList("Metadata loop file", "/var/lib/docker/devicemapper/devicemapper/metadata"), - asList("Library Version", "1.02.107-RHEL7 (2015-12-01)") + asList("Pool Name", "docker-253:2-17567992-pool"), + asList("Pool Blocksize", "65.54 kB"), + asList("Base Device Size", "107.4 GB"), + asList("Backing Filesystem", "ext4"), + asList("Data file", "/dev/loop0"), + asList("Metadata file", "/dev/loop1"), + asList("Data Space Used", "3.89 GB"), + asList("Data Space Total", "107.4 GB"), + asList("Data Space Available", "103.5 GB"), + asList("Metadata Space Used", "5.46 MB"), + asList("Metadata Space Total", "2.147 GB"), + asList("Metadata Space Available", "2.142 GB"), + asList("Udev Sync Supported", "true"), + asList("Deferred Removal Enabled", "false"), + asList("Deferred Deletion Enabled", "false"), + asList("Deferred Deleted Device Count", "0"), + asList("Data loop file", "/var/lib/docker/devicemapper/devicemapper/data"), + asList("Metadata loop file", "/var/lib/docker/devicemapper/devicemapper/metadata"), + asList("Library Version", "1.02.107-RHEL7 (2015-12-01)") ); final Map> plugins = new LinkedHashMap<>(); @@ -249,10 +248,10 @@ public void serder2Json() throws IOException { final Map indexConfigs = registryConfig.getIndexConfigs(); assertThat(indexConfigs, notNullValue()); final IndexConfig indexConfig = new IndexConfig().withMirrors(null).withName("docker.io") - .withSecure(true).withOfficial(true); + .withSecure(true).withOfficial(true); assertThat(indexConfigs, hasEntry("docker.io", indexConfig)); final IndexConfig indexConfig2 = new IndexConfig().withMirrors(Collections.emptyList()).withName("somehost:80") - .withSecure(false).withOfficial(false); + .withSecure(false).withOfficial(false); assertThat(indexConfigs, hasEntry("somehost:80", indexConfig2)); assertThat(registryConfig.getMirrors(), nullValue()); @@ -273,57 +272,56 @@ public void serder2Json() throws IOException { final Info withInfo = new Info().withArchitecture("x86_64") - .withContainers(2) - .withContainersRunning(0) - .withContainersPaused(0) - .withContainersStopped(2) - .withImages(55) - .withId("H52J:52LG:YP4W:EHKY:SRK5:RYG6:ETWR:7AR3:MTFJ:PC6C:4YF2:NTN2") - .withDriver("devicemapper") - .withDriverStatuses(driverStatus) - .withSystemStatus(null) - .withPlugins(plugins) - .withMemoryLimit(true) - .withSwapLimit(true) - .withCpuCfsPeriod(true) - .withCpuCfsQuota(true) - .withCpuShares(true) - .withCpuSet(true) - .withIPv4Forwarding(true) - .withBridgeNfIptables(false) - .withBridgeNfIp6tables(false) - .withDebug(false) - .withNFd(13) - .withOomKillDisable(true) - .withNGoroutines(30) - .withSystemTime("2016-03-20T17:32:06.598846244+01:00") - .withExecutionDriver("native-0.2") - .withLoggingDriver("json-file") - .withNEventsListener(0) - .withKernelVersion("3.10.0-327.10.1.el7.x86_64") - .withOperatingSystem("Red Hat Enterprise Linux Workstation 7.2 (Maipo)") - .withOsType("linux") - .withIndexServerAddress("https://index.docker.io/v1/") - .withRegistryConfig(registryConfig) - .withInitSha1("672d65f3cf8816fbda421afeed7e52c0ca17d5e7") - .withInitPath("/usr/libexec/docker/dockerinit") - .withNCPU(8) - .withMemTotal(33350918144L) - .withDockerRootDir("/var/lib/docker") - .withHttpProxy("") - .withHttpsProxy("") - .withNoProxy("") - .withName("somename") - .withLabels(null) - .withExperimentalBuild(false) - .withServerVersion("1.10.2") - .withClusterStore("") - .withClusterAdvertise("") - //shredinger-fields - .withDiscoveryBackend(null) - .withOomScoreAdj(null) - .withSockets(null) - ; + .withContainers(2) + .withContainersRunning(0) + .withContainersPaused(0) + .withContainersStopped(2) + .withImages(55) + .withId("H52J:52LG:YP4W:EHKY:SRK5:RYG6:ETWR:7AR3:MTFJ:PC6C:4YF2:NTN2") + .withDriver("devicemapper") + .withDriverStatuses(driverStatus) + .withSystemStatus(null) + .withPlugins(plugins) + .withMemoryLimit(true) + .withSwapLimit(true) + .withCpuCfsPeriod(true) + .withCpuCfsQuota(true) + .withCpuShares(true) + .withCpuSet(true) + .withIPv4Forwarding(true) + .withBridgeNfIptables(false) + .withBridgeNfIp6tables(false) + .withDebug(false) + .withNFd(13) + .withOomKillDisable(true) + .withNGoroutines(30) + .withSystemTime("2016-03-20T17:32:06.598846244+01:00") + .withExecutionDriver("native-0.2") + .withLoggingDriver("json-file") + .withNEventsListener(0) + .withKernelVersion("3.10.0-327.10.1.el7.x86_64") + .withOperatingSystem("Red Hat Enterprise Linux Workstation 7.2 (Maipo)") + .withOsType("linux") + .withIndexServerAddress("https://index.docker.io/v1/") + .withRegistryConfig(registryConfig) + .withInitSha1("672d65f3cf8816fbda421afeed7e52c0ca17d5e7") + .withInitPath("/usr/libexec/docker/dockerinit") + .withNCPU(8) + .withMemTotal(33350918144L) + .withDockerRootDir("/var/lib/docker") + .withHttpProxy("") + .withHttpsProxy("") + .withNoProxy("") + .withName("somename") + .withLabels(null) + .withExperimentalBuild(false) + .withServerVersion("1.10.2") + .withClusterStore("") + .withClusterAdvertise("") + //shredinger-fields + .withDiscoveryBackend(null) + .withOomScoreAdj(null) + .withSockets(null); assertThat(info, is(withInfo)); } @@ -333,8 +331,8 @@ public void info_1_38() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Info.class); final Info info = testRoundTrip(RemoteApiVersion.VERSION_1_38, - "info/lcow.json", - type + "info/lcow.json", + type ); assertThat(info, notNullValue()); @@ -343,8 +341,8 @@ public void info_1_38() throws IOException { assertThat(info.getDriver(), is("windowsfilter (windows) lcow (linux)")); assertThat(info.getDriverStatuses(), equalTo(Arrays.asList( - Arrays.asList("Windows", ""), - Arrays.asList("LCOW", "") + Arrays.asList("Windows", ""), + Arrays.asList("LCOW", "") ))); assertThat(info.getIsolation(), is("hyperv")); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/LinksTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/LinksTest.java index 0cf496412..2ebe4583d 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/LinksTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/LinksTest.java @@ -3,18 +3,18 @@ import com.github.dockerjava.test.serdes.JSONTestHelper; import org.junit.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; public class LinksTest { @Test public void usesToJson() throws Exception { Links links = new Links( - new Link("/foo", "/bar"), - new Link("bip", "bop") + new Link("/foo", "/bar"), + new Link("bip", "bop") ); String json = JSONTestHelper.getMapper().writeValueAsString(links); @@ -27,8 +27,8 @@ public void usesFromJson() throws Exception { assertThat(links, notNullValue()); assertThat(links.getLinks(), arrayContaining( - new Link("foo", "bar"), - new Link("bip", "bop") + new Link("foo", "bar"), + new Link("bip", "bop") )); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/PortBindingTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/PortBindingTest.java index 9190cfda4..8b3840147 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/PortBindingTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/PortBindingTest.java @@ -18,7 +18,7 @@ public class PortBindingTest { @Test public void fullDefinition() { assertEquals(PortBinding.parse("127.0.0.1:80:8080/tcp"), - new PortBinding(Binding.bindIpAndPort("127.0.0.1", 80), TCP_8080)); + new PortBinding(Binding.bindIpAndPort("127.0.0.1", 80), TCP_8080)); } @Test diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/PortsAddBindingsTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/PortsAddBindingsTest.java index 484e5897f..a3ff3f744 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/PortsAddBindingsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/PortsAddBindingsTest.java @@ -37,8 +37,8 @@ public void addTwoBindingsForDifferentExposedPorts() { Map bindings = ports.getBindings(); // two keys with one value each assertEquals(2, bindings.size()); - assertArrayEquals(new Binding[] {BINDING_8080}, bindings.get(TCP_80)); - assertArrayEquals(new Binding[] {BINDING_9090}, bindings.get(TCP_90)); + assertArrayEquals(new Binding[]{BINDING_8080}, bindings.get(TCP_80)); + assertArrayEquals(new Binding[]{BINDING_9090}, bindings.get(TCP_90)); } @Test @@ -48,7 +48,7 @@ public void addTwoBindingsForSameExposedPort() { Map bindings = ports.getBindings(); // one key with two values assertEquals(1, bindings.size()); - assertArrayEquals(new Binding[] {BINDING_8080, BINDING_9090}, bindings.get(TCP_80)); + assertArrayEquals(new Binding[]{BINDING_8080, BINDING_9090}, bindings.get(TCP_80)); } @Test diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseItemTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseItemTest.java index f73036864..913c1ee8e 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseItemTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseItemTest.java @@ -32,7 +32,7 @@ public class PullResponseItemTest { @Test public void imageAlreadyExists() throws IOException { PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_alreadyExists, - PullResponseItem.class); + PullResponseItem.class); assertTrue(response.isPullSuccessIndicated()); assertFalse(response.isErrorIndicated()); } @@ -40,7 +40,7 @@ public void imageAlreadyExists() throws IOException { @Test public void pullNewerImage() throws IOException { PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_newerImage, - PullResponseItem.class); + PullResponseItem.class); assertTrue(response.isPullSuccessIndicated()); assertFalse(response.isErrorIndicated()); } @@ -48,7 +48,7 @@ public void pullNewerImage() throws IOException { @Test public void pullUpToDate() throws IOException { PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_upToDate, - PullResponseItem.class); + PullResponseItem.class); assertTrue(response.isPullSuccessIndicated()); assertFalse(response.isErrorIndicated()); } @@ -56,7 +56,7 @@ public void pullUpToDate() throws IOException { @Test public void pullLegacyRegistry() throws IOException { PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_legacy, - PullResponseItem.class); + PullResponseItem.class); assertTrue(response.isPullSuccessIndicated()); assertFalse(response.isErrorIndicated()); } @@ -64,7 +64,7 @@ public void pullLegacyRegistry() throws IOException { @Test public void pullAndEncounterError() throws IOException { PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_error, - PullResponseItem.class); + PullResponseItem.class); assertFalse(response.isPullSuccessIndicated()); assertTrue(response.isErrorIndicated()); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseJSONSamples.java b/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseJSONSamples.java index 4997a390a..d5e3ccf20 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseJSONSamples.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/PullResponseJSONSamples.java @@ -23,7 +23,7 @@ * @author Zach Marshall */ public enum PullResponseJSONSamples implements JSONResourceRef { - pullImageResponse_legacy, pullImageResponse_error, + pullImageResponse_legacy, pullImageResponse_error, pullImageResponse_newerImage, pullImageResponse_upToDate, pullImageResponse_alreadyExists; diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/RestartPolicyToStringTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/RestartPolicyToStringTest.java index e32f97341..f0632e491 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/RestartPolicyToStringTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/RestartPolicyToStringTest.java @@ -11,7 +11,7 @@ public class RestartPolicyToStringTest { @Parameterized.Parameters(name = "{0}") public static Object[][] restartPolicies() { - return new Object[][] { {"no"}, {"always"}, {"unless-stopped"}, {"on-failure"}, {"on-failure:2"}}; + return new Object[][]{{"no"}, {"always"}, {"unless-stopped"}, {"on-failure"}, {"on-failure:2"}}; } @Parameterized.Parameter diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/StatisticsTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/StatisticsTest.java index 9734c5e14..79767b31a 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/StatisticsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/StatisticsTest.java @@ -10,10 +10,10 @@ import java.util.Arrays; import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; +import static org.hamcrest.core.IsEqual.equalTo; /** * @author Yuting Liu @@ -25,8 +25,8 @@ public void serderJson1() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Statistics.class); final Statistics statistics = testRoundTrip(RemoteApiVersion.VERSION_1_27, - "containers/container/stats/stats1.json", - type + "containers/container/stats/stats1.json", + type ); assertThat(statistics.getRead(), equalTo("2017-12-06T00:42:03.8352972Z")); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/UlimitsTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/UlimitsTest.java index 12d1a0d36..c58ffe3bb 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/UlimitsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/UlimitsTest.java @@ -3,19 +3,19 @@ import com.github.dockerjava.test.serdes.JSONTestHelper; import org.junit.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; public class UlimitsTest { @Test public void usesToJson() throws Exception { Ulimit[] ulimits = new Ulimit[]{ - new Ulimit("nproc", 709, 1026), - new Ulimit("nofile", 1024, 4096), - new Ulimit("core", 99999999998L, 99999999999L) + new Ulimit("nproc", 709, 1026), + new Ulimit("nofile", 1024, 4096), + new Ulimit("core", 99999999998L, 99999999999L) }; String json = JSONTestHelper.getMapper().writeValueAsString(ulimits); @@ -28,9 +28,9 @@ public void usesFromJson() throws Exception { assertThat(ulimits, notNullValue()); assertThat(ulimits, arrayContaining( - new Ulimit("nproc", 709, 1026), - new Ulimit("nofile", 1024, 4096), - new Ulimit("core", 99999999998L, 99999999999L) + new Ulimit("nproc", 709, 1026), + new Ulimit("nofile", 1024, 4096), + new Ulimit("core", 99999999998L, 99999999999L) )); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/VersionTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/VersionTest.java index 77fafac37..3088c5932 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/VersionTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/VersionTest.java @@ -26,8 +26,8 @@ public void testSerDer1() throws Exception { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Version.class); final Version version = testRoundTrip(RemoteApiVersion.VERSION_1_22, - "/version/1.json", - type + "/version/1.json", + type ); assertThat(version, notNullValue()); @@ -47,8 +47,8 @@ public void version_1_38() throws Exception { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(Version.class); final Version version = testRoundTrip(RemoteApiVersion.VERSION_1_38, - "/version/lcow.json", - type + "/version/lcow.json", + type ); assertThat(version, notNullValue()); @@ -68,9 +68,9 @@ public void version_1_38() throws Exception { details.put("Os", "windows"); List components = Collections.singletonList(new VersionComponent() - .withDetails(details) - .withName("Engine") - .withVersion("18.06.1-ce") + .withDetails(details) + .withName("Engine") + .withVersion("18.06.1-ce") ); assertThat(version.getComponents(), equalTo(components)); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/VolumeBindsTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/VolumeBindsTest.java index 7f38eb0f0..d75f49763 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/VolumeBindsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/VolumeBindsTest.java @@ -6,17 +6,17 @@ import java.io.IOException; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; -import static org.hamcrest.MatcherAssert.assertThat; public class VolumeBindsTest { @Test public void usesToJson() throws Exception { VolumeBinds binds = new VolumeBinds( - new VolumeBind("/bar", "/foo"), - new VolumeBind("/bop", "/bip") + new VolumeBind("/bar", "/foo"), + new VolumeBind("/bop", "/bip") ); String json = JSONTestHelper.getMapper().writeValueAsString(binds); diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesRWTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesRWTest.java index ed52ff82d..b8e23be26 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesRWTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesRWTest.java @@ -3,18 +3,18 @@ import com.github.dockerjava.test.serdes.JSONTestHelper; import org.junit.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; public class VolumesRWTest { @Test public void usesToJson() throws Exception { VolumesRW volumes = new VolumesRW( - new VolumeRW(new Volume("/foo")), - new VolumeRW(new Volume("/bar"), AccessMode.ro) + new VolumeRW(new Volume("/foo")), + new VolumeRW(new Volume("/bar"), AccessMode.ro) ); String json = JSONTestHelper.getMapper().writeValueAsString(volumes); @@ -27,8 +27,8 @@ public void usesFromJson() throws Exception { assertThat(volumes, notNullValue()); assertThat(volumes.getVolumesRW(), arrayContaining( - new VolumeRW(new Volume("/foo")), - new VolumeRW(new Volume("/bar"), AccessMode.ro) + new VolumeRW(new Volume("/foo")), + new VolumeRW(new Volume("/bar"), AccessMode.ro) )); } diff --git a/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesTest.java b/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesTest.java index d39e02583..1a35245a1 100644 --- a/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/api/model/VolumesTest.java @@ -3,18 +3,18 @@ import com.github.dockerjava.test.serdes.JSONTestHelper; import org.junit.Test; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.hamcrest.MatcherAssert.assertThat; public class VolumesTest { @Test public void usesToJson() throws Exception { Volumes volumes = new Volumes( - new Volume("/foo"), - new Volume("/bar") + new Volume("/foo"), + new Volume("/bar") ); String json = JSONTestHelper.getMapper().writeValueAsString(volumes); @@ -27,8 +27,8 @@ public void usesFromJson() throws Exception { assertThat(volumes, notNullValue()); assertThat(volumes.getVolumes(), arrayContaining( - new Volume("/foo"), - new Volume("/bar") + new Volume("/foo"), + new Volume("/bar") )); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/AttachContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/AttachContainerCmdIT.java index dde47e2d8..4683f508d 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/AttachContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/AttachContainerCmdIT.java @@ -25,7 +25,8 @@ import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @author Kanstantsin Shautsou diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/BuildImageCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/BuildImageCmdIT.java index d514ed59c..2dd603381 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/BuildImageCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/BuildImageCmdIT.java @@ -38,9 +38,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.nullValue; import static org.junit.Assume.assumeThat; @@ -93,10 +93,10 @@ public void onBuild() throws Exception { File baseDir = fileFromBuildTestResource("ONBUILD/parent"); dockerRule.getClient().buildImageCmd(baseDir) - .withNoCache(true) - .withTag("docker-java-onbuild") - .start() - .awaitImageId(); + .withNoCache(true) + .withTag("docker-java-onbuild") + .start() + .awaitImageId(); baseDir = fileFromBuildTestResource("ONBUILD/child"); String response = dockerfileBuild(baseDir); @@ -210,18 +210,18 @@ public void fromPrivateRegistry() throws Exception { dockerRule.getClient().authCmd().withAuthConfig(authConfig).exec(); dockerRule.getClient().tagImageCmd("busybox:latest", imgName, "latest") - .withForce() - .exec(); + .withForce() + .exec(); dockerRule.getClient().pushImageCmd(imgName) - .withTag("latest") - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withTag("latest") + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); dockerRule.getClient().removeImageCmd(imgName) - .withForce(true) - .exec(); + .withForce(true) + .exec(); // baseDir = fileFromBuildTestResource("FROM/privateRegistry"); baseDir = folder.getRoot(); @@ -230,10 +230,10 @@ public void fromPrivateRegistry() throws Exception { authConfigurations.addConfig(authConfig); String imageId = dockerRule.getClient().buildImageCmd(baseDir) - .withNoCache(true) - .withBuildAuthConfigs(authConfigurations) - .start() - .awaitImageId(); + .withNoCache(true) + .withBuildAuthConfigs(authConfigurations) + .start() + .awaitImageId(); inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); assertThat(inspectImageResponse, not(nullValue())); @@ -245,8 +245,8 @@ public void buildArgs() { File baseDir = fileFromBuildTestResource("buildArgs"); String imageId = dockerRule.getClient().buildImageCmd(baseDir).withNoCache(true).withBuildArg("testArg", "abc !@#$%^&*()_+") - .start() - .awaitImageId(); + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); assertThat(inspectImageResponse, not(nullValue())); @@ -262,9 +262,9 @@ public void labels() { File baseDir = fileFromBuildTestResource("labels"); String imageId = dockerRule.getClient().buildImageCmd(baseDir).withNoCache(true) - .withLabels(Collections.singletonMap("test", "abc")) - .start() - .awaitImageId(); + .withLabels(Collections.singletonMap("test", "abc")) + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); assertThat(inspectImageResponse, not(nullValue())); @@ -281,10 +281,10 @@ public void multipleTags() { File baseDir = fileFromBuildTestResource("labels"); String imageId = dockerRule.getClient().buildImageCmd(baseDir).withNoCache(true) - .withTag("fallback-when-withTags-not-called") - .withTags(new HashSet<>(Arrays.asList("docker-java-test:tag1", "docker-java-test:tag2"))) - .start() - .awaitImageId(); + .withTag("fallback-when-withTags-not-called") + .withTags(new HashSet<>(Arrays.asList("docker-java-test:tag1", "docker-java-test:tag2"))) + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); assertThat(inspectImageResponse, not(nullValue())); @@ -300,15 +300,15 @@ public void cacheFrom() { File baseDir1 = fileFromBuildTestResource("CacheFrom/test1"); String imageId1 = dockerRule.getClient().buildImageCmd(baseDir1) - .start() - .awaitImageId(); + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse1 = dockerRule.getClient().inspectImageCmd(imageId1).exec(); assertThat(inspectImageResponse1, not(nullValue())); File baseDir2 = fileFromBuildTestResource("CacheFrom/test2"); String imageId2 = dockerRule.getClient().buildImageCmd(baseDir2).withCacheFrom(new HashSet<>(Arrays.asList(imageId1))) - .start() - .awaitImageId(); + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse2 = dockerRule.getClient().inspectImageCmd(imageId2).exec(); assertThat(inspectImageResponse2, not(nullValue())); @@ -322,10 +322,10 @@ public void quiet() { File baseDir = fileFromBuildTestResource("labels"); String imageId = dockerRule.getClient() - .buildImageCmd(baseDir) - .withQuiet(true) - .start() - .awaitImageId(); + .buildImageCmd(baseDir) + .withQuiet(true) + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); assertThat(inspectImageResponse, not(nullValue())); @@ -340,10 +340,10 @@ public void extraHosts() { File baseDir = fileFromBuildTestResource("labels"); String imageId = dockerRule.getClient() - .buildImageCmd(baseDir) - .withExtraHosts(new HashSet<>(Arrays.asList("host1"))) - .start() - .awaitImageId(); + .buildImageCmd(baseDir) + .withExtraHosts(new HashSet<>(Arrays.asList("host1"))) + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); assertThat(inspectImageResponse, not(nullValue())); @@ -354,8 +354,8 @@ public void dockerfileNotInBaseDirectory() throws Exception { File baseDirectory = fileFromBuildTestResource("dockerfileNotInBaseDirectory"); File dockerfile = fileFromBuildTestResource("dockerfileNotInBaseDirectory/dockerfileFolder/Dockerfile"); BuildImageCmd command = dockerRule.getClient().buildImageCmd() - .withBaseDirectory(baseDirectory) - .withDockerfile(dockerfile); + .withBaseDirectory(baseDirectory) + .withDockerfile(dockerfile); String response = execBuild(command); @@ -364,6 +364,6 @@ public void dockerfileNotInBaseDirectory() throws Exception { private File fileFromBuildTestResource(String resource) { return new File(Thread.currentThread().getContextClassLoader() - .getResource("buildTests/" + resource).getFile()); + .getResource("buildTests/" + resource).getFile()); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CommitCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CommitCmdIT.java index 39f51adc7..7d78c29a3 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CommitCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CommitCmdIT.java @@ -13,10 +13,10 @@ import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.startsWith; import static org.testinfected.hamcrest.jpa.HasFieldWithValue.hasField; @@ -28,8 +28,8 @@ public class CommitCmdIT extends CmdIT { @Test public void commit() throws DockerException, InterruptedException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("touch", "/test") - .exec(); + .withCmd("touch", "/test") + .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -58,24 +58,24 @@ public void commit() throws DockerException, InterruptedException { public void commitWithLabels() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("touch", "/test") - .exec(); + .withCmd("touch", "/test") + .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); Integer status = dockerRule.getClient().waitContainerCmd(container.getId()) - .start() - .awaitStatusCode(); + .start() + .awaitStatusCode(); assertThat(status, is(0)); LOG.info("Committing container: {}", container.toString()); Map labels = ImmutableMap.of("label1", "abc", "label2", "123"); String imageId = dockerRule.getClient().commitCmd(container.getId()) - .withLabels(labels) - .exec(); + .withLabels(labels) + .exec(); InspectImageResponse inspectImageResponse = dockerRule.getClient().inspectImageCmd(imageId).exec(); LOG.info("Image Inspect: {}", inspectImageResponse.toString()); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ConnectToNetworkCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ConnectToNetworkCmdIT.java index 40b552611..d2e13d80f 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ConnectToNetworkCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ConnectToNetworkCmdIT.java @@ -9,8 +9,8 @@ import net.jcip.annotations.ThreadSafe; import org.junit.Test; -import static com.github.dockerjava.junit.DockerAssume.assumeNotSwarm; import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; +import static com.github.dockerjava.junit.DockerAssume.assumeNotSwarm; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.core.Is.is; diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ContainerDiffCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ContainerDiffCmdIT.java index 7ff39f3fa..2e9382e72 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ContainerDiffCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ContainerDiffCmdIT.java @@ -14,8 +14,8 @@ import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.emptyString; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; import static org.testinfected.hamcrest.jpa.HasFieldWithValue.hasField; @@ -30,7 +30,7 @@ public void testContainerDiff() throws DockerException { dockerRule.getClient().startContainerCmd(container.getId()).exec(); int exitCode = dockerRule.getClient().waitContainerCmd(container.getId()).start() - .awaitStatusCode(); + .awaitStatusCode(); assertThat(exitCode, equalTo(0)); List filesystemDiff = dockerRule.getClient().containerDiffCmd(container.getId()).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveFromContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveFromContainerCmdIT.java index e0c2ca03e..a410c84b3 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveFromContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveFromContainerCmdIT.java @@ -33,9 +33,9 @@ public class CopyArchiveFromContainerCmdIT extends CmdIT { public void copyFromContainer() { // TODO extract this into a shared method CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName("copyFromContainer") - .withCmd("touch", "/copyFromContainer") - .exec(); + .withName("copyFromContainer") + .withCmd("touch", "/copyFromContainer") + .exec(); LOG.info("Created container: {}", container); assertThat(container.getId(), not(isEmptyOrNullString())); @@ -59,8 +59,8 @@ public void copyFromNonExistingContainer() { @Test public void copyFromContainerBinaryFile() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName("copyFromContainerBinaryFile") - .exec(); + .withName("copyFromContainerBinaryFile") + .exec(); LOG.info("Created container: {}", container); assertThat(container.getId(), not(isEmptyOrNullString())); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveToContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveToContainerCmdIT.java index efce65c29..9df79c90e 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveToContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CopyArchiveToContainerCmdIT.java @@ -37,9 +37,9 @@ public void copyFileToContainer() throws Exception { CompressArchiveUtil.tar(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()), temp, true, false); try (InputStream uploadStream = Files.newInputStream(temp)) { dockerRule.getClient() - .copyArchiveToContainerCmd(container.getId()) - .withTarInputStream(uploadStream) - .exec(); + .copyArchiveToContainerCmd(container.getId()) + .withTarInputStream(uploadStream) + .exec(); assertFileCopied(container); } } @@ -48,8 +48,8 @@ public void copyFileToContainer() throws Exception { public void copyStreamToContainer() throws Exception { CreateContainerResponse container = prepareContainerForCopy("2"); dockerRule.getClient().copyArchiveToContainerCmd(container.getId()) - .withHostResource(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()).toString()) - .exec(); + .withHostResource(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()).toString()) + .exec(); assertFileCopied(container); } @@ -57,7 +57,7 @@ public void copyStreamToContainer() throws Exception { public void copyStreamToContainerTwice() throws Exception { CreateContainerResponse container = prepareContainerForCopy("rerun"); CopyArchiveToContainerCmd copyArchiveToContainerCmd = dockerRule.getClient().copyArchiveToContainerCmd(container.getId()) - .withHostResource(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()).toString()); + .withHostResource(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()).toString()); copyArchiveToContainerCmd.exec(); assertFileCopied(container); //run again to make sure no DockerClientException @@ -66,8 +66,8 @@ public void copyStreamToContainerTwice() throws Exception { private CreateContainerResponse prepareContainerForCopy(String method) { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withName("docker-java-itest-copyToContainer" + method) - .exec(); + .withName("docker-java-itest-copyToContainer" + method) + .exec(); LOG.info("Created container: {}", container); assertThat(container.getId(), not(isEmptyOrNullString())); dockerRule.getClient().startContainerCmd(container.getId()).exec(); @@ -78,18 +78,18 @@ private CreateContainerResponse prepareContainerForCopy(String method) { private void assertFileCopied(CreateContainerResponse container) throws IOException { try (InputStream response = dockerRule.getClient().copyArchiveFromContainerCmd(container.getId(), "testReadFile").exec()) { boolean bytesAvailable = response.read() != -1; - assertTrue( "The file was not copied to the container.", bytesAvailable); + assertTrue("The file was not copied to the container.", bytesAvailable); } } @Test(expected = NotFoundException.class) public void copyToNonExistingContainer() throws Exception { dockerRule.getClient().copyArchiveToContainerCmd("non-existing") - .withHostResource(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()).toString()).exec(); + .withHostResource(Paths.get(ClassLoader.getSystemResource("testReadFile").toURI()).toString()).exec(); } @Test - public void copyDirWithLastAddedTarEntryEmptyDir() throws Exception{ + public void copyDirWithLastAddedTarEntryEmptyDir() throws Exception { // create a temp dir Path localDir = Files.createTempDirectory(null); localDir.toFile().deleteOnExit(); @@ -102,14 +102,14 @@ public void copyDirWithLastAddedTarEntryEmptyDir() throws Exception{ // create a test container CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("sleep", "9999") - .exec(); + .withCmd("sleep", "9999") + .exec(); // start the container dockerRule.getClient().startContainerCmd(container.getId()).exec(); // copy data from local dir to container dockerRule.getClient().copyArchiveToContainerCmd(container.getId()) - .withHostResource(localDir.toString()) - .exec(); + .withHostResource(localDir.toString()) + .exec(); // cleanup dir FileUtils.deleteDirectory(localDir.toFile()); @@ -120,7 +120,7 @@ public void copyFileWithExecutePermission() throws Exception { // create script file, add permission to execute Path scriptPath = Files.createTempFile("run", ".sh"); boolean executable = scriptPath.toFile().setExecutable(true, false); - if (!executable){ + if (!executable) { throw new Exception("Execute permission on file not set!"); } String snippet = "Running script with execute permission."; @@ -131,20 +131,20 @@ public void copyFileWithExecutePermission() throws Exception { // script to be copied to the container's home dir and then executes it String containerCmd = "sleep 3; /home/" + scriptPath.getFileName().toString(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withName("copyFileWithExecutivePerm") - .withCmd("/bin/sh", "-c", containerCmd) - .exec(); + .withName("copyFileWithExecutivePerm") + .withCmd("/bin/sh", "-c", containerCmd) + .exec(); // start the container dockerRule.getClient().startContainerCmd(container.getId()).exec(); // copy script to container home dir dockerRule.getClient().copyArchiveToContainerCmd(container.getId()) - .withRemotePath("/home") - .withHostResource(scriptPath.toString()) - .exec(); + .withRemotePath("/home") + .withHostResource(scriptPath.toString()) + .exec(); // await exid code int exitCode = dockerRule.getClient().waitContainerCmd(container.getId()) - .start() - .awaitStatusCode(); + .start() + .awaitStatusCode(); // check result assertThat(exitCode, equalTo(0)); } @@ -161,28 +161,28 @@ public void copyFileWithUIDGID() throws Exception { String containerCmd = "while [ ! -f /home/uidgid.with ]; do true; done && stat -c %n:%u /home/uidgid.with /home/uidgid.without"; Long syncUserUid = 4L; // sync user in busybox uses uid=4 CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withName("copyFileWithUIDGID") - .withCmd("/bin/sh", "-c", containerCmd) - .withUser(syncUserUid.toString()) - .exec(); + .withName("copyFileWithUIDGID") + .withCmd("/bin/sh", "-c", containerCmd) + .withUser(syncUserUid.toString()) + .exec(); // start the container dockerRule.getClient().startContainerCmd(container.getId()).exec(); dockerRule.getClient().copyArchiveToContainerCmd(container.getId()) - .withRemotePath("/home/") - .withHostResource(without.toString()) - .withCopyUIDGID(false) - .exec(); + .withRemotePath("/home/") + .withHostResource(without.toString()) + .withCopyUIDGID(false) + .exec(); dockerRule.getClient().copyArchiveToContainerCmd(container.getId()) - .withRemotePath("/home/") - .withHostResource(with.toString()) - .withCopyUIDGID(true) - .exec(); + .withRemotePath("/home/") + .withHostResource(with.toString()) + .withCopyUIDGID(true) + .exec(); // await exit code int exitCode = dockerRule.getClient().waitContainerCmd(container.getId()) - .start() - .awaitStatusCode(); + .start() + .awaitStatusCode(); // check result assertThat(exitCode, equalTo(0)); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CopyFileFromContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CopyFileFromContainerCmdIT.java index 3864aa9e4..782da2582 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CopyFileFromContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CopyFileFromContainerCmdIT.java @@ -33,9 +33,9 @@ public void copyFromContainer() { // TODO extract this into a shared method CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withName(containerName) - .withCmd("touch", "/copyFileFromContainer") - .exec(); + .withName(containerName) + .withCmd("touch", "/copyFileFromContainer") + .exec(); LOG.info("Created container: {}", container); assertThat(container.getId(), not(isEmptyOrNullString())); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CreateContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CreateContainerCmdIT.java index de9f564e4..fc907364f 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CreateContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CreateContainerCmdIT.java @@ -54,23 +54,23 @@ import static com.github.dockerjava.api.model.Capability.MKNOD; import static com.github.dockerjava.api.model.Capability.NET_ADMIN; import static com.github.dockerjava.api.model.HostConfig.newHostConfig; +import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; import static com.github.dockerjava.core.RemoteApiVersion.VERSION_1_23; import static com.github.dockerjava.core.RemoteApiVersion.VERSION_1_24; import static com.github.dockerjava.junit.DockerMatchers.isGreaterOrEqual; import static com.github.dockerjava.junit.DockerMatchers.mountedVolumes; -import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItemInArray; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @@ -98,7 +98,7 @@ public void createContainerWithExistingName() throws DockerException { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("env") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); @@ -113,8 +113,8 @@ public void createContainerWithVolume() throws DockerException { Volume volume = new Volume("/var/log"); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withVolumes(volume) - .withCmd("true").exec(); + .withVolumes(volume) + .withCmd("true").exec(); LOG.info("Created container {}", container.toString()); @@ -137,7 +137,7 @@ public void createContainerWithReadOnlyVolume() throws DockerException { Volume volume = new Volume("/srv/test"); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withVolumes(volume) - .withCmd("true").exec(); + .withCmd("true").exec(); LOG.info("Created container {}", container.toString()); @@ -167,16 +167,16 @@ public void createContainerWithVolumesFrom() throws DockerException { // create a running container with bind mounts CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sleep", "9999") - .withName(container1Name) - .withHostConfig(newHostConfig() - .withBinds(bind1, bind2)) - .exec(); + .withCmd("sleep", "9999") + .withName(container1Name) + .withHostConfig(newHostConfig() + .withBinds(bind1, bind2)) + .exec(); LOG.info("Created container1 {}", container1.toString()); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); assertThat(Arrays.asList(inspectContainerResponse1.getHostConfig().getBinds()), containsInAnyOrder(bind1, bind2)); @@ -184,19 +184,19 @@ public void createContainerWithVolumesFrom() throws DockerException { // create a second container with volumes from first container CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withVolumesFrom(new VolumesFrom(container1Name))) - .exec(); + .withCmd("sleep", "9999") + .withHostConfig(newHostConfig() + .withVolumesFrom(new VolumesFrom(container1Name))) + .exec(); LOG.info("Created container2 {}", container2.toString()); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); // No volumes are created, the information is just stored in .HostConfig.VolumesFrom assertThat(inspectContainerResponse2.getHostConfig().getVolumesFrom(), - hasItemInArray(new VolumesFrom(container1Name))); + hasItemInArray(new VolumesFrom(container1Name))); assertThat(inspectContainerResponse1, mountedVolumes(containsInAnyOrder(volume1, volume2))); // To ensure that the information stored in VolumesFrom really is considered @@ -210,7 +210,7 @@ public void createContainerWithVolumesFrom() throws DockerException { inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()).exec(); assertThat(inspectContainerResponse2.getHostConfig().getVolumesFrom(), hasItemInArray(new VolumesFrom( - container1Name))); + container1Name))); assertThat(inspectContainerResponse2, mountedVolumes(containsInAnyOrder(volume1, volume2))); } @@ -220,9 +220,9 @@ public void createContainerWithEnv() throws Exception { final String testVariable = "VARIABLE=success"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withEnv(testVariable) - .withCmd("env") - .exec(); + .withEnv(testVariable) + .withCmd("env") + .exec(); LOG.info("Created container {}", container.toString()); @@ -244,10 +244,10 @@ public void createContainerWithEnvAdditive() throws Exception { final String testVariable2 = "VARIABLE2=success2"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withEnv(testVariable1) - .withEnv(testVariable2) - .withCmd("env") - .exec(); + .withEnv(testVariable1) + .withEnv(testVariable2) + .withCmd("env") + .exec(); LOG.info("Created container {}", container.toString()); @@ -270,10 +270,10 @@ public void createContainerWithEnvAdditiveMap() throws Exception { final String[] testVariables2 = {"VARIABLE3=success3", "VARIABLE4=success4"}; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withEnv(testVariables1) - .withEnv(testVariables2) - .withCmd("env") - .exec(); + .withEnv(testVariables1) + .withEnv(testVariables2) + .withCmd("env") + .exec(); LOG.info("Created container {}", container.toString()); @@ -304,9 +304,9 @@ public void createContainerWithEnvAsVararg() throws Exception { final String testVariable2 = "VARIABLE2=success2"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withEnv(testVariable1, testVariable2) - .withCmd("env") - .exec(); + .withEnv(testVariable1, testVariable2) + .withCmd("env") + .exec(); LOG.info("Created container {}", container.toString()); @@ -328,9 +328,9 @@ public void createContainerWithEnvAsMap() throws Exception { final String[] testVariables = {"VARIABLE1=success1", "VARIABLE2=success2"}; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withEnv(testVariables) - .withCmd("env") - .exec(); + .withEnv(testVariables) + .withCmd("env") + .exec(); LOG.info("Created container {}", container.toString()); @@ -351,7 +351,7 @@ public void createContainerWithEnvAsMap() throws Exception { public void createContainerWithHostname() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withHostName("docker-java") - .withCmd("env").exec(); + .withCmd("env").exec(); LOG.info("Created container {}", container.toString()); @@ -371,8 +371,8 @@ public void createContainerWithName() throws DockerException { String containerName = "container_"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName(containerName) - .withCmd("env").exec(); + .withName(containerName) + .withCmd("env").exec(); LOG.info("Created container {}", container.toString()); @@ -383,9 +383,9 @@ public void createContainerWithName() throws DockerException { assertThat(inspectContainerResponse.getName(), equalTo("/" + containerName)); dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName(containerName) - .withCmd("env") - .exec(); + .withName(containerName) + .withCmd("env") + .exec(); } @Test @@ -394,38 +394,38 @@ public void createContainerWithLink() throws DockerException { String containerName2 = "container2Withlink_"; CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("sleep", "9999") - .withName(containerName1).exec(); + .withName(containerName1).exec(); LOG.info("Created container1 {}", container1.toString()); assertThat(container1.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container1.getId()).exec(); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); LOG.info("Container1 Inspect: {}", inspectContainerResponse1.toString()); assertThat(inspectContainerResponse1.getState().getRunning(), is(true)); CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withName(containerName2) - .withCmd("env") - .withHostConfig(newHostConfig() - .withLinks(new Link(containerName1, "container1Link"))) - .exec(); + .withCmd("env") + .withHostConfig(newHostConfig() + .withLinks(new Link(containerName1, "container1Link"))) + .exec(); LOG.info("Created container {}", container2.toString()); assertThat(container2.getId(), not(is(emptyString()))); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), equalTo(new Link[]{new Link(containerName1, - "container1Link")})); + "container1Link")})); } @Test public void createContainerWithMemorySwappiness() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withMemorySwappiness(42L)) - .exec(); + .withCmd("sleep", "9999") + .withHostConfig(newHostConfig() + .withMemorySwappiness(42L)) + .exec(); assertThat(container.getId(), not(is(emptyString()))); LOG.info("Created container {}", container.toString()); @@ -433,8 +433,8 @@ public void createContainerWithMemorySwappiness() throws DockerException { LOG.info("Started container {}", container.toString()); InspectContainerResponse inspectContainerResponse = dockerRule.getClient() - .inspectContainerCmd(container.getId()) - .exec(); + .inspectContainerCmd(container.getId()) + .exec(); LOG.info("Container Inspect: {}", inspectContainerResponse.toString()); assertSame(42L, inspectContainerResponse.getHostConfig().getMemorySwappiness()); } @@ -446,41 +446,41 @@ public void createContainerWithLinkInCustomNetwork() throws DockerException { String networkName = "linkNetcustom"; CreateNetworkResponse createNetworkResponse = dockerRule.getClient().createNetworkCmd() - .withName(networkName) - .withDriver("bridge") - .exec(); + .withName(networkName) + .withDriver("bridge") + .exec(); assertNotNull(createNetworkResponse.getId()); CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(newHostConfig() - .withNetworkMode(networkName)) - .withCmd("sleep", "9999") - .withName(containerName1) - .exec(); + .withHostConfig(newHostConfig() + .withNetworkMode(networkName)) + .withCmd("sleep", "9999") + .withName(containerName1) + .exec(); assertThat(container1.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container1.getId()).exec(); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); LOG.info("Container1 Inspect: {}", inspectContainerResponse1.toString()); assertThat(inspectContainerResponse1.getState().getRunning(), is(true)); CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(newHostConfig() - .withLinks(new Link(containerName1, containerName1 + "Link")) - .withNetworkMode(networkName)) - .withName(containerName2) - .withCmd("env") - .exec(); + .withHostConfig(newHostConfig() + .withLinks(new Link(containerName1, containerName1 + "Link")) + .withNetworkMode(networkName)) + .withName(containerName2) + .withCmd("env") + .exec(); LOG.info("Created container {}", container2.toString()); assertThat(container2.getId(), not(is(emptyString()))); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); ContainerNetwork linkNet = inspectContainerResponse2.getNetworkSettings().getNetworks().get(networkName); assertNotNull(linkNet); @@ -494,30 +494,30 @@ public void createContainerWithCustomIp() throws DockerException { String subnetPrefix = "10.100.101"; CreateNetworkResponse createNetworkResponse = dockerRule.getClient().createNetworkCmd() - .withIpam(new Network.Ipam() - .withConfig(new Network.Ipam.Config() - .withSubnet(subnetPrefix + ".0/24"))) - .withDriver("bridge") - .withName(networkName) - .exec(); + .withIpam(new Network.Ipam() + .withConfig(new Network.Ipam.Config() + .withSubnet(subnetPrefix + ".0/24"))) + .withDriver("bridge") + .withName(networkName) + .exec(); assertNotNull(createNetworkResponse.getId()); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(newHostConfig() - .withNetworkMode(networkName)) - .withCmd("sleep", "9999") - .withName(containerName1) - .withIpv4Address(subnetPrefix + ".100") - .exec(); + .withHostConfig(newHostConfig() + .withNetworkMode(networkName)) + .withCmd("sleep", "9999") + .withName(containerName1) + .withIpv4Address(subnetPrefix + ".100") + .exec(); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); InspectContainerResponse inspectContainerResponse = dockerRule.getClient() - .inspectContainerCmd(container.getId()) - .exec(); + .inspectContainerCmd(container.getId()) + .exec(); ContainerNetwork customIpNet = inspectContainerResponse.getNetworkSettings().getNetworks().get(networkName); assertNotNull(customIpNet); @@ -531,26 +531,26 @@ public void createContainerWithAlias() throws DockerException { String networkName = "aliasNet"; CreateNetworkResponse createNetworkResponse = dockerRule.getClient().createNetworkCmd() - .withName(networkName) - .withDriver("bridge") - .exec(); + .withName(networkName) + .withDriver("bridge") + .exec(); assertNotNull(createNetworkResponse.getId()); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(newHostConfig() - .withNetworkMode(networkName)) - .withCmd("sleep", "9999") - .withName(containerName1) - .withAliases("server") - .exec(); + .withHostConfig(newHostConfig() + .withNetworkMode(networkName)) + .withCmd("sleep", "9999") + .withName(containerName1) + .withAliases("server") + .exec(); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()) - .exec(); + .exec(); ContainerNetwork aliasNet = inspectContainerResponse.getNetworkSettings().getNetworks().get(networkName); assertThat(aliasNet.getAliases(), hasItem("server")); @@ -560,10 +560,10 @@ public void createContainerWithAlias() throws DockerException { public void createContainerWithCapAddAndCapDrop() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(newHostConfig() - .withCapAdd(NET_ADMIN) - .withCapDrop(MKNOD)) - .exec(); + .withHostConfig(newHostConfig() + .withCapAdd(NET_ADMIN) + .withCapDrop(MKNOD)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -583,9 +583,9 @@ public void createContainerWithDns() throws DockerException { String anotherDnsServer = "8.8.4.4"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("true") - .withHostConfig(newHostConfig() - .withDns(aDnsServer, anotherDnsServer)) - .exec(); + .withHostConfig(newHostConfig() + .withDns(aDnsServer, anotherDnsServer)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -594,15 +594,15 @@ public void createContainerWithDns() throws DockerException { InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getDns()), - contains(aDnsServer, anotherDnsServer)); + contains(aDnsServer, anotherDnsServer)); } @Test public void createContainerWithEntrypoint() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName("containerEntrypoint") - .withEntrypoint("sleep", "9999").exec(); + .withName("containerEntrypoint") + .withEntrypoint("sleep", "9999").exec(); LOG.info("Created container {}", container.toString()); @@ -620,9 +620,9 @@ public void createContainerWithExtraHosts() throws DockerException { String[] extraHosts = {"dockerhost:127.0.0.1", "otherhost:10.0.0.1"}; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName("containerextrahosts") - .withHostConfig(newHostConfig() - .withExtraHosts(extraHosts)).exec(); + .withName("containerextrahosts") + .withHostConfig(newHostConfig() + .withExtraHosts(extraHosts)).exec(); LOG.info("Created container {}", container.toString()); @@ -631,16 +631,16 @@ public void createContainerWithExtraHosts() throws DockerException { InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getExtraHosts()), - containsInAnyOrder("dockerhost:127.0.0.1", "otherhost:10.0.0.1")); + containsInAnyOrder("dockerhost:127.0.0.1", "otherhost:10.0.0.1")); } @Test public void createContainerWithDevices() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withDevices(new Device("rwm", "/dev/nulo", "/dev/zero"))) - .exec(); + .withHostConfig(newHostConfig() + .withDevices(new Device("rwm", "/dev/nulo", "/dev/zero"))) + .exec(); LOG.info("Created container {}", container.toString()); @@ -649,7 +649,7 @@ public void createContainerWithDevices() throws DockerException { InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getDevices()), contains(new Device("rwm", - "/dev/nulo", "/dev/zero"))); + "/dev/nulo", "/dev/zero"))); } @Test @@ -665,10 +665,10 @@ public void createContainerWithPortBindings() throws DockerException { portBindings.bind(tcp23, Binding.bindPort(baseport + 24)); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("true") - .withExposedPorts(tcp22, tcp23) - .withHostConfig(newHostConfig() - .withPortBindings(portBindings)) - .exec(); + .withExposedPorts(tcp22, tcp23) + .withHostConfig(newHostConfig() + .withPortBindings(portBindings)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -679,13 +679,13 @@ public void createContainerWithPortBindings() throws DockerException { assertThat(Arrays.asList(inspectContainerResponse.getConfig().getExposedPorts()), contains(tcp22, tcp23)); assertThat(inspectContainerResponse.getHostConfig().getPortBindings().getBindings().get(tcp22)[0], - is(equalTo(Binding.bindPort(baseport + 22)))); + is(equalTo(Binding.bindPort(baseport + 22)))); assertThat(inspectContainerResponse.getHostConfig().getPortBindings().getBindings().get(tcp23)[0], - is(equalTo(Binding.bindPort(baseport + 23)))); + is(equalTo(Binding.bindPort(baseport + 23)))); assertThat(inspectContainerResponse.getHostConfig().getPortBindings().getBindings().get(tcp23)[1], - is(equalTo(Binding.bindPort(baseport + 24)))); + is(equalTo(Binding.bindPort(baseport + 24)))); } @@ -695,8 +695,8 @@ public void createContainerWithLinking() throws DockerException { String containerName2 = "container2Withlinking_"; CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sleep", "9999") - .withName(containerName1).exec(); + .withCmd("sleep", "9999") + .withName(containerName1).exec(); LOG.info("Created container1 {}", container1.toString()); assertThat(container1.getId(), not(is(emptyString()))); @@ -704,7 +704,7 @@ public void createContainerWithLinking() throws DockerException { dockerRule.getClient().startContainerCmd(container1.getId()).exec(); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); LOG.info("Container1 Inspect: {}", inspectContainerResponse1.toString()); assertThat(inspectContainerResponse1.getConfig(), is(notNullValue())); @@ -720,16 +720,16 @@ public void createContainerWithLinking() throws DockerException { } CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("sleep", "9999") - .withName(containerName2) - .withHostConfig(newHostConfig() - .withLinks(new Link(containerName1, containerName1 + "Link"))) - .exec(); + .withName(containerName2) + .withHostConfig(newHostConfig() + .withLinks(new Link(containerName1, containerName1 + "Link"))) + .exec(); LOG.info("Created container2 {}", container2.toString()); assertThat(container2.getId(), not(is(emptyString()))); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); LOG.info("Container2 Inspect: {}", inspectContainerResponse2.toString()); assertThat(inspectContainerResponse2.getConfig(), is(notNullValue())); @@ -737,7 +737,7 @@ public void createContainerWithLinking() throws DockerException { assertThat(inspectContainerResponse2.getHostConfig(), is(notNullValue())); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), is(notNullValue())); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), equalTo(new Link[]{new Link(containerName1, - containerName1 + "Link")})); + containerName1 + "Link")})); assertThat(inspectContainerResponse2.getId(), startsWith(container2.getId())); assertThat(inspectContainerResponse2.getName(), equalTo("/" + containerName2)); assertThat(inspectContainerResponse2.getImageId(), not(is(emptyString()))); @@ -750,7 +750,7 @@ public void createContainerWithRestartPolicy() throws DockerException { RestartPolicy restartPolicy = RestartPolicy.onFailureRestart(5); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("sleep", "9999") - .withHostConfig(newHostConfig().withRestartPolicy(restartPolicy)).exec(); + .withHostConfig(newHostConfig().withRestartPolicy(restartPolicy)).exec(); LOG.info("Created container {}", container.toString()); @@ -765,7 +765,7 @@ public void createContainerWithRestartPolicy() throws DockerException { public void createContainerWithPidMode() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("true") - .withHostConfig(newHostConfig().withPidMode("host")).exec(); + .withHostConfig(newHostConfig().withPidMode("host")).exec(); LOG.info("Created container {}", container.toString()); @@ -786,9 +786,9 @@ public void createContainerWithPidMode() throws DockerException { public void createContainerWithNetworkMode() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("true") - .withHostConfig(newHostConfig() - .withNetworkMode("host")) - .exec(); + .withHostConfig(newHostConfig() + .withNetworkMode("host")) + .exec(); LOG.info("Created container {}", container.toString()); @@ -803,7 +803,7 @@ public void createContainerWithNetworkMode() throws DockerException { public void createContainerWithMacAddress() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withMacAddress("00:80:41:ae:fd:7e").withCmd("true").exec(); + .withMacAddress("00:80:41:ae:fd:7e").withCmd("true").exec(); LOG.info("Created container {}", container.toString()); @@ -820,10 +820,10 @@ public void createContainerWithULimits() throws DockerException { Ulimit[] ulimits = {new Ulimit("nproc", 709, 1026), new Ulimit("nofile", 1024, 4096)}; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName(containerName) - .withHostConfig(newHostConfig() - .withUlimits(ulimits)) - .exec(); + .withName(containerName) + .withHostConfig(newHostConfig() + .withUlimits(ulimits)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -832,7 +832,7 @@ public void createContainerWithULimits() throws DockerException { InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getUlimits()), - containsInAnyOrder(new Ulimit("nproc", 709, 1026), new Ulimit("nofile", 1024, 4096))); + containsInAnyOrder(new Ulimit("nproc", 709, 1026), new Ulimit("nofile", 1024, 4096))); } @@ -842,10 +842,10 @@ public void createContainerWithIntegerBoundsExceedingULimit() throws DockerExcep Ulimit[] ulimits = {new Ulimit("core", 99999999998L, 99999999999L)}; CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withName(containerName) - .withHostConfig(newHostConfig() - .withUlimits(ulimits)) - .exec(); + .withName(containerName) + .withHostConfig(newHostConfig() + .withUlimits(ulimits)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -854,7 +854,7 @@ public void createContainerWithIntegerBoundsExceedingULimit() throws DockerExcep InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getUlimits()), - contains(new Ulimit("core", 99999999998L, 99999999999L))); + contains(new Ulimit("core", 99999999998L, 99999999999L))); } @@ -866,7 +866,7 @@ public void createContainerWithLabels() throws DockerException { labels.put("com.github.dockerjava.Boolean", "true"); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("sleep", "9999") - .withLabels(labels).exec(); + .withLabels(labels).exec(); LOG.info("Created container {}", container.toString()); @@ -879,8 +879,8 @@ public void createContainerWithLabels() throws DockerException { // swarm adds 3d label assertThat(inspectContainerResponse.getConfig().getLabels(), allOf( - hasEntry("com.github.dockerjava.null", ""), - hasEntry("com.github.dockerjava.Boolean", "true") + hasEntry("com.github.dockerjava.null", ""), + hasEntry("com.github.dockerjava.Boolean", "true") )); } @@ -889,9 +889,9 @@ public void createContainerWithLogConfig() throws DockerException { LogConfig logConfig = new LogConfig(LogConfig.LoggingType.NONE, null); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(newHostConfig() - .withLogConfig(logConfig)) - .exec(); + .withHostConfig(newHostConfig() + .withLogConfig(logConfig)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -911,11 +911,11 @@ public void testWithStopSignal() throws Exception { Integer signal = 10; // SIGUSR1 in busybox CreateContainerResponse resp = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("/bin/sh", "-c", "trap 'echo \"exit trapped 10\"; exit 10' USR1; while true; do sleep 1; done") - .withAttachStdin(true) - .withTty(true) - .withStopSignal(signal.toString()) - .exec(); + .withCmd("/bin/sh", "-c", "trap 'echo \"exit trapped 10\"; exit 10' USR1; while true; do sleep 1; done") + .withAttachStdin(true) + .withTty(true) + .withStopSignal(signal.toString()) + .exec(); final String containerId = resp.getId(); assertThat(containerId, not(is(emptyString()))); dockerRule.getClient().startContainerCmd(containerId).exec(); @@ -933,11 +933,11 @@ public void testWithStopSignal() throws Exception { StringBuilder stringBuilder = new StringBuilder(); final StringBuilderLogReader callback = new StringBuilderLogReader(stringBuilder); dockerRule.getClient().logContainerCmd(containerId) - .withStdErr(true) - .withStdOut(true) - .withTailAll() - .exec(callback) - .awaitCompletion(); + .withStdErr(true) + .withStdOut(true) + .withTailAll() + .exec(callback) + .awaitCompletion(); String log = callback.builder.toString(); assertThat(log.trim(), is("exit trapped 10")); @@ -960,9 +960,9 @@ public void onNext(Frame item) { @Test public void createContainerWithCgroupParent() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withHostConfig(newHostConfig() - .withCgroupParent("/parent")) - .exec(); + .withHostConfig(newHostConfig() + .withCgroupParent("/parent")) + .exec(); LOG.info("Created container {}", container.toString()); @@ -978,7 +978,7 @@ public void createContainerWithCgroupParent() throws DockerException { public void createContainerWithShmSize() throws DockerException { HostConfig hostConfig = new HostConfig().withShmSize(96 * FileUtils.ONE_MB); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(hostConfig).withCmd("true").exec(); + .withHostConfig(hostConfig).withCmd("true").exec(); LOG.info("Created container {}", container.toString()); @@ -996,7 +996,7 @@ public void createContainerWithShmPidsLimit() throws DockerException { HostConfig hostConfig = new HostConfig().withPidsLimit(2L); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withHostConfig(hostConfig).withCmd("true").exec(); + .withHostConfig(hostConfig).withCmd("true").exec(); LOG.info("Created container {}", container.toString()); @@ -1015,7 +1015,7 @@ public void createContainerWithNetworkID() { Map labels = new HashMap<>(); labels.put("com.example.label", "test"); CreateNetworkResponse createNetworkResponse = dockerRule.getClient().createNetworkCmd().withName(networkName) - .withLabels(labels).withAttachable(true).exec(); + .withLabels(labels).withAttachable(true).exec(); String networkId = createNetworkResponse.getId(); CreateContainerResponse createContainerResponse = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withLabels(labels).withCmd("true").exec(); String containerId = createContainerResponse.getId(); @@ -1038,8 +1038,8 @@ public void createContainerFromPrivateRegistryWithValidAuth() throws Exception { String imgName = REGISTRY.createPrivateImage("create-container-with-valid-auth"); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(imgName) - .withAuthConfig(authConfig) - .exec(); + .withAuthConfig(authConfig) + .exec(); assertThat(container.getId(), is(notNullValue())); } @@ -1057,13 +1057,13 @@ public void createContainerFromPrivateRegistryWithNoAuth() throws Exception { } dockerRule.getClient().createContainerCmd(imgName) - .exec(); + .exec(); } @Test public void createContainerWithTmpFs() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("sleep", "9999") - .withHostConfig(new HostConfig().withTmpFs(Collections.singletonMap("/tmp", "rw,noexec,nosuid,size=50m"))).exec(); + .withHostConfig(new HostConfig().withTmpFs(Collections.singletonMap("/tmp", "rw,noexec,nosuid,size=50m"))).exec(); assertThat(container.getId(), not(is(emptyString()))); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CreateNetworkCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CreateNetworkCmdIT.java index d60425a2a..0bf63eacb 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CreateNetworkCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CreateNetworkCmdIT.java @@ -15,11 +15,10 @@ import static com.github.dockerjava.junit.DockerMatchers.isGreaterOrEqual; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeThat; @@ -66,9 +65,9 @@ public void createAttachableNetwork() throws DockerException { String networkName = "createAttachableNetwork"; CreateNetworkResponse createNetworkResponse = dockerRule.getClient().createNetworkCmd() - .withName(networkName) - .withAttachable(true) - .exec(); + .withName(networkName) + .withAttachable(true) + .exec(); assertNotNull(createNetworkResponse.getId()); Network network = dockerRule.getClient().inspectNetworkCmd().withNetworkId(createNetworkResponse.getId()).exec(); assertThat(network, notNullValue()); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/CreateVolumeCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/CreateVolumeCmdIT.java index f59907afa..6beb6d551 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/CreateVolumeCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/CreateVolumeCmdIT.java @@ -18,7 +18,7 @@ public void createVolume() throws DockerException { String volumeName = "volume1"; CreateVolumeResponse createVolumeResponse = dockerRule.getClient().createVolumeCmd().withName(volumeName) - .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); + .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); assertThat(createVolumeResponse.getName(), equalTo(volumeName)); assertThat(createVolumeResponse.getDriver(), equalTo("local")); @@ -32,7 +32,7 @@ public void createVolumeWithExistingName() throws DockerException { String volumeName = "volume1"; CreateVolumeResponse createVolumeResponse1 = dockerRule.getClient().createVolumeCmd().withName(volumeName) - .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); + .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); assertThat(createVolumeResponse1.getName(), equalTo(volumeName)); assertThat(createVolumeResponse1.getDriver(), equalTo("local")); @@ -40,7 +40,7 @@ public void createVolumeWithExistingName() throws DockerException { assertThat(createVolumeResponse1.getMountpoint(), containsString("/volume1/")); CreateVolumeResponse createVolumeResponse2 = dockerRule.getClient().createVolumeCmd().withName(volumeName) - .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); + .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); assertThat(createVolumeResponse2.getName(), equalTo(volumeName)); assertThat(createVolumeResponse2.getDriver(), equalTo("local")); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/DisconnectFromNetworkCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/DisconnectFromNetworkCmdIT.java index 2d932cc24..c9b6bf42d 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/DisconnectFromNetworkCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/DisconnectFromNetworkCmdIT.java @@ -41,18 +41,18 @@ public void forceDisconnectFromNetwork() { CreateNetworkResponse network = dockerRule.getClient().createNetworkCmd().withName("testNetwork2").exec(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withHostConfig(newHostConfig() - .withNetworkMode("testNetwork2")) - .withCmd("sleep", "9999") - .exec(); + .withHostConfig(newHostConfig() + .withNetworkMode("testNetwork2")) + .withCmd("sleep", "9999") + .exec(); dockerRule.getClient().startContainerCmd(container.getId()).exec(); dockerRule.getClient().disconnectFromNetworkCmd() - .withNetworkId(network.getId()) - .withContainerId(container.getId()) - .withForce(true) - .exec(); + .withNetworkId(network.getId()) + .withContainerId(container.getId()) + .withForce(true) + .exec(); Network updatedNetwork = dockerRule.getClient().inspectNetworkCmd().withNetworkId(network.getId()).exec(); assertFalse(updatedNetwork.getContainers().containsKey(container.getId())); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/EventsCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/EventsCmdIT.java index 2a16e5474..a10552223 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/EventsCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/EventsCmdIT.java @@ -47,9 +47,9 @@ public void testEventStreamTimeBound() throws Exception { EventsTestCallback eventCallback = new EventsTestCallback(expectedEvents); dockerRule.getClient().eventsCmd() - .withSince(startTime) - .withUntil(endTime) - .exec(eventCallback); + .withSince(startTime) + .withUntil(endTime) + .exec(eventCallback); List events = eventCallback.awaitExpectedEvents(30, TimeUnit.SECONDS); @@ -66,8 +66,8 @@ public void testEventStreaming() throws Exception { EventsTestCallback eventCallback = new EventsTestCallback(expectedEvents); dockerRule.getClient().eventsCmd() - .withSince(startTime) - .exec(eventCallback); + .withSince(startTime) + .exec(eventCallback); generateEvents(); @@ -101,9 +101,9 @@ public void testEventStreamingWithFilter() throws Exception { EventsTestCallback eventCallback = new EventsTestCallback(expectedEvents); dockerRule.getClient().eventsCmd() - .withSince(startTime) - .withEventFilter("start") - .exec(eventCallback); + .withSince(startTime) + .withEventFilter("start") + .exec(eventCallback); generateEvents(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ExecCreateCmdImplIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ExecCreateCmdImplIT.java index 2f18d7e85..9911b84ee 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ExecCreateCmdImplIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ExecCreateCmdImplIT.java @@ -23,7 +23,7 @@ public void execCreateTest() { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withUser("root").withCmd("top") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); @@ -32,7 +32,7 @@ public void execCreateTest() { dockerRule.getClient().startContainerCmd(container.getId()).exec(); ExecCreateCmdResponse execCreateCmdResponse = dockerRule.getClient().execCreateCmd(container.getId()) - .withCmd("touch", "file.log").exec(); + .withCmd("touch", "file.log").exec(); assertThat(execCreateCmdResponse.getId(), not(is(emptyString()))); } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ExecStartCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ExecStartCmdIT.java index cf096aa26..0174c0a6f 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ExecStartCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ExecStartCmdIT.java @@ -30,20 +30,20 @@ public void execStart() throws Exception { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("top") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); ExecCreateCmdResponse execCreateCmdResponse = dockerRule.getClient().execCreateCmd(container.getId()) - .withAttachStdout(true) - .withCmd("touch", "/execStartTest.log") - .withUser("root") - .exec(); + .withAttachStdout(true) + .withCmd("touch", "/execStartTest.log") + .withUser("root") + .exec(); dockerRule.getClient().execStartCmd(execCreateCmdResponse.getId()) - .exec(new ExecStartResultCallback(System.out, System.err)) - .awaitCompletion(); + .exec(new ExecStartResultCallback(System.out, System.err)) + .awaitCompletion(); InputStream response = dockerRule.getClient().copyArchiveFromContainerCmd(container.getId(), "/execStartTest.log").exec(); @@ -58,16 +58,16 @@ public void execStartAttached() throws Exception { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); ExecCreateCmdResponse execCreateCmdResponse = dockerRule.getClient().execCreateCmd(container.getId()) - .withAttachStdout(true).withCmd("touch", "/execStartTest.log").exec(); + .withAttachStdout(true).withCmd("touch", "/execStartTest.log").exec(); dockerRule.getClient().execStartCmd(execCreateCmdResponse.getId()).withDetach(false).withTty(true) - .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); + .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); InputStream response = dockerRule.getClient().copyArchiveFromContainerCmd(container.getId(), "/execStartTest.log").exec(); @@ -82,16 +82,16 @@ public void execStartWithNonExistentUser() throws Exception { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); ExecCreateCmdResponse execCreateCmdResponse = dockerRule.getClient().execCreateCmd(container.getId()) - .withAttachStdout(true).withCmd("touch", "/execStartTest.log").withUser("NonExistentUser").exec(); + .withAttachStdout(true).withCmd("touch", "/execStartTest.log").withUser("NonExistentUser").exec(); dockerRule.getClient().execStartCmd(execCreateCmdResponse.getId()).withDetach(false).withTty(true) - .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); + .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); dockerRule.getClient().copyArchiveFromContainerCmd(container.getId(), "/execStartTest.log").exec(); } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/HealthCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/HealthCmdIT.java index bdca27572..045e998dc 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/HealthCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/HealthCmdIT.java @@ -31,7 +31,7 @@ public class HealthCmdIT extends CmdIT { @Test public void healthiness() { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("nc", "-l", "-p", "8080") + .withCmd("nc", "-l", "-p", "8080") .withHealthcheck(new HealthCheck() .withTest(Arrays.asList("CMD", "sh", "-c", "netstat -ltn | grep 8080")) .withInterval(TimeUnit.SECONDS.toNanos(1)) @@ -57,7 +57,7 @@ public void healthiness_startInterval() { assumeThat("API version should be >= 1.44", dockerRule, isGreaterOrEqual(RemoteApiVersion.VERSION_1_44)); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("nc", "-l", "-p", "8080") + .withCmd("nc", "-l", "-p", "8080") .withHealthcheck(new HealthCheck() .withTest(Arrays.asList("CMD", "sh", "-c", "netstat -ltn | grep 8080")) .withInterval(TimeUnit.SECONDS.toNanos(5)) diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/InfoCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/InfoCmdIT.java index 74fc2cbda..7666f9a7d 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/InfoCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/InfoCmdIT.java @@ -29,9 +29,9 @@ public void infoTest() throws DockerException { // TODO extract this into a shared method if (dockerClient.listContainersCmd().withShowAll(true).exec().size() == 0) { CreateContainerResponse container = dockerClient.createContainerCmd(DEFAULT_IMAGE) - .withName("docker-java-itest-info") - .withCmd("touch", "/test") - .exec(); + .withName("docker-java-itest-info") + .withCmd("touch", "/test") + .exec(); LOG.info("Created container: {}", container); assertThat(container.getId(), not(isEmptyOrNullString())); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/InspectContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/InspectContainerCmdIT.java index 54d900db8..5bdd61fea 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/InspectContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/InspectContainerCmdIT.java @@ -18,10 +18,10 @@ import static com.github.dockerjava.utils.TestUtils.isNotSwarm; import static com.github.dockerjava.utils.TestUtils.isSwarm; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @@ -40,7 +40,7 @@ public void inspectContainer() throws DockerException { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("top") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -53,14 +53,14 @@ public void inspectContainer() throws DockerException { public void inspectContainerNodeProperty() throws DockerException { Map label = Collections.singletonMap("inspectContainerNodeProperty", UUID.randomUUID().toString()); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withLabels(label) - .exec(); + .withLabels(label) + .exec(); Container containerResult = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(label) - .exec() - .get(0); + .withShowAll(true) + .withLabelFilter(label) + .exec() + .get(0); String name = containerResult.getNames()[0]; @@ -88,7 +88,7 @@ public void inspectContainerWithSize() throws DockerException { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("top") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -115,7 +115,7 @@ public void inspectNonExistingContainer() throws DockerException { public void inspectContainerRestartCount() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("env").exec(); + .withCmd("env").exec(); LOG.info("Created container {}", container.toString()); @@ -130,7 +130,7 @@ public void inspectContainerRestartCount() throws DockerException { public void inspectContainerNetworkSettings() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("env").exec(); + .withCmd("env").exec(); LOG.info("Created container {}", container.toString()); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/InspectExecCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/InspectExecCmdIT.java index b256c6a7c..a4f0e1ff3 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/InspectExecCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/InspectExecCmdIT.java @@ -11,7 +11,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; import java.security.SecureRandom; import static com.github.dockerjava.core.RemoteApiVersion.VERSION_1_22; @@ -33,7 +32,7 @@ public void inspectExec() throws Exception { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -41,33 +40,33 @@ public void inspectExec() throws Exception { // Check that file does not exist ExecCreateCmdResponse checkFileExec1 = dockerRule.getClient().execCreateCmd(container.getId()).withAttachStdout(true) - .withAttachStderr(true).withCmd("test", "-e", "/marker").exec(); + .withAttachStderr(true).withCmd("test", "-e", "/marker").exec(); LOG.info("Created exec {}", checkFileExec1.toString()); assertThat(checkFileExec1.getId(), not(is(emptyString()))); dockerRule.getClient().execStartCmd(checkFileExec1.getId()).withDetach(false) - .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); + .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); InspectExecResponse first = dockerRule.getClient().inspectExecCmd(checkFileExec1.getId()).exec(); assertThat(first.isRunning(), is(false)); assertThat(first.getExitCode(), is(1)); // Create the file ExecCreateCmdResponse touchFileExec = dockerRule.getClient().execCreateCmd(container.getId()).withAttachStdout(true) - .withAttachStderr(true).withCmd("touch", "/marker").exec(); + .withAttachStderr(true).withCmd("touch", "/marker").exec(); LOG.info("Created exec {}", touchFileExec.toString()); assertThat(touchFileExec.getId(), not(is(emptyString()))); dockerRule.getClient().execStartCmd(touchFileExec.getId()).withDetach(false) - .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); + .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); InspectExecResponse second = dockerRule.getClient().inspectExecCmd(touchFileExec.getId()).exec(); assertThat(second.isRunning(), is(false)); assertThat(second.getExitCode(), is(0)); // Check that file does exist now ExecCreateCmdResponse checkFileExec2 = dockerRule.getClient().execCreateCmd(container.getId()).withAttachStdout(true) - .withAttachStderr(true).withCmd("test", "-e", "/marker").exec(); + .withAttachStderr(true).withCmd("test", "-e", "/marker").exec(); LOG.info("Created exec {}", checkFileExec2.toString()); assertThat(checkFileExec2.getId(), not(is(emptyString()))); dockerRule.getClient().execStartCmd(checkFileExec2.getId()).withDetach(false) - .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); + .exec(new ExecStartResultCallback(System.out, System.err)).awaitCompletion(); InspectExecResponse third = dockerRule.getClient().inspectExecCmd(checkFileExec2.getId()).exec(); assertThat(third.isRunning(), is(false)); assertThat(third.getExitCode(), is(0)); @@ -85,14 +84,14 @@ public void inspectExecNetworkSettings() { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(containerName).exec(); + .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); dockerRule.getClient().startContainerCmd(container.getId()).exec(); ExecCreateCmdResponse exec = dockerRule.getClient().execCreateCmd(container.getId()).withAttachStdout(true) - .withAttachStderr(true).withCmd("/bin/bash").exec(); + .withAttachStderr(true).withCmd("/bin/bash").exec(); LOG.info("Created exec {}", exec.toString()); assertThat(exec.getId(), not(is(emptyString()))); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/InspectVolumeCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/InspectVolumeCmdIT.java index 2e9b806b2..30d43e704 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/InspectVolumeCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/InspectVolumeCmdIT.java @@ -19,7 +19,7 @@ public void inspectVolume() throws DockerException { String volumeName = "volume1"; dockerRule.getClient().createVolumeCmd().withName(volumeName).withDriver("local") - .withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); + .withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); InspectVolumeResponse inspectVolumeResponse = dockerRule.getClient().inspectVolumeCmd(volumeName).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/KillContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/KillContainerCmdIT.java index 617e547cb..476a18a25 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/KillContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/KillContainerCmdIT.java @@ -9,9 +9,9 @@ import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; public class KillContainerCmdIT extends CmdIT { diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java index 3490924c7..490a7cd12 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java @@ -24,11 +24,11 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.oneOf; @@ -51,9 +51,9 @@ public void setUp() { public void tearDown() { //remove all containers created by this test List containers = dockerRule.getClient().listContainersCmd() - .withLabelFilter(testLabel) - .withShowAll(true) - .exec(); + .withLabelFilter(testLabel) + .withShowAll(true) + .exec(); for (Container container : containers) { removeContainer(container.getId()); @@ -63,18 +63,18 @@ public void tearDown() { @Test public void testListContainers() { List containers = dockerRule.getClient().listContainersCmd() - .withLabelFilter(testLabel) - .withShowAll(true) - .exec(); + .withLabelFilter(testLabel) + .withShowAll(true) + .exec(); assertThat(containers, notNullValue()); LOG.info("Container List: {}", containers); int size = containers.size(); CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .withCmd("echo") - .exec(); + .withLabels(testLabel) + .withCmd("echo") + .exec(); assertThat(container1.getId(), not(is(emptyString()))); InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container1.getId()).exec(); @@ -84,9 +84,9 @@ public void testListContainers() { LOG.info("container id: " + container1.getId()); List containers2 = dockerRule.getClient().listContainersCmd() - .withLabelFilter(testLabel) - .withShowAll(true) - .exec(); + .withLabelFilter(testLabel) + .withShowAll(true) + .exec(); for (Container container : containers2) { LOG.info("listContainer: id=" + container.getId() + " image=" + container.getImage()); } @@ -111,13 +111,13 @@ public void testListContainers() { public void testListContainersWithLabelsFilter() { // list with filter by Map label dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE).withCmd("echo") - .withLabels(testLabel) - .exec(); + .withLabels(testLabel) + .exec(); List filteredContainersByMap = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .exec(); assertThat(filteredContainersByMap.size(), is(1)); @@ -127,9 +127,9 @@ public void testListContainersWithLabelsFilter() { // List by string label List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(singletonList("test=" + testLabel.get("test"))) - .exec(); + .withShowAll(true) + .withLabelFilter(singletonList("test=" + testLabel.get("test"))) + .exec(); assertThat(filteredContainers.size(), is(1)); @@ -145,21 +145,21 @@ public void testNameFilter() { String id1, id2; id1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .withName("nameFilterTest1-" + testUUID) - .exec() - .getId(); + .withLabels(testLabel) + .withName("nameFilterTest1-" + testUUID) + .exec() + .getId(); id2 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .withName("nameFilterTest2-" + testUUID) - .exec() - .getId(); + .withLabels(testLabel) + .withName("nameFilterTest2-" + testUUID) + .exec() + .getId(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withNameFilter(asList("nameFilterTest1-" + testUUID, "nameFilterTest2-" + testUUID)) - .exec(); + .withShowAll(true) + .withNameFilter(asList("nameFilterTest1-" + testUUID, "nameFilterTest2-" + testUUID)) + .exec(); assertThat(filteredContainers.size(), is(2)); assertThat(filteredContainers.get(0).getId(), is(oneOf(id1, id2))); @@ -170,19 +170,19 @@ public void testNameFilter() { public void testIdsFilter() { String id1, id2; id1 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec() - .getId(); + .withLabels(testLabel) + .exec() + .getId(); id2 = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec() - .getId(); + .withLabels(testLabel) + .exec() + .getId(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withIdFilter(asList(id1, id2)) - .exec(); + .withShowAll(true) + .withIdFilter(asList(id1, id2)) + .exec(); assertThat(filteredContainers.size(), is(2)); assertThat(filteredContainers.get(0).getId(), is(oneOf(id1, id2))); @@ -192,15 +192,15 @@ public void testIdsFilter() { @Test public void shouldFilterByCreatedStatus() { String containerId = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec() - .getId(); + .withLabels(testLabel) + .exec() + .getId(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .withStatusFilter(singletonList("created")) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .withStatusFilter(singletonList("created")) + .exec(); assertThat(filteredContainers.size(), is(1)); assertThat(filteredContainers.get(0).getId(), is(containerId)); @@ -209,16 +209,16 @@ public void shouldFilterByCreatedStatus() { @Test public void shouldFilterByRunningStatus() { String containerId = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec() - .getId(); + .withLabels(testLabel) + .exec() + .getId(); dockerRule.getClient().startContainerCmd(containerId).exec(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .withStatusFilter(singletonList("running")) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .withStatusFilter(singletonList("running")) + .exec(); assertThat(filteredContainers, hasSize(1)); assertThat(filteredContainers.get(0).getId(), is(containerId)); @@ -227,18 +227,18 @@ public void shouldFilterByRunningStatus() { @Test public void shouldFilterByPausedStatus() { String containerId = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sh", "-c", "sleep 99999") - .withLabels(testLabel) - .exec() - .getId(); + .withCmd("sh", "-c", "sleep 99999") + .withLabels(testLabel) + .exec() + .getId(); dockerRule.getClient().startContainerCmd(containerId).exec(); dockerRule.getClient().pauseContainerCmd(containerId).exec(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .withStatusFilter(singletonList("paused")) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .withStatusFilter(singletonList("paused")) + .exec(); assertThat(filteredContainers, hasSize(1)); assertThat(filteredContainers.get(0).getId(), is(containerId)); @@ -247,19 +247,19 @@ public void shouldFilterByPausedStatus() { @Test public void shouldFilterByExitedStatus() throws InterruptedException { String containerId = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sh", "-c", "sleep 99999") - .withLabels(testLabel) - .exec() - .getId(); + .withCmd("sh", "-c", "sleep 99999") + .withLabels(testLabel) + .exec() + .getId(); dockerRule.getClient().startContainerCmd(containerId).exec(); dockerRule.getClient().stopContainerCmd(containerId).exec(); dockerRule.getClient().waitContainerCmd(containerId).start().awaitCompletion(15, TimeUnit.SECONDS); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .withStatusFilter(singletonList("exited")) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .withStatusFilter(singletonList("exited")) + .exec(); assertThat(filteredContainers, hasSize(1)); assertThat(filteredContainers.get(0).getId(), is(containerId)); @@ -269,26 +269,26 @@ public void shouldFilterByExitedStatus() throws InterruptedException { public void testVolumeFilter() { String id; dockerRule.getClient().createVolumeCmd() - .withName("TestFilterVolume") - .withDriver("local") - .exec(); + .withName("TestFilterVolume") + .withDriver("local") + .exec(); id = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .withHostConfig(newHostConfig() - .withBinds(new Bind("TestFilterVolume", new Volume("/test")))) - .exec() - .getId(); + .withLabels(testLabel) + .withHostConfig(newHostConfig() + .withBinds(new Bind("TestFilterVolume", new Volume("/test")))) + .exec() + .getId(); dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec(); + .withLabels(testLabel) + .exec(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .withVolumeFilter(singletonList("TestFilterVolume")) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .withVolumeFilter(singletonList("TestFilterVolume")) + .exec(); assertThat(filteredContainers, hasSize(1)); assertThat(filteredContainers.get(0).getId(), is(id)); @@ -298,26 +298,26 @@ public void testVolumeFilter() { public void testNetworkFilter() { String id; dockerRule.getClient().createNetworkCmd() - .withName("TestFilterNetwork") - .withDriver("bridge") - .exec(); + .withName("TestFilterNetwork") + .withDriver("bridge") + .exec(); id = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .withHostConfig(newHostConfig() - .withNetworkMode("TestFilterNetwork")) - .exec() - .getId(); + .withLabels(testLabel) + .withHostConfig(newHostConfig() + .withNetworkMode("TestFilterNetwork")) + .exec() + .getId(); dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec(); + .withLabels(testLabel) + .exec(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withShowAll(true) - .withLabelFilter(testLabel) - .withNetworkFilter(singletonList("TestFilterNetwork")) - .exec(); + .withShowAll(true) + .withLabelFilter(testLabel) + .withNetworkFilter(singletonList("TestFilterNetwork")) + .exec(); assertThat(filteredContainers.size(), is(1)); assertThat(filteredContainers.get(0).getId(), is(id)); @@ -330,26 +330,26 @@ public void testAncestorFilter() throws Exception { DockerAssume.assumeNotSwarm(dockerRule.getClient()); dockerRule.getClient().pullImageCmd("busybox") - .withTag("1.35") - .start() - .awaitCompletion(); + .withTag("1.35") + .start() + .awaitCompletion(); dockerRule.getClient().createContainerCmd("busybox:1.35") - .withLabels(testLabel) - .exec(); + .withLabels(testLabel) + .exec(); String imageId = dockerRule.getClient().inspectImageCmd(DEFAULT_IMAGE).exec().getId(); String id = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec() - .getId(); + .withLabels(testLabel) + .exec() + .getId(); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withLabelFilter(testLabel) - .withShowAll(true) - .withAncestorFilter(singletonList(imageId)) - .exec(); + .withLabelFilter(testLabel) + .withShowAll(true) + .withAncestorFilter(singletonList(imageId)) + .exec(); assertThat(filteredContainers.size(), is(1)); assertThat(filteredContainers.get(0).getId(), is(id)); @@ -358,27 +358,27 @@ public void testAncestorFilter() throws Exception { @Test public void testExitedFilter() { dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .exec(); + .withLabels(testLabel) + .exec(); String id = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withLabels(testLabel) - .withCmd("sh", "-c", "exit 42") - .exec() - .getId(); + .withLabels(testLabel) + .withCmd("sh", "-c", "exit 42") + .exec() + .getId(); dockerRule.getClient().startContainerCmd(id).exec(); Integer status = dockerRule.getClient().waitContainerCmd(id).start() - .awaitStatusCode(); + .awaitStatusCode(); assertThat(status, is(42)); List filteredContainers = dockerRule.getClient().listContainersCmd() - .withLabelFilter(testLabel) - .withShowAll(true) - .withExitedFilter(42) - .exec(); + .withLabelFilter(testLabel) + .withShowAll(true) + .withExitedFilter(42) + .exec(); assertThat(filteredContainers.size(), is(1)); assertThat(filteredContainers.get(0).getId(), is(id)); @@ -388,7 +388,8 @@ private void removeContainer(String id) { if (id != null) { try { dockerRule.getClient().removeContainerCmd(id).withForce(true).exec(); - } catch (Exception ignored) {} + } catch (Exception ignored) { + } } } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ListImagesCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ListImagesCmdIT.java index 38b756dab..8c2459995 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ListImagesCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ListImagesCmdIT.java @@ -15,11 +15,11 @@ import static com.github.dockerjava.utils.TestUtils.isNotSwarm; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.emptyArray; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertTrue; @@ -49,7 +49,7 @@ public void listImages() throws DockerException { public void listImagesWithDanglingFilter() throws DockerException { String imageId = createDanglingImage(); List images = dockerRule.getClient().listImagesCmd().withDanglingFilter(true).withShowAll(true) - .exec(); + .exec(); assertThat(images, notNullValue()); LOG.info("Images List: {}", images); assertThat(images.size(), is(greaterThan(0))); @@ -66,8 +66,7 @@ public void listImagesWithReferenceFilter() throws DockerException { List images = dockerRule.getClient().listImagesCmd().withReferenceFilter("docker-java/busybox") .exec(); assertThat(images, hasSize(1)); - } - finally { + } finally { dockerRule.getClient().removeImageCmd("docker-java/busybox:" + tag).exec(); } } @@ -81,8 +80,7 @@ public void listImagesWithFilter() throws DockerException { List images = dockerRule.getClient().listImagesCmd().withFilter("reference", Collections.singletonList("docker-java/busybox")) .exec(); assertThat(images, hasSize(1)); - } - finally { + } finally { dockerRule.getClient().removeImageCmd("docker-java/busybox:" + tag).exec(); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ListVolumesCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ListVolumesCmdIT.java index df073e16d..cfef45c2c 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ListVolumesCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ListVolumesCmdIT.java @@ -13,12 +13,12 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; public class ListVolumesCmdIT extends CmdIT { - + @Test public void listVolumes() throws DockerException { CreateVolumeResponse createVolumeResponse = dockerRule.getClient().createVolumeCmd().withName("volume1") - .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); + .withDriver("local").withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); assertThat(createVolumeResponse.getName(), equalTo("volume1")); assertThat(createVolumeResponse.getDriver(), equalTo("local")); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/LoadImageCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/LoadImageCmdIT.java index 5b87f17a6..2df061ce4 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/LoadImageCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/LoadImageCmdIT.java @@ -22,7 +22,7 @@ public class LoadImageCmdIT extends CmdIT { private String expectedImageId; - + @Before public void beforeMethod() { expectedImageId = "sha256:56031f66eb0cef2e2e5cb2d1dabafaa0ebcd0a18a507d313b5bdb8c0472c5eba"; @@ -51,7 +51,7 @@ public void loadImageFromTar() throws Exception { assertThat("Can't find expected image after loading from a tar archive!", image, notNullValue()); assertThat("Image after loading from a tar archive has wrong tags!", - asList(image.getRepoTags()), equalTo(singletonList("docker-java/load:1.0"))); + asList(image.getRepoTags()), equalTo(singletonList("docker-java/load:1.0"))); } @Test @@ -64,7 +64,7 @@ public void loadImageFromTarAsync() throws Exception { assertThat("Can't find expected image after loading from a tar archive!", image, notNullValue()); assertThat("Image after loading from a tar archive has wrong tags!", - asList(image.getRepoTags()), equalTo(singletonList("docker-java/load:1.0"))); + asList(image.getRepoTags()), equalTo(singletonList("docker-java/load:1.0"))); } private Image findImageWithId(final String id, final List images) { diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/LogContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/LogContainerCmdIT.java index 8593d6ccf..c67d5d6e7 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/LogContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/LogContainerCmdIT.java @@ -42,9 +42,9 @@ public class LogContainerCmdIT extends CmdIT { public void asyncLogContainerWithTtyEnabled() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("/bin/sh", "-c", "while true; do echo hello; sleep 1; done") - .withTty(true) - .exec(); + .withCmd("/bin/sh", "-c", "while true; do echo hello; sleep 1; done") + .withTty(true) + .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -73,9 +73,9 @@ public void asyncLogContainerWithTtyEnabled() throws Exception { public void asyncLogContainerWithTtyDisabled() throws Exception { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("/bin/sh", "-c", "while true; do echo hello; sleep 1; done") - .withTty(false) - .exec(); + .withCmd("/bin/sh", "-c", "while true; do echo hello; sleep 1; done") + .withTty(false) + .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -122,11 +122,13 @@ public void onError(Throwable throwable) { public void onComplete() { super.onComplete(); throw new AssertionError("expected NotFoundException"); - }; + } + + ; }; dockerRule.getClient().logContainerCmd("non-existing").withStdErr(true).withStdOut(true).exec(loggingCallback) - .awaitCompletion(); + .awaitCompletion(); } @Test @@ -135,8 +137,8 @@ public void asyncMultipleLogContainer() throws Exception { String snippet = "hello world"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("/bin/echo", snippet) - .exec(); + .withCmd("/bin/echo", snippet) + .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -144,35 +146,35 @@ public void asyncMultipleLogContainer() throws Exception { dockerRule.getClient().startContainerCmd(container.getId()).exec(); int exitCode = dockerRule.getClient().waitContainerCmd(container.getId()) - .start() - .awaitStatusCode(); + .start() + .awaitStatusCode(); assertThat(exitCode, equalTo(0)); LogContainerTestCallback loggingCallback = new LogContainerTestCallback(); dockerRule.getClient().logContainerCmd(container.getId()) - .withStdErr(true) - .withStdOut(true) - .exec(loggingCallback); + .withStdErr(true) + .withStdOut(true) + .exec(loggingCallback); loggingCallback.close(); loggingCallback = new LogContainerTestCallback(); dockerRule.getClient().logContainerCmd(container.getId()) - .withStdErr(true) - .withStdOut(true) - .exec(loggingCallback); + .withStdErr(true) + .withStdOut(true) + .exec(loggingCallback); loggingCallback.close(); loggingCallback = new LogContainerTestCallback(); dockerRule.getClient().logContainerCmd(container.getId()) - .withStdErr(true) - .withStdOut(true) - .exec(loggingCallback); + .withStdErr(true) + .withStdOut(true) + .exec(loggingCallback); loggingCallback.awaitCompletion(); @@ -184,8 +186,8 @@ public void asyncLogContainerWithSince() throws Exception { String snippet = "hello world"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("/bin/echo", snippet) - .exec(); + .withCmd("/bin/echo", snippet) + .exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -195,19 +197,19 @@ public void asyncLogContainerWithSince() throws Exception { dockerRule.getClient().startContainerCmd(container.getId()).exec(); int exitCode = dockerRule.getClient().waitContainerCmd(container.getId()) - .start() - .awaitStatusCode(); + .start() + .awaitStatusCode(); assertThat(exitCode, equalTo(0)); LogContainerTestCallback loggingCallback = new LogContainerTestCallback(); dockerRule.getClient().logContainerCmd(container.getId()) - .withStdErr(true) - .withStdOut(true) - .withSince(timestamp) - .withUntil(timestamp + 1000) - .exec(loggingCallback); + .withStdErr(true) + .withStdOut(true) + .withSince(timestamp) + .withUntil(timestamp + 1000) + .exec(loggingCallback); loggingCallback.awaitCompletion(); @@ -219,8 +221,8 @@ public void simultaneousCommands() throws Exception { // Create a new client to not affect other tests DockerClient client = dockerRule.newClient(); CreateContainerResponse container = client.createContainerCmd("busybox") - .withCmd("/bin/sh", "-c", "echo hello world; sleep infinity") - .exec(); + .withCmd("/bin/sh", "-c", "echo hello world; sleep infinity") + .exec(); client.startContainerCmd(container.getId()).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/PauseCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/PauseCmdIT.java index 3647e713a..4f1a39f1d 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/PauseCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/PauseCmdIT.java @@ -15,7 +15,7 @@ public class PauseCmdIT extends CmdIT { public static final Logger LOG = LoggerFactory.getLogger(PauseCmdIT.class); - + @Test public void pauseRunningContainer() { diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/PullImageCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/PullImageCmdIT.java index 3b8dde3ff..1c6d21d43 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/PullImageCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/PullImageCmdIT.java @@ -64,8 +64,8 @@ public void testPullImage() throws Exception { LOG.info("Pulling image: {}", testImage); dockerRule.getClient().pullImageCmd(testImage) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .start() + .awaitCompletion(30, TimeUnit.SECONDS); info = dockerRule.getClient().infoCmd().exec(); LOG.info("Client info after pull, {}", info.toString()); @@ -80,7 +80,7 @@ public void testPullImage() throws Exception { @Test public void testPullNonExistingImage() throws Exception { if (isNotSwarm(dockerRule.getClient()) && getVersion(dockerRule.getClient()) - .isGreaterOrEqual(RemoteApiVersion.VERSION_1_26)) { + .isGreaterOrEqual(RemoteApiVersion.VERSION_1_26)) { exception.expect(NotFoundException.class); } else { exception.expect(DockerClientException.class); @@ -88,8 +88,8 @@ public void testPullNonExistingImage() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pullImageCmd("xvxcv/foo") - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @Test @@ -100,9 +100,9 @@ public void testPullImageWithValidAuth() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pullImageCmd(imgName) - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @Test @@ -113,9 +113,9 @@ public void testPullImageWithValidAuthAndEmail() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pullImageCmd(imgName) - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @Test @@ -125,7 +125,7 @@ public void testPullImageWithNoAuth() throws Exception { String imgName = REGISTRY.createPrivateImage("pull-image-with-no-auth"); if (isNotSwarm(dockerRule.getClient()) && getVersion(dockerRule.getClient()) - .isGreaterOrEqual(RemoteApiVersion.VERSION_1_30)) { + .isGreaterOrEqual(RemoteApiVersion.VERSION_1_30)) { exception.expect(DockerException.class); } else { exception.expect(DockerClientException.class); @@ -133,8 +133,8 @@ public void testPullImageWithNoAuth() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pullImageCmd(imgName) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @@ -142,15 +142,15 @@ public void testPullImageWithNoAuth() throws Exception { public void testPullImageWithInvalidAuth() throws Exception { AuthConfig authConfig = REGISTRY.getAuthConfig(); AuthConfig invalidAuthConfig = new AuthConfig() - .withUsername("testuser") - .withPassword("testwrongpassword") - .withEmail("foo@bar.de") - .withRegistryAddress(authConfig.getRegistryAddress()); + .withUsername("testuser") + .withPassword("testwrongpassword") + .withEmail("foo@bar.de") + .withRegistryAddress(authConfig.getRegistryAddress()); String imgName = REGISTRY.createPrivateImage("pull-image-with-invalid-auth"); if (isNotSwarm(dockerRule.getClient()) && getVersion(dockerRule.getClient()) - .isGreaterOrEqual(RemoteApiVersion.VERSION_1_30)) { + .isGreaterOrEqual(RemoteApiVersion.VERSION_1_30)) { exception.expect(DockerException.class); } else { exception.expect(DockerClientException.class); @@ -158,8 +158,8 @@ public void testPullImageWithInvalidAuth() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pullImageCmd(imgName) - .withAuthConfig(invalidAuthConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(invalidAuthConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/PushImageCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/PushImageCmdIT.java index 00cd11d51..7bd3ea53e 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/PushImageCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/PushImageCmdIT.java @@ -50,38 +50,38 @@ public void pushLatest() throws Exception { LOG.info("Committing container: {}", container.toString()); String imgName = authConfig.getRegistryAddress() + "/push-latest"; String imageId = dockerRule.getClient().commitCmd(container.getId()) - .withRepository(imgName) - .exec(); + .withRepository(imgName) + .exec(); // we have to block until image is pushed dockerRule.getClient().pushImageCmd(imgName) - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); LOG.info("Removing image: {}", imageId); dockerRule.getClient().removeImageCmd(imageId).exec(); dockerRule.getClient().pullImageCmd(imgName) - .withTag("latest") - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withTag("latest") + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @Test public void pushNonExistentImage() throws Exception { if (isNotSwarm(dockerRule.getClient()) && getVersion(dockerRule.getClient()) - .isGreaterOrEqual(RemoteApiVersion.VERSION_1_24)) { + .isGreaterOrEqual(RemoteApiVersion.VERSION_1_24)) { exception.expect(DockerClientException.class); } else { exception.expect(NotFoundException.class); } dockerRule.getClient().pushImageCmd(UUID.randomUUID().toString().replace("-", "")) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); // exclude infinite await sleep + .start() + .awaitCompletion(30, TimeUnit.SECONDS); // exclude infinite await sleep } @@ -91,9 +91,9 @@ public void testPushImageWithValidAuth() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pushImageCmd(imgName) - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @Test @@ -104,17 +104,17 @@ public void testPushImageWithNoAuth() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pushImageCmd(imgName) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } @Test public void testPushImageWithInvalidAuth() throws Exception { AuthConfig invalidAuthConfig = new AuthConfig() - .withUsername("testuser") - .withPassword("testwrongpassword") - .withEmail("foo@bar.de") - .withRegistryAddress(authConfig.getRegistryAddress()); + .withUsername("testuser") + .withPassword("testwrongpassword") + .withEmail("foo@bar.de") + .withRegistryAddress(authConfig.getRegistryAddress()); String imgName = REGISTRY.createTestImage("push-image-with-invalid-auth"); @@ -122,8 +122,8 @@ public void testPushImageWithInvalidAuth() throws Exception { // stream needs to be fully read in order to close the underlying connection dockerRule.getClient().pushImageCmd(imgName) - .withAuthConfig(invalidAuthConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(invalidAuthConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveContainerCmdImplIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveContainerCmdImplIT.java index 408098148..e8e4c26ae 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveContainerCmdImplIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveContainerCmdImplIT.java @@ -20,7 +20,7 @@ public class RemoveContainerCmdImplIT extends CmdIT { public static final Logger LOG = LoggerFactory.getLogger(RemoveContainerCmdImplIT.class); - + @Test public void removeContainer() { diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveImageCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveImageCmdIT.java index 00d2e6cc1..cbfb5aba2 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveImageCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveImageCmdIT.java @@ -13,8 +13,8 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.emptyString; +import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.startsWith; import static org.testinfected.hamcrest.jpa.HasFieldWithValue.hasField; @@ -22,7 +22,7 @@ public class RemoveImageCmdIT extends CmdIT { public static final Logger LOG = LoggerFactory.getLogger(RemoveImageCmdIT.class); - + @Test public void removeImage() throws DockerException { diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveNetworkCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveNetworkCmdIT.java index 974022c20..10d6741e6 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveNetworkCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveNetworkCmdIT.java @@ -29,8 +29,8 @@ public void removeNetwork() throws DockerException { assumeNotSwarm("Swarm has no network", dockerRule); CreateNetworkResponse network = dockerRule.getClient().createNetworkCmd() - .withName("test-network") - .exec(); + .withName("test-network") + .exec(); LOG.info("Removing network: {}", network.getId()); dockerRule.getClient().removeNetworkCmd(network.getId()).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveVolumeCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveVolumeCmdIT.java index 6d0fdf981..aee055f78 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveVolumeCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/RemoveVolumeCmdIT.java @@ -13,16 +13,16 @@ public class RemoveVolumeCmdIT extends CmdIT { - + @Test(expected = NotFoundException.class) public void removeVolume() throws DockerException { String volumeName = "volume1"; CreateVolumeResponse createVolumeResponse = dockerRule.getClient().createVolumeCmd() - .withName(volumeName) - .withDriver("local") - .withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); + .withName(volumeName) + .withDriver("local") + .withLabels(Collections.singletonMap("is-timelord", "yes")).exec(); assertThat(createVolumeResponse.getName(), equalTo(volumeName)); assertThat(createVolumeResponse.getDriver(), equalTo("local")); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/RenameContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/RenameContainerCmdIT.java index c50ebcf43..ee39f068c 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/RenameContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/RenameContainerCmdIT.java @@ -31,8 +31,8 @@ public void renameContainer() throws DockerException { String name1 = inspectContainerResponse.getName(); dockerRule.getClient().renameContainerCmd(container.getId()) - .withName("renameContainer") - .exec(); + .withName("renameContainer") + .exec(); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); LOG.info("Container Inspect After Rename: {}", inspectContainerResponse2.toString()); @@ -47,7 +47,7 @@ public void renameContainer() throws DockerException { @Test(expected = NotFoundException.class) public void renameExistingContainer() throws DockerException { dockerRule.getClient().renameContainerCmd("non-existing") - .withName("renameExistingContainer") - .exec(); + .withName("renameExistingContainer") + .exec(); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ResizeExecCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ResizeExecCmdIT.java index 9e5c9b65f..72b19b90e 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/ResizeExecCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ResizeExecCmdIT.java @@ -25,7 +25,7 @@ public void resizeExecInstanceTtyTest() throws Exception { String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withUser("root") - .withCmd("sleep", "9999").withName(containerName).exec(); + .withCmd("sleep", "9999").withName(containerName).exec(); dockerRule.getClient().startContainerCmd(container.getId()).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/SaveImagesCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/SaveImagesCmdIT.java index 86b246029..48f063f55 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/SaveImagesCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/SaveImagesCmdIT.java @@ -18,7 +18,7 @@ public void saveNoImages() throws Exception { try ( InputStream inputStream = dockerRule.getClient().saveImagesCmd().exec(); InputStream image = IOUtils.toBufferedInputStream(inputStream) - ){ + ) { assertThat(image.read(), not(-1)); } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/SearchImagesCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/SearchImagesCmdIT.java index 26dcebbeb..c3bf8f197 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/SearchImagesCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/SearchImagesCmdIT.java @@ -11,7 +11,9 @@ import static ch.lambdaj.Lambda.filter; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.is; import static org.testinfected.hamcrest.jpa.HasFieldWithValue.hasField; public class SearchImagesCmdIT extends CmdIT { diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/StartContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/StartContainerCmdIT.java index 5d41889ca..a0d844281 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/StartContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/StartContainerCmdIT.java @@ -31,10 +31,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.startsWith; @@ -52,10 +52,10 @@ public void startContainerWithVolumes() { Volume volume2 = new Volume("/opt/webapp2"); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withVolumes(volume1, volume2) - .withCmd("true") - .withHostConfig(newHostConfig() - .withBinds(new Bind("/tmp/webapp1", volume1, ro), new Bind("/tmp/webapp2", volume2))) - .exec(); + .withCmd("true") + .withHostConfig(newHostConfig() + .withBinds(new Bind("/tmp/webapp1", volume1, ro), new Bind("/tmp/webapp2", volume2))) + .exec(); LOG.info("Created container {}", container.toString()); @@ -78,9 +78,9 @@ public void startContainerWithVolumes() { assertThat(mounts, hasSize(2)); final InspectContainerResponse.Mount mount1 = new InspectContainerResponse.Mount() - .withRw(false).withMode("ro").withDestination(volume1).withSource("/tmp/webapp1"); + .withRw(false).withMode("ro").withDestination(volume1).withSource("/tmp/webapp1"); final InspectContainerResponse.Mount mount2 = new InspectContainerResponse.Mount() - .withRw(true).withMode("rw").withDestination(volume2).withSource("/tmp/webapp2"); + .withRw(true).withMode("rw").withDestination(volume2).withSource("/tmp/webapp2"); assertThat(mounts, containsInAnyOrder(mount1, mount2)); } @@ -94,31 +94,31 @@ public void startContainerWithVolumesFrom() throws DockerException { String container1Name = UUID.randomUUID().toString(); CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(container1Name) - .withHostConfig(newHostConfig() - .withBinds(new Bind("/tmp/webapp1", volume1), new Bind("/tmp/webapp2", volume2))) - .exec(); + .withName(container1Name) + .withHostConfig(newHostConfig() + .withBinds(new Bind("/tmp/webapp1", volume1), new Bind("/tmp/webapp2", volume2))) + .exec(); LOG.info("Created container1 {}", container1.toString()); dockerRule.getClient().startContainerCmd(container1.getId()).exec(); LOG.info("Started container1 {}", container1.toString()); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); assertThat(inspectContainerResponse1, mountedVolumes(containsInAnyOrder(volume1, volume2))); CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withVolumesFrom(new VolumesFrom(container1Name))) - .exec(); + .withHostConfig(newHostConfig() + .withVolumesFrom(new VolumesFrom(container1Name))) + .exec(); LOG.info("Created container2 {}", container2.toString()); dockerRule.getClient().startContainerCmd(container2.getId()).exec(); LOG.info("Started container2 {}", container2.toString()); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); assertThat(inspectContainerResponse2, mountedVolumes(containsInAnyOrder(volume1, volume2))); } @@ -130,9 +130,9 @@ public void startContainerWithDns() throws DockerException { String anotherDnsServer = "8.8.4.4"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true") - .withHostConfig(newHostConfig() - .withDns(aDnsServer, anotherDnsServer)) - .exec(); + .withHostConfig(newHostConfig() + .withDns(aDnsServer, anotherDnsServer)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -143,7 +143,7 @@ public void startContainerWithDns() throws DockerException { InspectContainerResponse inspectContainerResponse = dockerRule.getClient().inspectContainerCmd(container.getId()).exec(); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getDns()), - contains(aDnsServer, anotherDnsServer)); + contains(aDnsServer, anotherDnsServer)); } @Test @@ -152,9 +152,9 @@ public void startContainerWithDnsSearch() throws DockerException { String dnsSearch = "example.com"; CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true") - .withHostConfig(newHostConfig() - .withDnsSearch(dnsSearch)) - .exec(); + .withHostConfig(newHostConfig() + .withDnsSearch(dnsSearch)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -182,9 +182,9 @@ public void startContainerWithPortBindings() throws DockerException { portBindings.bind(tcp23, Binding.bindPort(baseport + 24)); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true") - .withExposedPorts(tcp22, tcp23) - .withHostConfig(newHostConfig() - .withPortBindings(portBindings)).exec(); + .withExposedPorts(tcp22, tcp23) + .withHostConfig(newHostConfig() + .withPortBindings(portBindings)).exec(); LOG.info("Created container {}", container.toString()); @@ -199,13 +199,13 @@ public void startContainerWithPortBindings() throws DockerException { assertThat(Arrays.asList(inspectContainerResponse.getConfig().getExposedPorts()), contains(tcp22, tcp23)); assertThat(inspectContainerResponse.getHostConfig().getPortBindings().getBindings().get(tcp22)[0], - is(equalTo(Binding.bindPort(baseport + 22)))); + is(equalTo(Binding.bindPort(baseport + 22)))); assertThat(inspectContainerResponse.getHostConfig().getPortBindings().getBindings().get(tcp23)[0], - is(equalTo(Binding.bindPort(baseport + 23)))); + is(equalTo(Binding.bindPort(baseport + 23)))); assertThat(inspectContainerResponse.getHostConfig().getPortBindings().getBindings().get(tcp23)[1], - is(equalTo(Binding.bindPort(baseport + 24)))); + is(equalTo(Binding.bindPort(baseport + 24)))); } @@ -220,10 +220,10 @@ public void startContainerWithRandomPortBindings() throws DockerException { portBindings.bind(tcp23, Binding.empty()); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withExposedPorts(tcp22, tcp23).withHostConfig(newHostConfig() - .withPortBindings(portBindings) - .withPublishAllPorts(true)) - .exec(); + .withExposedPorts(tcp22, tcp23).withHostConfig(newHostConfig() + .withPortBindings(portBindings) + .withPublishAllPorts(true)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -236,10 +236,10 @@ public void startContainerWithRandomPortBindings() throws DockerException { assertThat(Arrays.asList(inspectContainerResponse.getConfig().getExposedPorts()), contains(tcp22, tcp23)); assertThat(inspectContainerResponse.getNetworkSettings().getPorts().getBindings().get(tcp22)[0].getHostPortSpec(), - is(not(equalTo(String.valueOf(tcp22.getPort()))))); + is(not(equalTo(String.valueOf(tcp22.getPort()))))); assertThat(inspectContainerResponse.getNetworkSettings().getPorts().getBindings().get(tcp23)[0].getHostPortSpec(), - is(not(equalTo(String.valueOf(tcp23.getPort()))))); + is(not(equalTo(String.valueOf(tcp23.getPort()))))); } @@ -254,9 +254,9 @@ public void startContainerWithConflictingPortBindings() throws DockerException { portBindings.bind(tcp23, Binding.bindPort(11022)); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true") - .withExposedPorts(tcp22, tcp23).withHostConfig(newHostConfig() - .withPortBindings(portBindings)) - .exec(); + .withExposedPorts(tcp22, tcp23).withHostConfig(newHostConfig() + .withPortBindings(portBindings)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -273,9 +273,9 @@ public void startContainerWithLinkingDeprecated() throws DockerException { dockerRule.ensureContainerRemoved(container2Name); CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("sleep", "9999") - .withName(container1Name) - .exec(); + .withCmd("sleep", "9999") + .withName(container1Name) + .exec(); LOG.info("Created container1 {}", container1.toString()); assertThat(container1.getId(), not(is(emptyString()))); @@ -283,7 +283,7 @@ public void startContainerWithLinkingDeprecated() throws DockerException { dockerRule.getClient().startContainerCmd(container1.getId()).exec(); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); LOG.info("Container1 Inspect: {}", inspectContainerResponse1.toString()); assertThat(inspectContainerResponse1.getConfig(), is(notNullValue())); @@ -299,9 +299,9 @@ public void startContainerWithLinkingDeprecated() throws DockerException { } CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(container2Name).withHostConfig(newHostConfig() - .withLinks(new Link(container1Name, container1Name + "Link"))) - .exec(); + .withName(container2Name).withHostConfig(newHostConfig() + .withLinks(new Link(container1Name, container1Name + "Link"))) + .exec(); LOG.info("Created container2 {}", container2.toString()); assertThat(container2.getId(), not(is(emptyString()))); @@ -309,7 +309,7 @@ public void startContainerWithLinkingDeprecated() throws DockerException { dockerRule.getClient().startContainerCmd(container2.getId()).exec(); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); LOG.info("Container2 Inspect: {}", inspectContainerResponse2.toString()); assertThat(inspectContainerResponse2.getConfig(), is(notNullValue())); @@ -317,7 +317,7 @@ public void startContainerWithLinkingDeprecated() throws DockerException { assertThat(inspectContainerResponse2.getHostConfig(), is(notNullValue())); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), is(notNullValue())); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), equalTo(new Link[]{new Link(container1Name, - container1Name + "Link")})); + container1Name + "Link")})); assertThat(inspectContainerResponse2.getId(), startsWith(container2.getId())); assertThat(inspectContainerResponse2.getName(), equalTo("/" + container2Name)); assertThat(inspectContainerResponse2.getImageId(), not(is(emptyString()))); @@ -334,9 +334,9 @@ public void startContainerWithLinking() throws DockerException { dockerRule.ensureContainerRemoved(container2Name); CreateContainerResponse container1 = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("sleep", "9999") - .withName(container1Name) - .exec(); + .withCmd("sleep", "9999") + .withName(container1Name) + .exec(); LOG.info("Created container1 {}", container1.toString()); assertThat(container1.getId(), not(is(emptyString()))); @@ -344,7 +344,7 @@ public void startContainerWithLinking() throws DockerException { dockerRule.getClient().startContainerCmd(container1.getId()).exec(); InspectContainerResponse inspectContainerResponse1 = dockerRule.getClient().inspectContainerCmd(container1.getId()) - .exec(); + .exec(); LOG.info("Container1 Inspect: {}", inspectContainerResponse1.toString()); assertThat(inspectContainerResponse1.getConfig(), is(notNullValue())); @@ -360,9 +360,9 @@ public void startContainerWithLinking() throws DockerException { } CreateContainerResponse container2 = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withName(container2Name).withHostConfig(newHostConfig() - .withLinks(new Link(container1Name, container1Name + "Link"))) - .exec(); + .withName(container2Name).withHostConfig(newHostConfig() + .withLinks(new Link(container1Name, container1Name + "Link"))) + .exec(); LOG.info("Created container2 {}", container2.toString()); assertThat(container2.getId(), not(is(emptyString()))); @@ -370,7 +370,7 @@ public void startContainerWithLinking() throws DockerException { dockerRule.getClient().startContainerCmd(container2.getId()).exec(); InspectContainerResponse inspectContainerResponse2 = dockerRule.getClient().inspectContainerCmd(container2.getId()) - .exec(); + .exec(); LOG.info("Container2 Inspect: {}", inspectContainerResponse2.toString()); assertThat(inspectContainerResponse2.getConfig(), is(notNullValue())); @@ -378,7 +378,7 @@ public void startContainerWithLinking() throws DockerException { assertThat(inspectContainerResponse2.getHostConfig(), is(notNullValue())); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), is(notNullValue())); assertThat(inspectContainerResponse2.getHostConfig().getLinks(), equalTo(new Link[]{new Link(container1Name, - container1Name + "Link")})); + container1Name + "Link")})); assertThat(inspectContainerResponse2.getId(), startsWith(container2.getId())); assertThat(inspectContainerResponse2.getName(), equalTo("/" + container2Name)); assertThat(inspectContainerResponse2.getImageId(), not(is(emptyString()))); @@ -391,7 +391,7 @@ public void startContainerWithLinking() throws DockerException { public void startContainer() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd(new String[]{"top"}) - .exec(); + .exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(is(emptyString()))); @@ -432,9 +432,9 @@ public void testStartNonExistingContainer() throws DockerException { public void startContainerWithNetworkMode() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("true") - .withHostConfig(newHostConfig() - .withNetworkMode("host")) - .exec(); + .withHostConfig(newHostConfig() + .withNetworkMode("host")) + .exec(); LOG.info("Created container {}", container.toString()); @@ -453,11 +453,11 @@ public void startContainerWithNetworkMode() throws DockerException { public void startContainerWithCapAddAndCapDrop() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withCapAdd(NET_ADMIN) - .withCapDrop(MKNOD)) - .exec(); + .withCmd("sleep", "9999") + .withHostConfig(newHostConfig() + .withCapAdd(NET_ADMIN) + .withCapDrop(MKNOD)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -478,10 +478,10 @@ public void startContainerWithCapAddAndCapDrop() throws DockerException { public void startContainerWithDevices() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withDevices(new Device("rwm", "/dev/nulo", "/dev/zero"))) - .exec(); + .withCmd("sleep", "9999") + .withHostConfig(newHostConfig() + .withDevices(new Device("rwm", "/dev/nulo", "/dev/zero"))) + .exec(); LOG.info("Created container {}", container.toString()); @@ -494,16 +494,16 @@ public void startContainerWithDevices() throws DockerException { assertThat(inspectContainerResponse.getState().getRunning(), is(true)); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getDevices()), contains(new Device("rwm", - "/dev/nulo", "/dev/zero"))); + "/dev/nulo", "/dev/zero"))); } @Test public void startContainerWithExtraHosts() throws DockerException { CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withExtraHosts("dockerhost:127.0.0.1")) - .exec(); + .withHostConfig(newHostConfig() + .withExtraHosts("dockerhost:127.0.0.1")) + .exec(); LOG.info("Created container {}", container.toString()); @@ -516,7 +516,7 @@ public void startContainerWithExtraHosts() throws DockerException { assertThat(inspectContainerResponse.getState().getRunning(), is(true)); assertThat(Arrays.asList(inspectContainerResponse.getHostConfig().getExtraHosts()), - contains("dockerhost:127.0.0.1")); + contains("dockerhost:127.0.0.1")); } @Test @@ -525,10 +525,10 @@ public void startContainerWithRestartPolicy() throws DockerException { RestartPolicy restartPolicy = RestartPolicy.onFailureRestart(5); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withCmd("sleep", "9999") - .withHostConfig(newHostConfig() - .withRestartPolicy(restartPolicy)) - .exec(); + .withCmd("sleep", "9999") + .withHostConfig(newHostConfig() + .withRestartPolicy(restartPolicy)) + .exec(); LOG.info("Created container {}", container.toString()); @@ -550,9 +550,9 @@ public void existingHostConfigIsPreservedByBlankStartCmd() throws DockerExceptio // prepare a container with custom DNS CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox") - .withHostConfig(newHostConfig() - .withDns(dnsServer)) - .withCmd("true").exec(); + .withHostConfig(newHostConfig() + .withDns(dnsServer)) + .withCmd("true").exec(); LOG.info("Created container {}", container.toString()); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/StopContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/StopContainerCmdIT.java index 7e88cf088..698515358 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/StopContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/StopContainerCmdIT.java @@ -9,9 +9,9 @@ import org.slf4j.LoggerFactory; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; public class StopContainerCmdIT extends CmdIT { @@ -35,9 +35,9 @@ public void testStopContainer() throws DockerException { assertThat(inspectContainerResponse.getState().getRunning(), is(equalTo(false))); final Integer exitCode = inspectContainerResponse.getState().getExitCode(); - + assertThat(exitCode, is(137)); - + } @Test(expected = NotFoundException.class) diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/UpdateContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/UpdateContainerCmdIT.java index e5bb55499..278686bce 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/UpdateContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/UpdateContainerCmdIT.java @@ -14,9 +14,9 @@ import java.io.IOException; +import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; import static com.github.dockerjava.core.RemoteApiVersion.VERSION_1_22; import static com.github.dockerjava.junit.DockerMatchers.isGreaterOrEqual; -import static com.github.dockerjava.core.DockerRule.DEFAULT_IMAGE; import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -35,8 +35,8 @@ public void updateContainer() throws DockerException { assumeThat("API version should be >= 1.22", dockerRule, isGreaterOrEqual(VERSION_1_22)); CreateContainerResponse response = dockerRule.getClient().createContainerCmd(DEFAULT_IMAGE) - .withCmd("sleep", "9999") - .exec(); + .withCmd("sleep", "9999") + .exec(); String containerId = response.getId(); dockerRule.getClient().startContainerCmd(containerId).exec(); @@ -46,17 +46,17 @@ public void updateContainer() throws DockerException { final Long memory = inspectBefore.getHostConfig().getMemory(); dockerRule.getClient().updateContainerCmd(containerId) - .withBlkioWeight(300) - .withCpuShares(512) - .withCpuPeriod(100000) - .withCpuQuota(50000) + .withBlkioWeight(300) + .withCpuShares(512) + .withCpuPeriod(100000) + .withCpuQuota(50000) // .withCpusetCpus("0") // depends on env - .withCpusetMems("0") + .withCpusetMems("0") // .withMemory(209715200L + 2L) // .withMemorySwap(514288000L) Your kernel does not support swap limit capabilities, memory limited without swap. // .withMemoryReservation(209715200L) // .withKernelMemory(52428800) Can not update kernel memory to a running container, please stop it first. - .exec(); + .exec(); // true only on docker toolbox (1.10.1) // assertThat(updateResponse.getWarnings(), hasSize(1)); @@ -85,8 +85,8 @@ public void serDerDocs1() throws IOException { final JavaType type = JSONTestHelper.getMapper().getTypeFactory().constructType(UpdateContainerCmdImpl.class); final UpdateContainerCmdImpl upd = testRoundTrip(VERSION_1_22, - "/containers/container/update/docs.json", - type + "/containers/container/update/docs.json", + type ); assertThat(upd, notNullValue()); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/VersionCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/VersionCmdIT.java index 90c7e534e..855ca4af6 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/VersionCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/VersionCmdIT.java @@ -13,7 +13,7 @@ public class VersionCmdIT extends CmdIT { public static final Logger LOG = LoggerFactory.getLogger(VersionCmdIT.class); - + @Test public void version() throws DockerException { Version version = dockerRule.getClient().versionCmd().exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/WaitContainerCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/WaitContainerCmdIT.java index e2ad2a643..17467a114 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/WaitContainerCmdIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/WaitContainerCmdIT.java @@ -16,9 +16,9 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.emptyString; import static org.hamcrest.Matchers.not; public class WaitContainerCmdIT extends CmdIT { @@ -35,7 +35,7 @@ public void testWaitContainer() throws DockerException { dockerRule.getClient().startContainerCmd(container.getId()).exec(); int exitCode = dockerRule.getClient().waitContainerCmd(container.getId()).start() - .awaitStatusCode(); + .awaitStatusCode(); LOG.info("Container exit code: {}", exitCode); assertThat(exitCode, equalTo(0)); @@ -94,7 +94,7 @@ public void testWaitContainerTimeout() { dockerRule.getClient().startContainerCmd(container.getId()).exec(); WaitContainerResultCallback callback = dockerRule.getClient().waitContainerCmd(container.getId()).exec( - new WaitContainerResultCallback()); + new WaitContainerResultCallback()); try { callback.awaitStatusCode(100, TimeUnit.MILLISECONDS); throw new AssertionError("Should throw exception on timeout."); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateSecretCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateSecretCmdExecIT.java index 4644a8330..db634a3cf 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateSecretCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateSecretCmdExecIT.java @@ -34,17 +34,17 @@ public void testCreateSecret() { List secrets = dockerClient.listSecretsCmd() - .withNameFilter(Lists.newArrayList(secretName)) - .exec(); + .withNameFilter(Lists.newArrayList(secretName)) + .exec(); assertThat(secrets, IsCollectionWithSize.hasSize(1)); dockerClient.removeSecretCmd(secrets.get(0).getId()) - .exec(); + .exec(); LOG.info("Secret removed with ID {}", exec.getId()); List secretsAfterRemoved = dockerClient.listSecretsCmd() - .withNameFilter(Lists.newArrayList(secretName)) - .exec(); + .withNameFilter(Lists.newArrayList(secretName)) + .exec(); assertThat(secretsAfterRemoved, IsCollectionWithSize.hasSize(0)); } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateServiceCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateServiceCmdExecIT.java index e221d9cd3..768e20482 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateServiceCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/CreateServiceCmdExecIT.java @@ -63,13 +63,13 @@ public void testCreateService() throws DockerException { dockerClient.createServiceCmd(new ServiceSpec() .withName(SERVICE_NAME) .withTaskTemplate(new TaskSpec() - .withContainerSpec(new ContainerSpec() - .withImage(DEFAULT_IMAGE)))) - .exec(); + .withContainerSpec(new ContainerSpec() + .withImage(DEFAULT_IMAGE)))) + .exec(); List services = dockerClient.listServicesCmd() - .withNameFilter(Lists.newArrayList(SERVICE_NAME)) - .exec(); + .withNameFilter(Lists.newArrayList(SERVICE_NAME)) + .exec(); assertThat(services, hasSize(1)); @@ -79,40 +79,40 @@ public void testCreateService() throws DockerException { @Test public void testCreateServiceWithNetworks() { String networkId = dockerClient.createNetworkCmd().withName("networkname") - .withDriver("overlay") - .withIpam(new Network.Ipam() - .withDriver("default")) - .exec().getId(); + .withDriver("overlay") + .withIpam(new Network.Ipam() + .withDriver("default")) + .exec().getId(); ServiceSpec spec = new ServiceSpec() - .withName(SERVICE_NAME) - .withTaskTemplate(new TaskSpec() - .withForceUpdate(0) - .withRuntime("container") - .withContainerSpec(new ContainerSpec() - .withImage("busybox")) - ) - .withNetworks(Lists.newArrayList( - new NetworkAttachmentConfig() - .withTarget(networkId) - .withAliases(Lists.newArrayList("alias1", "alias2")) - )) - .withLabels(ImmutableMap.of("com.docker.java.usage", "SwarmServiceIT")) - .withMode(new ServiceModeConfig().withReplicated( - new ServiceReplicatedModeOptions() - .withReplicas(1) - )).withEndpointSpec(new EndpointSpec() - .withMode(EndpointResolutionMode.VIP) - .withPorts(Lists.newArrayList(new PortConfig() - .withPublishMode(PortConfig.PublishMode.host) - .withPublishedPort(22) - .withProtocol(PortConfigProtocol.TCP) - ))); + .withName(SERVICE_NAME) + .withTaskTemplate(new TaskSpec() + .withForceUpdate(0) + .withRuntime("container") + .withContainerSpec(new ContainerSpec() + .withImage("busybox")) + ) + .withNetworks(Lists.newArrayList( + new NetworkAttachmentConfig() + .withTarget(networkId) + .withAliases(Lists.newArrayList("alias1", "alias2")) + )) + .withLabels(ImmutableMap.of("com.docker.java.usage", "SwarmServiceIT")) + .withMode(new ServiceModeConfig().withReplicated( + new ServiceReplicatedModeOptions() + .withReplicas(1) + )).withEndpointSpec(new EndpointSpec() + .withMode(EndpointResolutionMode.VIP) + .withPorts(Lists.newArrayList(new PortConfig() + .withPublishMode(PortConfig.PublishMode.host) + .withPublishedPort(22) + .withProtocol(PortConfigProtocol.TCP) + ))); dockerClient.createServiceCmd(spec).exec(); List services = dockerClient.listServicesCmd() - .withNameFilter(Lists.newArrayList(SERVICE_NAME)) - .exec(); + .withNameFilter(Lists.newArrayList(SERVICE_NAME)) + .exec(); assertThat(services, hasSize(1)); @@ -128,16 +128,16 @@ public void testCreateServiceWithTmpfs() { dockerClient.createServiceCmd(new ServiceSpec() .withName(SERVICE_NAME) .withTaskTemplate(new TaskSpec() - .withContainerSpec(new ContainerSpec().withImage(DEFAULT_IMAGE).withMounts(Collections.singletonList(tmpMount))))) - .exec(); + .withContainerSpec(new ContainerSpec().withImage(DEFAULT_IMAGE).withMounts(Collections.singletonList(tmpMount))))) + .exec(); List services = dockerClient.listServicesCmd() - .withNameFilter(Lists.newArrayList(SERVICE_NAME)) - .exec(); + .withNameFilter(Lists.newArrayList(SERVICE_NAME)) + .exec(); assertThat(services, hasSize(1)); List mounts = dockerClient.inspectServiceCmd(SERVICE_NAME).exec().getSpec().getTaskTemplate() - .getContainerSpec().getMounts(); + .getContainerSpec().getMounts(); assertThat(mounts, hasSize(1)); assertThat(mounts.get(0), is(tmpMount)); dockerClient.removeServiceCmd(SERVICE_NAME).exec(); @@ -148,14 +148,14 @@ public void testCreateServiceWithValidAuth() throws DockerException { dockerClient.createServiceCmd(new ServiceSpec() .withName(SERVICE_NAME) .withTaskTemplate(new TaskSpec() - .withContainerSpec(new ContainerSpec() - .withImage(DEFAULT_IMAGE)))) - .withAuthConfig(authConfig) - .exec(); + .withContainerSpec(new ContainerSpec() + .withImage(DEFAULT_IMAGE)))) + .withAuthConfig(authConfig) + .exec(); List services = dockerClient.listServicesCmd() - .withNameFilter(Lists.newArrayList(SERVICE_NAME)) - .exec(); + .withNameFilter(Lists.newArrayList(SERVICE_NAME)) + .exec(); assertThat(services, hasSize(1)); @@ -166,19 +166,19 @@ public void testCreateServiceWithValidAuth() throws DockerException { @Ignore // TODO rework test (does not throw as expected atm) public void testCreateServiceWithInvalidAuth() throws DockerException { AuthConfig invalidAuthConfig = new AuthConfig() - .withUsername("testuser") - .withPassword("testwrongpassword") - .withEmail("foo@bar.de") - .withRegistryAddress(authConfig.getRegistryAddress()); + .withUsername("testuser") + .withPassword("testwrongpassword") + .withEmail("foo@bar.de") + .withRegistryAddress(authConfig.getRegistryAddress()); exception.expect(ConflictException.class); dockerClient.createServiceCmd(new ServiceSpec() .withName(SERVICE_NAME) .withTaskTemplate(new TaskSpec() - .withContainerSpec(new ContainerSpec() - .withImage(DEFAULT_IMAGE)))) - .withAuthConfig(invalidAuthConfig) - .exec(); + .withContainerSpec(new ContainerSpec() + .withImage(DEFAULT_IMAGE)))) + .withAuthConfig(invalidAuthConfig) + .exec(); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/InitializeSwarmCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/InitializeSwarmCmdExecIT.java index 6341f4b30..e4e4513d1 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/InitializeSwarmCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/InitializeSwarmCmdExecIT.java @@ -25,24 +25,24 @@ public class InitializeSwarmCmdExecIT extends SwarmCmdIT { public void initializeSwarm() throws Exception { DockerClient dockerClient = startDockerInDocker(); SwarmSpec swarmSpec = new SwarmSpec() - .withName("default") - .withDispatcher(new SwarmDispatcherConfig() - .withHeartbeatPeriod(10000000L) - ).withOrchestration(new SwarmOrchestration() - .withTaskHistoryRententionLimit(100) - ).withCaConfig(new SwarmCAConfig() - .withNodeCertExpiry(60 * 60 * 1000000000L /*ns */)) - .withRaft(new SwarmRaftConfig() - .withElectionTick(8) - .withSnapshotInterval(20000) - .withHeartbeatTick(5) - .withLogEntriesForSlowFollowers(200) - ).withTaskDefaults(new TaskDefaults()); + .withName("default") + .withDispatcher(new SwarmDispatcherConfig() + .withHeartbeatPeriod(10000000L) + ).withOrchestration(new SwarmOrchestration() + .withTaskHistoryRententionLimit(100) + ).withCaConfig(new SwarmCAConfig() + .withNodeCertExpiry(60 * 60 * 1000000000L /*ns */)) + .withRaft(new SwarmRaftConfig() + .withElectionTick(8) + .withSnapshotInterval(20000) + .withHeartbeatTick(5) + .withLogEntriesForSlowFollowers(200) + ).withTaskDefaults(new TaskDefaults()); dockerClient.initializeSwarmCmd(swarmSpec) - .withListenAddr("127.0.0.1") - .withAdvertiseAddr("127.0.0.1") - .exec(); + .withListenAddr("127.0.0.1") + .withAdvertiseAddr("127.0.0.1") + .exec(); LOG.info("Initialized swarm: {}", swarmSpec.toString()); Swarm swarm = dockerClient.inspectSwarmCmd().exec(); @@ -56,8 +56,8 @@ public void initializingSwarmThrowsWhenAlreadyInSwarm() throws DockerException { // Initializing a swarm if already in swarm mode should fail dockerClient.initializeSwarmCmd(new SwarmSpec()) - .withListenAddr("127.0.0.1") - .exec(); + .withListenAddr("127.0.0.1") + .exec(); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/JoinSwarmCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/JoinSwarmCmdExecIT.java index 16f1b0911..5e82fbed9 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/JoinSwarmCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/JoinSwarmCmdExecIT.java @@ -34,7 +34,7 @@ public void setUp() throws Exception { private SwarmJoinTokens initSwarmOnDocker(DockerClient docker) { SwarmSpec swarmSpec = new SwarmSpec(); docker.initializeSwarmCmd(swarmSpec) - .exec(); + .exec(); LOG.info("Initialized swarm docker1: {}", swarmSpec.toString()); Swarm swarm = docker.inspectSwarmCmd().exec(); @@ -47,9 +47,9 @@ public void joinSwarmAsWorker() { SwarmJoinTokens tokens = initSwarmOnDocker(docker1); docker2.joinSwarmCmd() - .withRemoteAddrs(Lists.newArrayList("docker1")) - .withJoinToken(tokens.getWorker()) - .exec(); + .withRemoteAddrs(Lists.newArrayList("docker1")) + .withJoinToken(tokens.getWorker()) + .exec(); LOG.info("docker2 joined docker1's swarm"); Info info = docker2.infoCmd().exec(); @@ -62,9 +62,9 @@ public void joinSwarmAsManager() throws DockerException { SwarmJoinTokens tokens = initSwarmOnDocker(docker1); docker2.joinSwarmCmd() - .withRemoteAddrs(Lists.newArrayList("docker1")) - .withJoinToken(tokens.getManager()) - .exec(); + .withRemoteAddrs(Lists.newArrayList("docker1")) + .withJoinToken(tokens.getManager()) + .exec(); LOG.info("docker2 joined docker1's swarm"); Info info = docker2.infoCmd().exec(); @@ -79,8 +79,8 @@ public void joinSwarmIfAlreadyInSwarm() { initSwarmOnDocker(docker2); docker2.joinSwarmCmd() - .withRemoteAddrs(Lists.newArrayList("docker1")) - .withJoinToken(tokens.getWorker()) - .exec(); + .withRemoteAddrs(Lists.newArrayList("docker1")) + .withJoinToken(tokens.getWorker()) + .exec(); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LeaveSwarmCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LeaveSwarmCmdExecIT.java index e6d652d43..5d72f1983 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LeaveSwarmCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LeaveSwarmCmdExecIT.java @@ -25,8 +25,8 @@ public void leaveSwarmAsMaster() throws DockerException { assertThat(info.getSwarm().getLocalNodeState(), is(LocalNodeState.ACTIVE)); dockerClient.leaveSwarmCmd() - .withForceEnabled(true) - .exec(); + .withForceEnabled(true) + .exec(); LOG.info("Left swarm"); info = dockerClient.infoCmd().exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListSecretCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListSecretCmdExecIT.java index ce90f23a0..111366521 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListSecretCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListSecretCmdExecIT.java @@ -35,17 +35,17 @@ public void tesListSecret() throws DockerException { List secrets = dockerClient.listSecretsCmd() - .withNameFilter(Lists.newArrayList(secretName)) - .exec(); + .withNameFilter(Lists.newArrayList(secretName)) + .exec(); assertThat(secrets, hasSize(1)); dockerClient.removeSecretCmd(secrets.get(0).getId()) - .exec(); + .exec(); LOG.info("Secret removed with ID {}", exec.getId()); List secretsAfterRemoved = dockerClient.listSecretsCmd() - .withNameFilter(Lists.newArrayList(secretName)) - .exec(); + .withNameFilter(Lists.newArrayList(secretName)) + .exec(); assertThat(secretsAfterRemoved, hasSize(0)); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListServicesCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListServicesCmdExecIT.java index 715ba60c8..0b2c909d8 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListServicesCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListServicesCmdExecIT.java @@ -34,13 +34,13 @@ public void testListServices() { .withLabels(serviceLabels) .withName(SERVICE_NAME) .withMode(new ServiceModeConfig().withReplicated( - new ServiceReplicatedModeOptions() - .withReplicas(1) + new ServiceReplicatedModeOptions() + .withReplicas(1) )) .withTaskTemplate(new TaskSpec() - .withContainerSpec(new ContainerSpec() - .withImage(DEFAULT_IMAGE)))) - .exec(); + .withContainerSpec(new ContainerSpec() + .withImage(DEFAULT_IMAGE)))) + .exec(); String serviceId = response.getId(); //filtering with service id List services = dockerClient.listServicesCmd().withIdFilter(Collections.singletonList(serviceId)).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListTasksCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListTasksCmdExecIT.java index 8ce672b1b..243c78ce9 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListTasksCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/ListTasksCmdExecIT.java @@ -38,13 +38,13 @@ public void testListTasks() throws DockerException { CreateServiceResponse response = dockerClient.createServiceCmd(new ServiceSpec() .withName(SERVICE_NAME) .withMode(new ServiceModeConfig().withReplicated( - new ServiceReplicatedModeOptions() - .withReplicas(2) + new ServiceReplicatedModeOptions() + .withReplicas(2) )) .withTaskTemplate(new TaskSpec() - .withContainerSpec(new ContainerSpec() - .withImage(DEFAULT_IMAGE))).withLabels(taskLabels)) - .exec(); + .withContainerSpec(new ContainerSpec() + .withImage(DEFAULT_IMAGE))).withLabels(taskLabels)) + .exec(); String serviceId = response.getId(); //filtering with service id List tasks = await().until( diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LogSwarmObjectIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LogSwarmObjectIT.java index 11606dce0..0b7e55635 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LogSwarmObjectIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/LogSwarmObjectIT.java @@ -34,11 +34,11 @@ public void testLogsCmd() throws InterruptedException, IOException { String snippet = "hello world"; TaskSpec taskSpec = new TaskSpec().withContainerSpec( new ContainerSpec().withImage("busybox").withCommand(Arrays.asList("echo", snippet))) - .withRestartPolicy(new ServiceRestartPolicy().withCondition(ServiceRestartCondition.NONE)); + .withRestartPolicy(new ServiceRestartPolicy().withCondition(ServiceRestartCondition.NONE)); ServiceSpec serviceSpec = new ServiceSpec() - .withMode(new ServiceModeConfig().withReplicated(new ServiceReplicatedModeOptions().withReplicas(1))) - .withTaskTemplate(taskSpec) - .withName("log-worker"); + .withMode(new ServiceModeConfig().withReplicated(new ServiceReplicatedModeOptions().withReplicas(1))) + .withTaskTemplate(taskSpec) + .withName("log-worker"); String serviceId = dockerClient.createServiceCmd(serviceSpec).exec().getId(); int since = (int) System.currentTimeMillis() / 1000; //wait the service to end diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/RemoveSwarmNodeCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/RemoveSwarmNodeCmdExecIT.java index 8bdee6947..1106e26d2 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/RemoveSwarmNodeCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/RemoveSwarmNodeCmdExecIT.java @@ -26,18 +26,18 @@ public void testRemoveSwarmNode() throws Exception { DockerClient docker2 = startDockerInDocker(); docker2.joinSwarmCmd() - .withRemoteAddrs(Lists.newArrayList("docker1")) - .withJoinToken(swarm.getJoinTokens().getWorker()) - .exec(); + .withRemoteAddrs(Lists.newArrayList("docker1")) + .withJoinToken(swarm.getJoinTokens().getWorker()) + .exec(); LOGGER.info("docker2 joined docker's swarm"); List nodes = dockerClient.listSwarmNodesCmd().exec(); assertThat(2, is(nodes.size())); Optional firstWorkNode = nodes.stream().filter(node -> node.getSpec().getRole() == SwarmNodeRole.WORKER) - .findFirst(); + .findFirst(); dockerClient.removeSwarmNodeCmd(firstWorkNode.get().getId()) - .withForce(true) - .exec(); + .withForce(true) + .exec(); nodes = dockerClient.listSwarmNodesCmd().exec(); assertThat(nodes.size(), is(1)); } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmCmdExecIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmCmdExecIT.java index ea3818836..a2d0dbe88 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmCmdExecIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmCmdExecIT.java @@ -27,27 +27,27 @@ public void updateSwarm() throws DockerException { DockerClient dockerClient = startSwarm(); SwarmSpec newSpec = new SwarmSpec() - .withName("default") - .withDispatcher(new SwarmDispatcherConfig() - .withHeartbeatPeriod(10000000L) - ).withOrchestration(new SwarmOrchestration() - .withTaskHistoryRententionLimit(100) - ).withCaConfig(new SwarmCAConfig() - .withNodeCertExpiry(60 * 60 * 1000000000L /*ns */)) - .withRaft(new SwarmRaftConfig() - .withElectionTick(8) - .withSnapshotInterval(20000) - .withHeartbeatTick(5) - .withLogEntriesForSlowFollowers(200) - ).withTaskDefaults(new TaskDefaults()); + .withName("default") + .withDispatcher(new SwarmDispatcherConfig() + .withHeartbeatPeriod(10000000L) + ).withOrchestration(new SwarmOrchestration() + .withTaskHistoryRententionLimit(100) + ).withCaConfig(new SwarmCAConfig() + .withNodeCertExpiry(60 * 60 * 1000000000L /*ns */)) + .withRaft(new SwarmRaftConfig() + .withElectionTick(8) + .withSnapshotInterval(20000) + .withHeartbeatTick(5) + .withLogEntriesForSlowFollowers(200) + ).withTaskDefaults(new TaskDefaults()); Swarm swarm = dockerClient.inspectSwarmCmd().exec(); LOG.info("Inspected swarm: {}", swarm.toString()); assertThat(swarm.getSpec(), is(not(equalTo(newSpec)))); dockerClient.updateSwarmCmd(newSpec) - .withVersion(swarm.getVersion().getIndex()) - .exec(); + .withVersion(swarm.getVersion().getIndex()) + .exec(); LOG.info("Updated swarm: {}", newSpec.toString()); swarm = dockerClient.inspectSwarmCmd().exec(); @@ -59,8 +59,8 @@ public void updateSwarm() throws DockerException { public void updatingSwarmThrowsWhenNotInSwarm() throws Exception { DockerClient dockerClient = startDockerInDocker(); dockerClient.updateSwarmCmd(new SwarmSpec()) - .withVersion(1L) - .exec(); + .withVersion(1L) + .exec(); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmNodeIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmNodeIT.java index d26e051b1..7a58d540e 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmNodeIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmNodeIT.java @@ -23,7 +23,7 @@ public void testUpdateSwarmNode() { //update the node availability SwarmNodeSpec nodeSpec = node.getSpec().withAvailability(SwarmNodeAvailability.PAUSE); dockerClient.updateSwarmNodeCmd().withSwarmNodeId(node.getId()).withVersion(node.getVersion().getIndex()) - .withSwarmNodeSpec(nodeSpec).exec(); + .withSwarmNodeSpec(nodeSpec).exec(); nodes = dockerClient.listSwarmNodesCmd().exec(); assertThat(nodes.size(), is(1)); assertThat(nodes.get(0).getSpec().getAvailability(), is(SwarmNodeAvailability.PAUSE)); diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmServiceIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmServiceIT.java index c477320bf..de5285931 100644 --- a/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmServiceIT.java +++ b/docker-java/src/test/java/com/github/dockerjava/cmd/swarm/UpdateSwarmServiceIT.java @@ -25,14 +25,14 @@ public void testUpdateServiceReplicate() { DockerClient dockerClient = startSwarm(); //create network String networkId = dockerClient.createNetworkCmd().withName("networkname").withDriver("overlay") - .withIpam(new Network.Ipam().withDriver("default")).exec().getId(); + .withIpam(new Network.Ipam().withDriver("default")).exec().getId(); TaskSpec taskSpec = new TaskSpec().withContainerSpec( - new ContainerSpec().withImage("busybox").withArgs(Arrays.asList("sleep", "3600")).withInit(true)); + new ContainerSpec().withImage("busybox").withArgs(Arrays.asList("sleep", "3600")).withInit(true)); ServiceSpec serviceSpec = new ServiceSpec() - .withMode(new ServiceModeConfig().withReplicated(new ServiceReplicatedModeOptions().withReplicas(1))) - .withTaskTemplate(taskSpec) - .withNetworks(Lists.newArrayList(new NetworkAttachmentConfig().withTarget(networkId))) - .withName("worker"); + .withMode(new ServiceModeConfig().withReplicated(new ServiceReplicatedModeOptions().withReplicas(1))) + .withTaskTemplate(taskSpec) + .withNetworks(Lists.newArrayList(new NetworkAttachmentConfig().withTarget(networkId))) + .withName("worker"); String serviceId = dockerClient.createServiceCmd(serviceSpec).exec().getId(); await().untilAsserted(() -> { List services = dockerClient.listServicesCmd().withIdFilter(Arrays.asList(serviceId)).exec(); diff --git a/docker-java/src/test/java/com/github/dockerjava/core/DefaultDockerClientConfigTest.java b/docker-java/src/test/java/com/github/dockerjava/core/DefaultDockerClientConfigTest.java index 6c7787caf..cd40913a2 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/DefaultDockerClientConfigTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/DefaultDockerClientConfigTest.java @@ -3,11 +3,11 @@ import com.github.dockerjava.api.model.AuthConfig; import com.github.dockerjava.api.model.AuthConfigurations; import com.google.common.io.Resources; -import java.io.IOException; import org.apache.commons.lang3.SerializationUtils; import org.junit.Test; import java.io.File; +import java.io.IOException; import java.lang.reflect.Field; import java.net.URI; import java.net.URISyntaxException; @@ -129,7 +129,7 @@ public void dockerContextWithDockerHostAndTLS() { assertEquals(URI.create("tcp://remote:2376"), config.getDockerHost()); assertTrue("SSL config is set", config.getSSLConfig() instanceof LocalDirectorySSLConfig); - assertTrue("SSL directory is set", ((LocalDirectorySSLConfig)config.getSSLConfig()).getDockerCertPath().endsWith("dockerContextHomeDir/.docker/contexts/tls/b71199ebd070b36beab7317920c2c2f1d777df8d05e5527d8458fda57cb17a7a/docker")); + assertTrue("SSL directory is set", ((LocalDirectorySSLConfig) config.getSSLConfig()).getDockerCertPath().endsWith("dockerContextHomeDir/.docker/contexts/tls/b71199ebd070b36beab7317920c2c2f1d777df8d05e5527d8458fda57cb17a7a/docker")); } @Test @@ -180,7 +180,7 @@ public void defaults() { systemProperties.setProperty("user.home", homeDir()); // when you build config - DefaultDockerClientConfig config = buildConfig(Collections. emptyMap(), systemProperties); + DefaultDockerClientConfig config = buildConfig(Collections.emptyMap(), systemProperties); // then the cert path is as expected assertEquals(URI.create("unix:///var/run/docker.sock"), config.getDockerHost()); @@ -207,7 +207,7 @@ public void systemProperties() { systemProperties.put(DefaultDockerClientConfig.DOCKER_TLS_VERIFY, "1"); // when you build new config - DefaultDockerClientConfig config = buildConfig(Collections. emptyMap(), systemProperties); + DefaultDockerClientConfig config = buildConfig(Collections.emptyMap(), systemProperties); // then it is the same as the example assertEquals(EXAMPLE_CONFIG_FULLY_LOADED, config); @@ -225,15 +225,14 @@ public void serializableTest() { @Test() public void testSslContextEmpty() { new DefaultDockerClientConfig(URI.create("tcp://foo"), new DockerConfigFile(), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail", - null); + null); } - @Test() public void testTlsVerifyAndCertPath() { new DefaultDockerClientConfig(URI.create("tcp://foo"), new DockerConfigFile(), "dockerConfig", "apiVersion", "registryUrl", "registryUsername", "registryPassword", "registryEmail", - new LocalDirectorySSLConfig(dockerCertPath())); + new LocalDirectorySSLConfig(dockerCertPath())); } @Test() @@ -285,7 +284,7 @@ public void dockerHostSetExplicitlyOnSystemProperty() { Properties systemProperties = new Properties(); systemProperties.put(DefaultDockerClientConfig.DOCKER_HOST, "tcp://foo"); - DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder(Collections.emptyMap(), systemProperties); + DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder(Collections.emptyMap(), systemProperties); assertThat(builder.isDockerHostSetExplicitly(), is(true)); } @@ -295,7 +294,7 @@ public void dockerHostSetExplicitlyOnEnv() { Map env = new HashMap<>(); env.put(DefaultDockerClientConfig.DOCKER_HOST, "tcp://foo"); - DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder(env, new Properties()); + DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder(env, new Properties()); assertThat(builder.isDockerHostSetExplicitly(), is(true)); } @@ -305,7 +304,7 @@ public void dockerHostSetExplicitlyIfSetToDefaultByUser() { Map env = new HashMap<>(); env.put(DefaultDockerClientConfig.DOCKER_HOST, DefaultDockerClientConfig.DEFAULT_DOCKER_HOST); - DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder(env, new Properties()); + DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder(env, new Properties()); assertThat(builder.isDockerHostSetExplicitly(), is(true)); } diff --git a/docker-java/src/test/java/com/github/dockerjava/core/DockerConfigFileTest.java b/docker-java/src/test/java/com/github/dockerjava/core/DockerConfigFileTest.java index 76211fc55..465ffffb1 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/DockerConfigFileTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/DockerConfigFileTest.java @@ -12,8 +12,8 @@ import java.io.File; import java.io.IOException; -import static org.hamcrest.core.Is.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; public class DockerConfigFileTest { @Rule @@ -72,16 +72,16 @@ public void invalidLegacyEmailLine() throws IOException { @Test public void validLegacyJson() throws IOException { AuthConfig authConfig1 = new AuthConfig() - .withEmail("foo@example.com") - .withUsername("foo") - .withPassword("bar") - .withRegistryAddress("quay.io"); + .withEmail("foo@example.com") + .withUsername("foo") + .withPassword("bar") + .withRegistryAddress("quay.io"); AuthConfig authConfig2 = new AuthConfig() - .withEmail("moo@example.com") - .withUsername("foo1") - .withPassword("bar1") - .withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS); + .withEmail("moo@example.com") + .withUsername("foo1") + .withPassword("bar1") + .withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS); DockerConfigFile expected = new DockerConfigFile(); expected.addAuthConfig(authConfig1); @@ -93,13 +93,13 @@ public void validLegacyJson() throws IOException { @Test public void validJsonWithUnknown() throws IOException { AuthConfig authConfig1 = new AuthConfig() - .withRegistryAddress("192.168.99.100:32768"); + .withRegistryAddress("192.168.99.100:32768"); AuthConfig authConfig2 = new AuthConfig() - .withEmail("foo@example.com") - .withUsername("foo") - .withPassword("bar") - .withRegistryAddress("https://index.docker.io/v1/"); + .withEmail("foo@example.com") + .withUsername("foo") + .withPassword("bar") + .withRegistryAddress("https://index.docker.io/v1/"); DockerConfigFile expected = new DockerConfigFile(); expected.addAuthConfig(authConfig1); @@ -118,10 +118,10 @@ public void validJsonWithOnlyUnknown() throws IOException { @Test public void validLegacy() throws IOException { AuthConfig authConfig = new AuthConfig() - .withEmail("foo@example.com") - .withUsername("foo") - .withPassword("bar") - .withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS); + .withEmail("foo@example.com") + .withUsername("foo") + .withPassword("bar") + .withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS); DockerConfigFile expected = new DockerConfigFile(); expected.addAuthConfig(authConfig); @@ -132,16 +132,16 @@ public void validLegacy() throws IOException { @Test public void validDockerConfig() throws IOException { AuthConfig authConfig1 = new AuthConfig() - .withEmail("foo@example.com") - .withUsername("foo") - .withPassword("bar") - .withRegistryAddress("quay.io"); + .withEmail("foo@example.com") + .withUsername("foo") + .withPassword("bar") + .withRegistryAddress("quay.io"); AuthConfig authConfig2 = new AuthConfig() - .withEmail("moo@example.com") - .withUsername("foo1") - .withPassword("bar1") - .withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS); + .withEmail("moo@example.com") + .withUsername("foo1") + .withPassword("bar1") + .withRegistryAddress(AuthConfig.DEFAULT_SERVER_ADDRESS); DockerConfigFile expected = new DockerConfigFile(); expected.addAuthConfig(authConfig1); diff --git a/docker-java/src/test/java/com/github/dockerjava/core/DockerRule.java b/docker-java/src/test/java/com/github/dockerjava/core/DockerRule.java index 3fc5c40d7..4b59adbbe 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/DockerRule.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/DockerRule.java @@ -112,9 +112,9 @@ protected void before() throws Throwable { LOG.info("Pulling image 'busybox'"); // need to block until image is pulled completely getClient().pullImageCmd("busybox") - .withTag("latest") - .start() - .awaitCompletion(); + .withTag("latest") + .start() + .awaitCompletion(); } // assertThat(getClient(), notNullValue()); @@ -127,9 +127,9 @@ protected void after() { createdContainerIds.parallelStream().forEach(containerId -> { try { dockerClient.removeContainerCmd(containerId) - .withForce(true) - .withRemoveVolumes(true) - .exec(); + .withForce(true) + .withRemoveVolumes(true) + .exec(); } catch (ConflictException | NotFoundException ignored) { } catch (Throwable e) { if (e instanceof InterruptedException) { @@ -174,8 +174,8 @@ private static DefaultDockerClientConfig config() { public static DefaultDockerClientConfig config(String password) { DefaultDockerClientConfig.Builder builder = DefaultDockerClientConfig.createDefaultConfigBuilder() - .withApiVersion(RemoteApiVersion.VERSION_1_30) - .withRegistryUrl("https://index.docker.io/v1/"); + .withApiVersion(RemoteApiVersion.VERSION_1_30) + .withRegistryUrl("https://index.docker.io/v1/"); if (password != null) { builder = builder.withRegistryPassword(password); } @@ -185,25 +185,25 @@ public static DefaultDockerClientConfig config(String password) { public String buildImage(File baseDir) throws Exception { return getClient().buildImageCmd(baseDir) - .withNoCache(true) - .start() - .awaitImageId(); + .withNoCache(true) + .start() + .awaitImageId(); } public String containerLog(String containerId) throws Exception { return getClient().logContainerCmd(containerId) - .withStdOut(true) - .exec(new LogContainerTestCallback()) - .awaitCompletion() - .toString(); + .withStdOut(true) + .exec(new LogContainerTestCallback()) + .awaitCompletion() + .toString(); } public void ensureContainerRemoved(String container1Name) { try { getClient().removeContainerCmd(container1Name) - .withForce(true) - .withRemoveVolumes(true) - .exec(); + .withForce(true) + .withRemoveVolumes(true) + .exec(); } catch (NotFoundException ex) { // ignore } diff --git a/docker-java/src/test/java/com/github/dockerjava/core/GoLangFileMatchTest.java b/docker-java/src/test/java/com/github/dockerjava/core/GoLangFileMatchTest.java index 11ea90e57..92424aebb 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/GoLangFileMatchTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/GoLangFileMatchTest.java @@ -12,73 +12,71 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import java.io.IOException; - @RunWith(Parameterized.class) public class GoLangFileMatchTest { @Parameterized.Parameters public static Object[][] getTestData() { - return new Object[][] {new Object[] {new MatchTestCase("", "abc", false, false)}, - new Object[] {new MatchTestCase("abc", "abc", true, false)}, - new Object[] {new MatchTestCase("*", "abc", true, false)}, - new Object[] {new MatchTestCase("*c", "abc", true, false)}, - new Object[] {new MatchTestCase("a*", "a", true, false)}, - new Object[] {new MatchTestCase("a*", "abc", true, false)}, - new Object[] {new MatchTestCase("a*", "ab/c", true, false)}, - new Object[] {new MatchTestCase("a*/b", "abc/b", true, false)}, - new Object[] {new MatchTestCase("a*/b", "a/c/b", false, false)}, - new Object[] {new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxe/f", true, false)}, - new Object[] {new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxexxx/f", true, false)}, - new Object[] {new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxe/xxx/f", false, false)}, - new Object[] {new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxexxx/fff", false, false)}, - new Object[] {new MatchTestCase("a*b?c*x", "abxbbxdbxebxczzx", true, false)}, - new Object[] {new MatchTestCase("a*b?c*x", "abxbbxdbxebxczzy", false, false)}, - new Object[] {new MatchTestCase("ab[c]", "abc", true, false)}, - new Object[] {new MatchTestCase("ab[b-d]", "abc", true, false)}, - new Object[] {new MatchTestCase("ab[e-g]", "abc", false, false)}, - new Object[] {new MatchTestCase("ab[^c]", "abc", false, false)}, - new Object[] {new MatchTestCase("ab[^b-d]", "abc", false, false)}, - new Object[] {new MatchTestCase("ab[^e-g]", "abc", true, false)}, - new Object[] {new MatchTestCase("a\\*b", "a*b", true, false)}, - new Object[] {new MatchTestCase("a\\*b", "ab", false, false)}, - new Object[] {new MatchTestCase("a?b", "a☺b", true, false)}, - new Object[] {new MatchTestCase("a[^a]b", "a☺b", true, false)}, - new Object[] {new MatchTestCase("a???b", "a☺b", false, false)}, - new Object[] {new MatchTestCase("a[^a][^a][^a]b", "a☺b", false, false)}, - new Object[] {new MatchTestCase("[a-ζ]*", "α", true, false)}, - new Object[] {new MatchTestCase("*[a-ζ]", "A", false, false)}, - new Object[] {new MatchTestCase("a?b", "a/b", false, false)}, - new Object[] {new MatchTestCase("a*b", "a/b", false, false)}, - new Object[] {new MatchTestCase("[\\]a]", "]", true, false)}, - new Object[] {new MatchTestCase("[\\-]", "-", true, false)}, - new Object[] {new MatchTestCase("[x\\-]", "x", true, false)}, - new Object[] {new MatchTestCase("[x\\-]", "-", true, false)}, - new Object[] {new MatchTestCase("[x\\-]", "z", false, false)}, - new Object[] {new MatchTestCase("[\\-x]", "x", true, false)}, - new Object[] {new MatchTestCase("[\\-x]", "-", true, false)}, - new Object[] {new MatchTestCase("[\\-x]", "a", false, false)}, - new Object[] {new MatchTestCase("[]a]", "]", false, true)}, - new Object[] {new MatchTestCase("[-]", "-", false, true)}, - new Object[] {new MatchTestCase("[x-]", "x", false, true)}, - new Object[] {new MatchTestCase("[x-]", "-", false, true)}, - new Object[] {new MatchTestCase("[x-]", "z", false, true)}, - new Object[] {new MatchTestCase("[-x]", "x", false, true)}, - new Object[] {new MatchTestCase("[-x]", "-", false, true)}, - new Object[] {new MatchTestCase("[-x]", "a", false, true)}, - new Object[] {new MatchTestCase("\\", "a", false, true)}, - new Object[] {new MatchTestCase("[a-b-c]", "a", false, true)}, - new Object[] {new MatchTestCase("[", "a", false, true)}, - new Object[] {new MatchTestCase("[^", "a", false, true)}, - new Object[] {new MatchTestCase("[^bc", "a", false, true)}, - new Object[] {new MatchTestCase("a[", "a", false, true)}, - new Object[] {new MatchTestCase("a[", "ab", false, true)}, - new Object[] {new MatchTestCase("*x", "xxx", true, false)}, - new Object[] {new MatchTestCase("a", "a/b/c", true, false)}, - new Object[] {new MatchTestCase("*/b", "a/b/c", true, false)}, - new Object[] {new MatchTestCase("**/b/*/d", "a/b/c/d", true, false)}, - new Object[] {new MatchTestCase("**/c", "a/b/c", true, false)}}; + return new Object[][]{new Object[]{new MatchTestCase("", "abc", false, false)}, + new Object[]{new MatchTestCase("abc", "abc", true, false)}, + new Object[]{new MatchTestCase("*", "abc", true, false)}, + new Object[]{new MatchTestCase("*c", "abc", true, false)}, + new Object[]{new MatchTestCase("a*", "a", true, false)}, + new Object[]{new MatchTestCase("a*", "abc", true, false)}, + new Object[]{new MatchTestCase("a*", "ab/c", true, false)}, + new Object[]{new MatchTestCase("a*/b", "abc/b", true, false)}, + new Object[]{new MatchTestCase("a*/b", "a/c/b", false, false)}, + new Object[]{new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxe/f", true, false)}, + new Object[]{new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxexxx/f", true, false)}, + new Object[]{new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxe/xxx/f", false, false)}, + new Object[]{new MatchTestCase("a*b*c*d*e*/f", "axbxcxdxexxx/fff", false, false)}, + new Object[]{new MatchTestCase("a*b?c*x", "abxbbxdbxebxczzx", true, false)}, + new Object[]{new MatchTestCase("a*b?c*x", "abxbbxdbxebxczzy", false, false)}, + new Object[]{new MatchTestCase("ab[c]", "abc", true, false)}, + new Object[]{new MatchTestCase("ab[b-d]", "abc", true, false)}, + new Object[]{new MatchTestCase("ab[e-g]", "abc", false, false)}, + new Object[]{new MatchTestCase("ab[^c]", "abc", false, false)}, + new Object[]{new MatchTestCase("ab[^b-d]", "abc", false, false)}, + new Object[]{new MatchTestCase("ab[^e-g]", "abc", true, false)}, + new Object[]{new MatchTestCase("a\\*b", "a*b", true, false)}, + new Object[]{new MatchTestCase("a\\*b", "ab", false, false)}, + new Object[]{new MatchTestCase("a?b", "a☺b", true, false)}, + new Object[]{new MatchTestCase("a[^a]b", "a☺b", true, false)}, + new Object[]{new MatchTestCase("a???b", "a☺b", false, false)}, + new Object[]{new MatchTestCase("a[^a][^a][^a]b", "a☺b", false, false)}, + new Object[]{new MatchTestCase("[a-ζ]*", "α", true, false)}, + new Object[]{new MatchTestCase("*[a-ζ]", "A", false, false)}, + new Object[]{new MatchTestCase("a?b", "a/b", false, false)}, + new Object[]{new MatchTestCase("a*b", "a/b", false, false)}, + new Object[]{new MatchTestCase("[\\]a]", "]", true, false)}, + new Object[]{new MatchTestCase("[\\-]", "-", true, false)}, + new Object[]{new MatchTestCase("[x\\-]", "x", true, false)}, + new Object[]{new MatchTestCase("[x\\-]", "-", true, false)}, + new Object[]{new MatchTestCase("[x\\-]", "z", false, false)}, + new Object[]{new MatchTestCase("[\\-x]", "x", true, false)}, + new Object[]{new MatchTestCase("[\\-x]", "-", true, false)}, + new Object[]{new MatchTestCase("[\\-x]", "a", false, false)}, + new Object[]{new MatchTestCase("[]a]", "]", false, true)}, + new Object[]{new MatchTestCase("[-]", "-", false, true)}, + new Object[]{new MatchTestCase("[x-]", "x", false, true)}, + new Object[]{new MatchTestCase("[x-]", "-", false, true)}, + new Object[]{new MatchTestCase("[x-]", "z", false, true)}, + new Object[]{new MatchTestCase("[-x]", "x", false, true)}, + new Object[]{new MatchTestCase("[-x]", "-", false, true)}, + new Object[]{new MatchTestCase("[-x]", "a", false, true)}, + new Object[]{new MatchTestCase("\\", "a", false, true)}, + new Object[]{new MatchTestCase("[a-b-c]", "a", false, true)}, + new Object[]{new MatchTestCase("[", "a", false, true)}, + new Object[]{new MatchTestCase("[^", "a", false, true)}, + new Object[]{new MatchTestCase("[^bc", "a", false, true)}, + new Object[]{new MatchTestCase("a[", "a", false, true)}, + new Object[]{new MatchTestCase("a[", "ab", false, true)}, + new Object[]{new MatchTestCase("*x", "xxx", true, false)}, + new Object[]{new MatchTestCase("a", "a/b/c", true, false)}, + new Object[]{new MatchTestCase("*/b", "a/b/c", true, false)}, + new Object[]{new MatchTestCase("**/b/*/d", "a/b/c/d", true, false)}, + new Object[]{new MatchTestCase("**/c", "a/b/c", true, false)}}; } @Parameterized.Parameter @@ -129,7 +127,7 @@ public MatchTestCase(String pattern, String s, Boolean matches, Boolean expectEx @Override public String toString() { return "MatchTestCase [pattern=" + pattern + ", s=" + s + ", matches=" + matches + ", expectException=" - + expectException + "]"; + + expectException + "]"; } } diff --git a/docker-java/src/test/java/com/github/dockerjava/core/NameParserTest.java b/docker-java/src/test/java/com/github/dockerjava/core/NameParserTest.java index 89ad131f6..5170d8cb0 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/NameParserTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/NameParserTest.java @@ -13,10 +13,7 @@ import static org.junit.Assert.assertEquals; /** - * - * * @author Marcus Linke - * */ public class NameParserTest { @@ -130,6 +127,7 @@ public void testResolveRepositoryNameWithNamespaceAndHostnameAndTag() { HostnameReposName resolved = NameParser.resolveRepositoryName("localhost:5000/namespace/repository:tag"); assertEquals(new HostnameReposName("localhost:5000", "namespace/repository"), resolved); } + @Test public void testResolveRepositoryNameWithNamespaceAndHostnameAndTagAndSHA256() { HostnameReposName resolved = NameParser.resolveRepositoryName("localhost:5000/namespace/repository:tag@sha256:sha256"); diff --git a/docker-java/src/test/java/com/github/dockerjava/core/command/DockerfileFixture.java b/docker-java/src/test/java/com/github/dockerjava/core/command/DockerfileFixture.java index 913d1758b..bcb29fc26 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/command/DockerfileFixture.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/command/DockerfileFixture.java @@ -35,7 +35,7 @@ public void open() throws Exception { LOGGER.info("building {}", directory); client.buildImageCmd(new File("src/test/resources", directory)).withNoCache(true) - .start().awaitImageId(); + .start().awaitImageId(); Image lastCreatedImage = client.listImagesCmd().exec().get(0); @@ -57,7 +57,7 @@ public void close() throws Exception { LOGGER.info("removing container {}", containerId); try { client.removeContainerCmd(containerId).withForce(true) // stop too - .exec(); + .exec(); } catch (NotFoundException | InternalServerErrorException ignored) { LOGGER.info("ignoring {}", ignored.getMessage()); } diff --git a/docker-java/src/test/java/com/github/dockerjava/core/command/FrameReaderITest.java b/docker-java/src/test/java/com/github/dockerjava/core/command/FrameReaderITest.java index 16c456164..829006b3b 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/command/FrameReaderITest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/command/FrameReaderITest.java @@ -47,13 +47,13 @@ public void canCloseFrameReaderAndReadExpectedLines() throws Exception { // wait for the container to be successfully executed int exitCode = dockerClient.waitContainerCmd(dockerfileFixture.getContainerId()) - .start().awaitStatusCode(); + .start().awaitStatusCode(); assertEquals(0, exitCode); final List loggingFrames = getLoggingFrames(); final Frame outFrame = new Frame(StreamType.STDOUT, "to stdout\n".getBytes()); final Frame errFrame = new Frame(StreamType.STDERR, "to stderr\n".getBytes()); - + assertThat(loggingFrames, containsInAnyOrder(outFrame, errFrame)); assertThat(loggingFrames, hasSize(2)); } @@ -63,10 +63,10 @@ private List getLoggingFrames() throws Exception { FrameReaderITestCallback collectFramesCallback = new FrameReaderITestCallback(); dockerClient.logContainerCmd(dockerfileFixture.getContainerId()).withStdOut(true).withStdErr(true) - .withTailAll() - // we can't follow stream here as it blocks reading from resulting InputStream infinitely - // .withFollowStream() - .exec(collectFramesCallback).awaitCompletion(); + .withTailAll() + // we can't follow stream here as it blocks reading from resulting InputStream infinitely + // .withFollowStream() + .exec(collectFramesCallback).awaitCompletion(); return collectFramesCallback.frames; } diff --git a/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileAddMultipleFilesTest.java b/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileAddMultipleFilesTest.java index 6406647cf..bc0d171d8 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileAddMultipleFilesTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileAddMultipleFilesTest.java @@ -23,7 +23,7 @@ public void ignoreAllBut() throws Exception { Collection filesToAdd = transform(result.filesToAdd, TO_FILE_NAMES); assertThat(filesToAdd, - containsInAnyOrder("Dockerfile", "foo.jar")); + containsInAnyOrder("Dockerfile", "foo.jar")); } @Test @@ -34,7 +34,7 @@ public void nestedDirsPatterns() throws Exception { Collection filesToAdd = transform(result.filesToAdd, TO_FILE_NAMES); assertThat(filesToAdd, - containsInAnyOrder("Dockerfile", ".dockerignore", "README.md", "README-grand.md", "b.txt")); + containsInAnyOrder("Dockerfile", ".dockerignore", "README.md", "README-grand.md", "b.txt")); } @Test @@ -70,6 +70,6 @@ public void addFiles() throws IOException { private File fileFromBuildTestResource(String resource) { return new File(Thread.currentThread().getContextClassLoader() - .getResource("buildTests/" + resource).getFile()); + .getResource("buildTests/" + resource).getFile()); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileStatementAddTest.java b/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileStatementAddTest.java index d36aa4f4e..d0b1cfc45 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileStatementAddTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/dockerfile/DockerfileStatementAddTest.java @@ -22,13 +22,13 @@ public static final class ParamTests { @Parameterized.Parameters(name = "{0} {1} {2}") public static Object[][] data() { return new Object[][]{{"ADD src dest", contains("src"), "dest"}, - {"ADD \"src file\" \"dest\"", contains("src file"), "dest"}, - {"ADD src\"file dest", contains("src\"file"), "dest"}, - {"ADD src1 src2 dest", containsInAnyOrder("src1", "src2"), "dest"}, - {"COPY src dest", contains("src"), "dest"}, - {"COPY \"src file\" \"dest\"", contains("src file"), "dest"}, - {"COPY src\"file dest", contains("src\"file"), "dest"}, - {"COPY src1 src2 dest", containsInAnyOrder("src1", "src2"), "dest"}}; + {"ADD \"src file\" \"dest\"", contains("src file"), "dest"}, + {"ADD src\"file dest", contains("src\"file"), "dest"}, + {"ADD src1 src2 dest", containsInAnyOrder("src1", "src2"), "dest"}, + {"COPY src dest", contains("src"), "dest"}, + {"COPY \"src file\" \"dest\"", contains("src file"), "dest"}, + {"COPY src\"file dest", contains("src\"file"), "dest"}, + {"COPY src1 src2 dest", containsInAnyOrder("src1", "src2"), "dest"}}; } @Parameterized.Parameter diff --git a/docker-java/src/test/java/com/github/dockerjava/core/util/CertificateUtilsTest.java b/docker-java/src/test/java/com/github/dockerjava/core/util/CertificateUtilsTest.java index c29cedcf9..9a8e438b0 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/util/CertificateUtilsTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/util/CertificateUtilsTest.java @@ -19,7 +19,7 @@ public class CertificateUtilsTest { private static final String baseDir = CertificateUtilsTest.class.getResource( - CertificateUtilsTest.class.getSimpleName() + "/").getFile(); + CertificateUtilsTest.class.getSimpleName() + "/").getFile(); @BeforeClass public static void init() { diff --git a/docker-java/src/test/java/com/github/dockerjava/core/util/CompressArchiveUtilTest.java b/docker-java/src/test/java/com/github/dockerjava/core/util/CompressArchiveUtilTest.java index f15085d1c..3b6114377 100644 --- a/docker-java/src/test/java/com/github/dockerjava/core/util/CompressArchiveUtilTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/core/util/CompressArchiveUtilTest.java @@ -182,7 +182,7 @@ public void tarWithfolderAsInputAndNestedSymbolicLinkDir() throws Exception { @Test public void archiveTARFilesWithFolderAndFiles() throws Exception { File archive = CompressArchiveUtil.archiveTARFiles(tempFolder.getRoot(), - createFoldersAndSubFolderWithFiles(tempFolder.getRoot().toPath()), "archive"); + createFoldersAndSubFolderWithFiles(tempFolder.getRoot().toPath()), "archive"); assertEquals(6, getNumberOfEntryInArchive(archive)); assertTarArchiveEntryIsDirectory(archive, "folderA"); assertTarArchiveEntryIsDirectory(archive, "folderB"); @@ -234,7 +234,7 @@ private static void assertTarArchiveEntryIsNonEmptyFile(File archive, String fil TarArchiveEntry tarArchiveEntry = getTarArchiveEntry(archive, fileName); assertNotNull(tarArchiveEntry); assertTrue(tarArchiveEntry.isFile()); - assertTrue(tarArchiveEntry.getSize()>0); + assertTrue(tarArchiveEntry.getSize() > 0); } private static void assertTarArchiveEntryIsExecutableFile(File archive, String fileName) throws IOException { @@ -254,15 +254,14 @@ private static void assertTarArchiveEntryIsSymlink(File archive, String fileName /** * Creates the following directory structure with files in the specified * destination folder - * - * destinationFolder - * |__folderA - * | |__fileA - * |__folderB - * |__fileB - * |__subFolderB - * |__subFileB - * + *

+ * destinationFolder + * |__folderA + * | |__fileA + * |__folderB + * |__fileB + * |__subFolderB + * |__subFileB * * @param destinationFolder where to create the folder/files. * @return the list of created files. @@ -293,13 +292,13 @@ private static File createFileWithContent(Path fileToCreate) throws IOException private static TarArchiveEntry getTarArchiveEntry(File tarArchive, String filename) throws IOException { try (TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream( - new GZIPInputStream(new BufferedInputStream(new FileInputStream(tarArchive))))) { + new GZIPInputStream(new BufferedInputStream(new FileInputStream(tarArchive))))) { TarArchiveEntry entry; while ((entry = tarArchiveInputStream.getNextTarEntry()) != null) { if (entry.getName().equals(filename) - || entry.getName().endsWith("/" + filename) - || entry.getName().equals(filename + "/") - || entry.getName().endsWith("/" + filename + "/")) { + || entry.getName().endsWith("/" + filename) + || entry.getName().equals(filename + "/") + || entry.getName().endsWith("/" + filename + "/")) { return entry; } } @@ -310,7 +309,7 @@ private static TarArchiveEntry getTarArchiveEntry(File tarArchive, String filena private static int getNumberOfEntryInArchive(File tarArchive) throws IOException { int numberOfEntries = 0; try (TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream( - new GZIPInputStream(new BufferedInputStream(new FileInputStream(tarArchive))))) { + new GZIPInputStream(new BufferedInputStream(new FileInputStream(tarArchive))))) { while ((tarArchiveInputStream.getNextTarEntry()) != null) { numberOfEntries++; } diff --git a/docker-java/src/test/java/com/github/dockerjava/junit/DockerMatchers.java b/docker-java/src/test/java/com/github/dockerjava/junit/DockerMatchers.java index d0c2a22e6..a75e2b61e 100644 --- a/docker-java/src/test/java/com/github/dockerjava/junit/DockerMatchers.java +++ b/docker-java/src/test/java/com/github/dockerjava/junit/DockerMatchers.java @@ -58,8 +58,8 @@ public boolean matchesSafely(DockerRule dockerRule) { @Override protected void describeMismatchSafely(DockerRule rule, Description mismatchDescription) { mismatchDescription - .appendText(" was ") - .appendText(getVersion(rule.getClient()).toString()); + .appendText(" was ") + .appendText(getVersion(rule.getClient()).toString()); } }; } diff --git a/docker-java/src/test/java/com/github/dockerjava/junit/PrivateRegistryRule.java b/docker-java/src/test/java/com/github/dockerjava/junit/PrivateRegistryRule.java index 327bfc941..3c7f0a085 100644 --- a/docker-java/src/test/java/com/github/dockerjava/junit/PrivateRegistryRule.java +++ b/docker-java/src/test/java/com/github/dockerjava/junit/PrivateRegistryRule.java @@ -40,9 +40,9 @@ public String createPrivateImage(String tagName) throws InterruptedException { String imgNameWithTag = createTestImage(tagName); dockerClient.pushImageCmd(imgNameWithTag) - .withAuthConfig(authConfig) - .start() - .awaitCompletion(30, TimeUnit.SECONDS); + .withAuthConfig(authConfig) + .start() + .awaitCompletion(30, TimeUnit.SECONDS); dockerClient.removeImageCmd(imgNameWithTag).exec(); @@ -73,26 +73,26 @@ protected void before() throws Throwable { File baseDir = new File(DockerRule.class.getResource("/privateRegistry").getFile()); String registryImageId = dockerClient.buildImageCmd(baseDir) - .withNoCache(true) - .start() - .awaitImageId(); + .withNoCache(true) + .start() + .awaitImageId(); InspectImageResponse inspectImageResponse = dockerClient.inspectImageCmd(registryImageId).exec(); assertThat(inspectImageResponse, not(nullValue())); DockerRule.LOG.info("Image Inspect: {}", inspectImageResponse.toString()); dockerClient.tagImageCmd(registryImageId, imageName, "2") - .withForce().exec(); + .withForce().exec(); // see https://github.com/docker/distribution/blob/master/docs/deploying.md#native-basic-auth CreateContainerResponse testregistry = dockerClient - .createContainerCmd(imageName + ":2") - .withHostConfig(newHostConfig() - .withPortBindings(new PortBinding(Ports.Binding.bindPort(port), ExposedPort.tcp(5000)))) - .withEnv("REGISTRY_AUTH=htpasswd", "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", - "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd", "REGISTRY_LOG_LEVEL=debug", - "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key") - .exec(); + .createContainerCmd(imageName + ":2") + .withHostConfig(newHostConfig() + .withPortBindings(new PortBinding(Ports.Binding.bindPort(port), ExposedPort.tcp(5000)))) + .withEnv("REGISTRY_AUTH=htpasswd", "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", + "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd", "REGISTRY_LOG_LEVEL=debug", + "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key") + .exec(); containerId = testregistry.getId(); dockerClient.startContainerCmd(containerId).exec(); @@ -102,18 +102,18 @@ protected void before() throws Throwable { // credentials as configured in /auth/htpasswd authConfig = new AuthConfig() - .withUsername("testuser") - .withPassword("testpassword") - .withRegistryAddress("localhost:" + port); + .withUsername("testuser") + .withPassword("testpassword") + .withRegistryAddress("localhost:" + port); } @Override protected void after() { if (containerId != null) { dockerClient.removeContainerCmd(containerId) - .withForce(true) - .withRemoveVolumes(true) - .exec(); + .withForce(true) + .withRemoveVolumes(true) + .exec(); } } } diff --git a/docker-java/src/test/java/com/github/dockerjava/junit/suite/IntegrationDockerTestSuite.java b/docker-java/src/test/java/com/github/dockerjava/junit/suite/IntegrationDockerTestSuite.java index 06f6a4d25..138fc29e7 100644 --- a/docker-java/src/test/java/com/github/dockerjava/junit/suite/IntegrationDockerTestSuite.java +++ b/docker-java/src/test/java/com/github/dockerjava/junit/suite/IntegrationDockerTestSuite.java @@ -24,20 +24,20 @@ */ @RunWith(Suite.class) @Suite.SuiteClasses({ - AttachContainerCmdIT.class, - AuthCmdIT.class, - BuildImageCmdIT.class, - CommitCmdIT.class, - CopyArchiveFromContainerCmdIT.class, - CopyArchiveToContainerCmdIT.class, - CopyFileFromContainerCmdIT.class, - ConnectToNetworkCmdIT.class, - CreateContainerCmdIT.class, - CreateNetworkCmdIT.class, - CreateVolumeCmdIT.class, - EventsCmdIT.class, - InfoCmdIT.class, - RemoveNetworkCmdIT.class, + AttachContainerCmdIT.class, + AuthCmdIT.class, + BuildImageCmdIT.class, + CommitCmdIT.class, + CopyArchiveFromContainerCmdIT.class, + CopyArchiveToContainerCmdIT.class, + CopyFileFromContainerCmdIT.class, + ConnectToNetworkCmdIT.class, + CreateContainerCmdIT.class, + CreateNetworkCmdIT.class, + CreateVolumeCmdIT.class, + EventsCmdIT.class, + InfoCmdIT.class, + RemoveNetworkCmdIT.class, }) public class IntegrationDockerTestSuite { } diff --git a/docker-java/src/test/java/com/github/dockerjava/netty/NettyDockerCmdExecFactoryConfigTest.java b/docker-java/src/test/java/com/github/dockerjava/netty/NettyDockerCmdExecFactoryConfigTest.java index 5f7d200bf..1a1742f61 100644 --- a/docker-java/src/test/java/com/github/dockerjava/netty/NettyDockerCmdExecFactoryConfigTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/netty/NettyDockerCmdExecFactoryConfigTest.java @@ -46,8 +46,8 @@ public void testNettyDockerCmdExecFactoryConfigWithApiVersion() throws Exception .withApiVersion("1.23"); DockerClient client = DockerClientBuilder.getInstance(configBuilder) - .withDockerCmdExecFactory(factory) - .build(); + .withDockerCmdExecFactory(factory) + .build(); FakeDockerServer server = new FakeDockerServer(dockerPort); server.start(); diff --git a/docker-java/src/test/java/com/github/dockerjava/netty/NettyWebTargetTest.java b/docker-java/src/test/java/com/github/dockerjava/netty/NettyWebTargetTest.java index 4e7bb1da2..7db20c139 100644 --- a/docker-java/src/test/java/com/github/dockerjava/netty/NettyWebTargetTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/netty/NettyWebTargetTest.java @@ -26,17 +26,17 @@ public void verifyImmutability() { NettyWebTarget emptyWebTarget = new NettyWebTarget(JSONTestHelper.getMapper(), channelProvider, "DUMMY"); NettyWebTarget initWebTarget = emptyWebTarget.path("/containers/{id}/attach").resolveTemplate("id", "d03da378b592") - .queryParam("logs", "true"); + .queryParam("logs", "true"); NettyWebTarget anotherWebTarget = emptyWebTarget.path("/containers/{id}/attach") - .resolveTemplate("id", "2cfada4e3c07").queryParam("stdin", "true"); + .resolveTemplate("id", "2cfada4e3c07").queryParam("stdin", "true"); assertEquals(emptyWebTarget, new NettyWebTarget(JSONTestHelper.getMapper(), channelProvider, "DUMMY")); assertEquals(initWebTarget, new NettyWebTarget(JSONTestHelper.getMapper(), channelProvider, "DUMMY").path("/containers/d03da378b592/attach") - .queryParam("logs", "true")); + .queryParam("logs", "true")); assertEquals(anotherWebTarget, new NettyWebTarget(JSONTestHelper.getMapper(), channelProvider, "DUMMY").path("/containers/2cfada4e3c07/attach") - .queryParam("stdin", "true")); + .queryParam("stdin", "true")); } } diff --git a/docker-java/src/test/java/com/github/dockerjava/netty/handler/FramedResponseStreamHandlerTest.java b/docker-java/src/test/java/com/github/dockerjava/netty/handler/FramedResponseStreamHandlerTest.java index ef903f942..8aeb9e225 100644 --- a/docker-java/src/test/java/com/github/dockerjava/netty/handler/FramedResponseStreamHandlerTest.java +++ b/docker-java/src/test/java/com/github/dockerjava/netty/handler/FramedResponseStreamHandlerTest.java @@ -1,184 +1,184 @@ package com.github.dockerjava.netty.handler; -import com.github.dockerjava.api.model.Frame; import com.github.dockerjava.api.async.ResultCallback; -import com.github.dockerjava.netty.handler.FramedResponseStreamHandler; -import java.io.Closeable; -import java.util.ArrayList; -import java.util.List; +import com.github.dockerjava.api.model.Frame; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import org.junit.Test; import org.mockito.Mockito; +import java.io.Closeable; +import java.util.ArrayList; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class FramedResponseStreamHandlerTest { - public class MockedResponseHandler implements ResultCallback { + public class MockedResponseHandler implements ResultCallback { + + public List frames = new ArrayList<>(); + public List exceptions = new ArrayList<>(); + + @Override + public void close() { + } + + @Override + public void onStart(Closeable closeable) { + } + + @Override + public void onNext(Frame object) { + frames.add(object); + } + + @Override + public void onError(Throwable throwable) { + exceptions.add(throwable); + } + + @Override + public void onComplete() { + } + } + + + @Test + public void channelRead0emptyHeaderCount() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); + + // Assert result + assertTrue(responseHandler.frames.isEmpty()); + } + + @Test + public void channelRead0headerTooSmall() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - public List frames = new ArrayList<>(); - public List exceptions = new ArrayList<>(); + // Assert result + assertTrue(responseHandler.frames.isEmpty()); + } + + @Test + public void channelRead0rawStream() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {3, 0, 0, 0, 0, 0, 0, 0, 0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - @Override - public void close() { + // Assert result + assertEquals("RAW: ", responseHandler.frames.get(0).toString()); } - @Override - public void onStart(Closeable closeable) { + @Test + public void channelRead0emptyNonRaw() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); + + // Assert result + assertTrue(responseHandler.frames.isEmpty()); } - @Override - public void onNext(Frame object) { - frames.add(object); + @Test + public void channelRead0stdIn() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {0, 0, 0, 0, 0, 0, 0, 1, 0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); + + // Assert result + assertEquals("STDIN: ", responseHandler.frames.get(0).toString()); } - @Override - public void onError(Throwable throwable) { - exceptions.add(throwable); + @Test + public void channelRead0stdOut() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {1, 0, 0, 0, 0, 0, 0, 1, 0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); + + // Assert result + assertEquals("STDOUT: ", responseHandler.frames.get(0).toString()); } - @Override - public void onComplete() { + @Test + public void channelRead0stdErr() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {2, 0, 0, 0, 0, 0, 0, 1, 0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); + + // Assert result + assertEquals("STDERR: ", responseHandler.frames.get(0).toString()); + } + + @Test + public void channelRead0largePayload() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + byte[] msg = {1, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0}; + + // Act + objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); + + // Assert result + assertEquals("STDOUT: ", responseHandler.frames.get(0).toString()); } - } - - - @Test - public void channelRead0emptyHeaderCount() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {}; - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertTrue(responseHandler.frames.isEmpty()); - } - - @Test - public void channelRead0headerTooSmall() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertTrue(responseHandler.frames.isEmpty()); - } - - @Test - public void channelRead0rawStream() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {3, 0, 0, 0, 0, 0, 0, 0, 0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertEquals("RAW: ", responseHandler.frames.get(0).toString()); - } - - @Test - public void channelRead0emptyNonRaw() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {0, 0, 0, 0, 0, 0, 0, 0, 0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertTrue(responseHandler.frames.isEmpty()); - } - - @Test - public void channelRead0stdIn() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {0, 0, 0, 0, 0, 0, 0, 1, 0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertEquals("STDIN: ", responseHandler.frames.get(0).toString()); - } - - @Test - public void channelRead0stdOut() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {1, 0, 0, 0, 0, 0, 0, 1, 0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertEquals("STDOUT: ", responseHandler.frames.get(0).toString()); - } - - @Test - public void channelRead0stdErr() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {2, 0, 0, 0, 0, 0, 0, 1, 0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertEquals("STDERR: ", responseHandler.frames.get(0).toString()); - } - - @Test - public void channelRead0largePayload() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - byte[] msg = {1, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0}; - - // Act - objectUnderTest.channelRead0(Mockito.mock(ChannelHandlerContext.class), Unpooled.wrappedBuffer(msg)); - - // Assert result - assertEquals("STDOUT: ", responseHandler.frames.get(0).toString()); - } - - @Test - public void exceptionCaught() throws Exception { - - // Arrange - final MockedResponseHandler responseHandler = new MockedResponseHandler(); - final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); - final Exception exception = new Exception(); - final Throwable throwable = new Throwable(); - throwable.initCause(exception); - - // Act - objectUnderTest.exceptionCaught(Mockito.mock(ChannelHandlerContext.class), throwable); - - // Assert result - assertEquals(exception, responseHandler.exceptions.get(0).getCause()); - } + @Test + public void exceptionCaught() throws Exception { + + // Arrange + final MockedResponseHandler responseHandler = new MockedResponseHandler(); + final FramedResponseStreamHandler objectUnderTest = new FramedResponseStreamHandler(responseHandler); + final Exception exception = new Exception(); + final Throwable throwable = new Throwable(); + throwable.initCause(exception); + + // Act + objectUnderTest.exceptionCaught(Mockito.mock(ChannelHandlerContext.class), throwable); + + // Assert result + assertEquals(exception, responseHandler.exceptions.get(0).getCause()); + } } diff --git a/docker-java/src/test/java/com/github/dockerjava/test/serdes/AbstractJSONResourceRef.java b/docker-java/src/test/java/com/github/dockerjava/test/serdes/AbstractJSONResourceRef.java index 1d5f43a6f..1925d27ba 100644 --- a/docker-java/src/test/java/com/github/dockerjava/test/serdes/AbstractJSONResourceRef.java +++ b/docker-java/src/test/java/com/github/dockerjava/test/serdes/AbstractJSONResourceRef.java @@ -17,13 +17,13 @@ /** * Default implementation of the Resource reference. - * + * * @author Oleg Nenashev */ public abstract class AbstractJSONResourceRef implements JSONResourceRef { /** * Gets a class which stores resources. - * + * * @return Reference class by default. */ @Override diff --git a/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONResourceRef.java b/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONResourceRef.java index 94bb2cf75..3b34a01ee 100644 --- a/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONResourceRef.java +++ b/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONResourceRef.java @@ -17,21 +17,21 @@ /** * References JSON resources, which - * + * * @author Oleg Nenashev */ public interface JSONResourceRef { /** * Gets the resource file name under the class. - * + * * @return File name, which is stored under the resource class */ String getFileName(); /** * Gets a class which stores resources. - * + * * @return Class to be used as a resource source */ Class getResourceClass(); diff --git a/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONSamples.java b/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONSamples.java index 231d1426a..f8f5d8a3c 100644 --- a/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONSamples.java +++ b/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONSamples.java @@ -43,7 +43,7 @@ public static TClass testRoundTrip(RemoteApiVersion version, String con * but via {@link TypeReference} */ public static TClass testRoundTrip(TClass item, JavaType type) - throws IOException, AssertionError { + throws IOException, AssertionError { String serialized1 = JSONTestHelper.getMapper().writeValueAsString(item); JsonNode json1 = JSONTestHelper.getMapper().readTree(serialized1); diff --git a/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONTestHelper.java b/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONTestHelper.java index 0c03bdcc2..8b5b828f1 100644 --- a/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONTestHelper.java +++ b/docker-java/src/test/java/com/github/dockerjava/test/serdes/JSONTestHelper.java @@ -46,12 +46,10 @@ public class JSONTestHelper { /** * Reads JSON String from the specified resource - * - * @param resource - * JSON File + * + * @param resource JSON File * @return JSON String - * @throws IOException - * JSON Conversion error + * @throws IOException JSON Conversion error */ public static String readString(JSONResourceRef resource) throws IOException { try (InputStream istream = resource.getResourceClass().getResourceAsStream(resource.getFileName())) { @@ -64,16 +62,12 @@ public static String readString(JSONResourceRef resource) throws IOException { /** * Reads item from the resource. - * - * @param - * Data class to be read - * @param resource - * Resource reference - * @param tclass - * Class entry + * + * @param Data class to be read + * @param resource Resource reference + * @param tclass Class entry * @return Item - * @throws IOException - * JSON conversion error + * @throws IOException JSON conversion error */ public static TClass readObject(JSONResourceRef resource, Class tclass) throws IOException { String str = readString(resource); @@ -82,21 +76,16 @@ public static TClass readObject(JSONResourceRef resource, Class /** * Basic serialization-deserialization consistency test for the resource. - * - * @param - * Data class - * @param resource - * Resource reference - * @param tclass - * Class entry - * @throws IOException - * JSON conversion error - * @throws AssertionError - * Validation error + * + * @param Data class + * @param resource Resource reference + * @param tclass Class entry * @return Deserialized object after the roundtrip + * @throws IOException JSON conversion error + * @throws AssertionError Validation error */ public static TClass testRoundTrip(JSONResourceRef resource, Class tclass) throws IOException, - AssertionError { + AssertionError { TClass item = readObject(resource, tclass); assertNotNull(item); return testRoundTrip(item, tclass); @@ -104,16 +93,12 @@ public static TClass testRoundTrip(JSONResourceRef resource, Class - * Item class - * @param item - * Item to be checked + * + * @param Item class + * @param item Item to be checked * @return Deserialized object after the roundtrip - * @throws IOException - * JSON Conversion error - * @throws AssertionError - * Validation error + * @throws IOException JSON Conversion error + * @throws AssertionError Validation error */ @SuppressWarnings("unchecked") public static TClass testRoundTrip(TClass item) throws IOException, AssertionError { @@ -122,18 +107,13 @@ public static TClass testRoundTrip(TClass item) throws IOException, Ass /** * Performs roundtrip test for the specified class. - * - * @param - * Item class - * @param item - * Item to be checked - * @param asclass - * Class to be used during conversions + * + * @param Item class + * @param item Item to be checked + * @param asclass Class to be used during conversions * @return Deserialized object after the roundtrip - * @throws IOException - * JSON Conversion error - * @throws AssertionError - * Validation error + * @throws IOException JSON Conversion error + * @throws AssertionError Validation error */ public static TClass testRoundTrip(TClass item, Class asclass) throws IOException, AssertionError { String serialized1 = MAPPER.writeValueAsString(item); diff --git a/docker-java/src/test/resources/com.github.dockerjava.core/registry.v2/config.json b/docker-java/src/test/resources/com.github.dockerjava.core/registry.v2/config.json index 73ab82aca..4791708a0 100644 --- a/docker-java/src/test/resources/com.github.dockerjava.core/registry.v2/config.json +++ b/docker-java/src/test/resources/com.github.dockerjava.core/registry.v2/config.json @@ -1,7 +1,7 @@ { - "auths": { - "https://test.docker.io/v2/": { - "auth": "dXNlcjpwYXNzd29yZA==" + "auths": { + "https://test.docker.io/v2/": { + "auth": "dXNlcjpwYXNzd29yZA==" + } } - } } diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_empty.json b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_empty.json index ea31d6f33..1991218c4 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_empty.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_empty.json @@ -1,115 +1,116 @@ -[{ - "AppArmorProfile": "", - "Args": [ ], - "Config": { - "AttachStderr": true, - "AttachStdin": true, - "AttachStdout": true, - "Cmd": [ ], - "CpuShares": 0, - "Cpuset": "", - "Domainname": "", - "Entrypoint": null, - "Env": [ ], - "ExposedPorts": { }, - "Hostname": "469e5edd8d5b", - "Image": "jenkinsci/workflow-demo", - "Labels": {}, - "MacAddress": "", - "Memory": 0, - "MemorySwap": 0, - "NetworkDisabled": false, - "OnBuild": null, - "OpenStdin": true, - "PortSpecs": null, - "StdinOnce": true, - "Tty": true, - "User": "", - "Volumes": null, - "WorkingDir": "/var/lib/jenkins/workflow-plugin-pipeline-demo" - }, - "Created": "2015-04-29T11:55:42.968262967Z", - "Driver": "aufs", - "ExecDriver": "native-0.2", - "ExecIDs": null, - "HostConfig": { - "Binds": null, - "CapAdd": null, - "CapDrop": null, - "CgroupParent": "", - "ContainerIDFile": "", - "CpuShares": 0, - "CpusetCpus": "", - "Devices": [], - "Dns": null, - "DnsSearch": null, - "ExtraHosts": null, - "IpcMode": "", - "Links": null, - "LogConfig": { - "Config": null, - "Type": "json-file" +[ + { + "AppArmorProfile": "", + "Args": [], + "Config": { + "AttachStderr": true, + "AttachStdin": true, + "AttachStdout": true, + "Cmd": [], + "CpuShares": 0, + "Cpuset": "", + "Domainname": "", + "Entrypoint": null, + "Env": [], + "ExposedPorts": {}, + "Hostname": "469e5edd8d5b", + "Image": "jenkinsci/workflow-demo", + "Labels": {}, + "MacAddress": "", + "Memory": 0, + "MemorySwap": 0, + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": true, + "PortSpecs": null, + "StdinOnce": true, + "Tty": true, + "User": "", + "Volumes": null, + "WorkingDir": "/var/lib/jenkins/workflow-plugin-pipeline-demo" }, - "LxcConf": [], - "Memory": 0, - "MemorySwap": 0, - "NetworkMode": "bridge", - "PidMode": "", - "PortBindings": { - "8080/tcp": [ ] + "Created": "2015-04-29T11:55:42.968262967Z", + "Driver": "aufs", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "CapAdd": null, + "CapDrop": null, + "CgroupParent": "", + "ContainerIDFile": "", + "CpuShares": 0, + "CpusetCpus": "", + "Devices": [], + "Dns": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": { + "8080/tcp": [] + }, + "Privileged": false, + "PublishAllPorts": false, + "ReadonlyRootfs": false, + "RestartPolicy": { + "MaximumRetryCount": 0, + "Name": "" + }, + "SecurityOpt": null, + "Ulimits": null, + "VolumesFrom": null }, - "Privileged": false, - "PublishAllPorts": false, - "ReadonlyRootfs": false, - "RestartPolicy": { - "MaximumRetryCount": 0, - "Name": "" + "HostnamePath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hostname", + "HostsPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hosts", + "Id": "469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1", + "Image": "4300417211ebb75b48b06ed5640d641778f312072d24b37978682345cbb362b1", + "LogPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1-json.log", + "MountLabel": "", + "Name": "/desperate_babbage", + "NetworkSettings": { + "Bridge": "docker0", + "Gateway": "172.17.42.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "LinkLocalIPv6Address": "fe80::42:acff:fe11:2", + "LinkLocalIPv6PrefixLen": 64, + "MacAddress": "02:42:ac:11:00:02", + "PortMapping": null, + "Ports": { + "22/tcp": null, + "8080/tcp": [] + } }, - "SecurityOpt": null, - "Ulimits": null, - "VolumesFrom": null - }, - "HostnamePath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hostname", - "HostsPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hosts", - "Id": "469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1", - "Image": "4300417211ebb75b48b06ed5640d641778f312072d24b37978682345cbb362b1", - "LogPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1-json.log", - "MountLabel": "", - "Name": "/desperate_babbage", - "NetworkSettings": { - "Bridge": "docker0", - "Gateway": "172.17.42.1", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "LinkLocalIPv6Address": "fe80::42:acff:fe11:2", - "LinkLocalIPv6PrefixLen": 64, - "MacAddress": "02:42:ac:11:00:02", - "PortMapping": null, - "Ports": { - "22/tcp": null, - "8080/tcp": [ ] - } - }, - "Path": "/bin/sh", - "ProcessLabel": "", - "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/resolv.conf", - "RestartCount": 0, - "State": { - "Dead": false, - "Error": "", - "ExitCode": 0, - "FinishedAt": "0001-01-01T00:00:00Z", - "OOMKilled": false, - "Paused": false, - "Pid": 898, - "Restarting": false, - "Running": true, - "StartedAt": "2015-04-29T11:55:43.464717907Z" - }, - "Volumes": {}, - "VolumesRW": {} -} + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/resolv.conf", + "RestartCount": 0, + "State": { + "Dead": false, + "Error": "", + "ExitCode": 0, + "FinishedAt": "0001-01-01T00:00:00Z", + "OOMKilled": false, + "Paused": false, + "Pid": 898, + "Restarting": false, + "Running": true, + "StartedAt": "2015-04-29T11:55:43.464717907Z" + }, + "Volumes": {}, + "VolumesRW": {} + } ] diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full.json b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full.json index c4383ef14..7fcb59817 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full.json @@ -1,153 +1,160 @@ -[{ - "AppArmorProfile": "", - "Args": [ - "-c", - "/var/lib/jenkins/run.sh" - ], - "Config": { - "AttachStderr": true, - "AttachStdin": true, - "AttachStdout": true, - "Cmd": [ - "/bin/sh", +[ + { + "AppArmorProfile": "", + "Args": [ "-c", "/var/lib/jenkins/run.sh" ], - "CpuShares": 0, - "Cpuset": "", - "Domainname": "", - "Entrypoint": null, - "Env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "MAVEN_VERSION=3.3.1", - "JETTY_VERSION=9.2.9.v20150224", - "REV=107ea141f5c7581056c6eb53d2ccd222cdf0d58c" - ], - "ExposedPorts": { - "22/tcp": {}, - "8080/tcp": {}, - "8081/tcp": {} + "Config": { + "AttachStderr": true, + "AttachStdin": true, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "/var/lib/jenkins/run.sh" + ], + "CpuShares": 0, + "Cpuset": "", + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "MAVEN_VERSION=3.3.1", + "JETTY_VERSION=9.2.9.v20150224", + "REV=107ea141f5c7581056c6eb53d2ccd222cdf0d58c" + ], + "ExposedPorts": { + "22/tcp": {}, + "8080/tcp": {}, + "8081/tcp": {} + }, + "Hostname": "469e5edd8d5b", + "Image": "jenkinsci/workflow-demo", + "Labels": {}, + "MacAddress": "", + "Memory": 0, + "MemorySwap": 0, + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": true, + "PortSpecs": null, + "StdinOnce": true, + "Tty": true, + "User": "", + "Volumes": null, + "WorkingDir": "/var/lib/jenkins/workflow-plugin-pipeline-demo" }, - "Hostname": "469e5edd8d5b", - "Image": "jenkinsci/workflow-demo", - "Labels": {}, - "MacAddress": "", - "Memory": 0, - "MemorySwap": 0, - "NetworkDisabled": false, - "OnBuild": null, - "OpenStdin": true, - "PortSpecs": null, - "StdinOnce": true, - "Tty": true, - "User": "", - "Volumes": null, - "WorkingDir": "/var/lib/jenkins/workflow-plugin-pipeline-demo" - }, - "Created": "2015-04-29T11:55:42.968262967Z", - "Driver": "aufs", - "ExecDriver": "native-0.2", - "ExecIDs": null, - "HostConfig": { - "Binds": null, - "CapAdd": null, - "CapDrop": null, - "CgroupParent": "", - "ContainerIDFile": "", - "CpuShares": 0, - "CpusetCpus": "", - "Devices": [], - "Dns": null, - "DnsSearch": null, - "ExtraHosts": null, - "IpcMode": "", - "Links": null, - "LogConfig": { - "Config": null, - "Type": "json-file" + "Created": "2015-04-29T11:55:42.968262967Z", + "Driver": "aufs", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "CapAdd": null, + "CapDrop": null, + "CgroupParent": "", + "ContainerIDFile": "", + "CpuShares": 0, + "CpusetCpus": "", + "Devices": [], + "Dns": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": { + "8080/tcp": [ + { + "HostIp": "", + "HostPort": "8080" + } + ], + "8081/tcp": [ + { + "HostIp": "", + "HostPort": "8081" + } + ] + }, + "Privileged": false, + "PublishAllPorts": false, + "ReadonlyRootfs": false, + "RestartPolicy": { + "MaximumRetryCount": 0, + "Name": "" + }, + "SecurityOpt": null, + "Ulimits": null, + "VolumesFrom": null }, - "LxcConf": [], - "Memory": 0, - "MemorySwap": 0, - "NetworkMode": "bridge", - "PidMode": "", - "PortBindings": { - "8080/tcp": [ - { - "HostIp": "", - "HostPort": "8080" - } - ], - "8081/tcp": [ - { - "HostIp": "", - "HostPort": "8081" - } - ] + "HostnamePath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hostname", + "HostsPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hosts", + "Id": "469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1", + "Image": "4300417211ebb75b48b06ed5640d641778f312072d24b37978682345cbb362b1", + "LogPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1-json.log", + "MountLabel": "", + "Name": "/desperate_babbage", + "NetworkSettings": { + "Bridge": "docker0", + "Gateway": "172.17.42.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "LinkLocalIPv6Address": "fe80::42:acff:fe11:2", + "LinkLocalIPv6PrefixLen": 64, + "MacAddress": "02:42:ac:11:00:02", + "PortMapping": null, + "Ports": { + "22/tcp": null, + "8080/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "8080" + } + ], + "8081/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "8081" + } + ] + } }, - "Privileged": false, - "PublishAllPorts": false, - "ReadonlyRootfs": false, - "RestartPolicy": { - "MaximumRetryCount": 0, - "Name": "" + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/resolv.conf", + "RestartCount": 0, + "State": { + "Dead": false, + "Error": "", + "ExitCode": 0, + "FinishedAt": "0001-01-01T00:00:00Z", + "OOMKilled": false, + "Paused": false, + "Pid": 898, + "Restarting": false, + "Running": true, + "StartedAt": "2015-04-29T11:55:43.464717907Z" }, - "SecurityOpt": null, - "Ulimits": null, - "VolumesFrom": null - }, - "HostnamePath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hostname", - "HostsPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/hosts", - "Id": "469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1", - "Image": "4300417211ebb75b48b06ed5640d641778f312072d24b37978682345cbb362b1", - "LogPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1-json.log", - "MountLabel": "", - "Name": "/desperate_babbage", - "NetworkSettings": { - "Bridge": "docker0", - "Gateway": "172.17.42.1", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "LinkLocalIPv6Address": "fe80::42:acff:fe11:2", - "LinkLocalIPv6PrefixLen": 64, - "MacAddress": "02:42:ac:11:00:02", - "PortMapping": null, - "Ports": { - "22/tcp": null, - "8080/tcp": [ - { - "HostIp": "0.0.0.0", - "HostPort": "8080" - } - ], - "8081/tcp": [ - { - "HostIp": "0.0.0.0", - "HostPort": "8081" - } - ] + "Volumes": { + "/foo/bar/myvol": "/path1", + "/bar/foo/myvol2": "/path2" + }, + "VolumesRW": { + "/foo/bar/myvol": true, + "/bar/foo/myvol2": false } - }, - "Path": "/bin/sh", - "ProcessLabel": "", - "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/469e5edd8d5b33e3c905a7ffc97360ec6ee211d6782815fbcd144568045819e1/resolv.conf", - "RestartCount": 0, - "State": { - "Dead": false, - "Error": "", - "ExitCode": 0, - "FinishedAt": "0001-01-01T00:00:00Z", - "OOMKilled": false, - "Paused": false, - "Pid": 898, - "Restarting": false, - "Running": true, - "StartedAt": "2015-04-29T11:55:43.464717907Z" - }, - "Volumes": { "/foo/bar/myvol":"/path1", "/bar/foo/myvol2":"/path2" }, - "VolumesRW": { "/foo/bar/myvol": true, "/bar/foo/myvol2": false } -} + } ] diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_21.json b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_21.json index 92ee66d54..94b0ef743 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_21.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_21.json @@ -1,143 +1,143 @@ [ - { - "Id": "fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045", - "Created": "2015-11-20T21:10:34.775649753Z", - "Path": "cat", - "Args": [], - "State": { - "Status": "running", - "Running": true, - "Paused": false, - "Restarting": false, - "OOMKilled": false, - "Dead": false, - "Pid": 10912, - "ExitCode": 0, - "Error": "", - "StartedAt": "2015-11-20T21:10:34.845546358Z", - "FinishedAt": "0001-01-01T00:00:00Z" - }, - "Image": "c51f86c283408d1749d066333f7acd5d33b053b003a61ff6a7b36819ddcbc7b7", - "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/resolv.conf", - "HostnamePath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hostname", - "HostsPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hosts", - "LogPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045-json.log", - "Name": "/small_hodgkin", - "RestartCount": 0, - "Driver": "aufs", - "ExecDriver": "native-0.2", - "MountLabel": "", - "ProcessLabel": "", - "AppArmorProfile": "", - "ExecIDs": null, - "HostConfig": { - "Binds": null, - "ContainerIDFile": "", - "LxcConf": [], - "Memory": 0, - "MemoryReservation": 0, - "MemorySwap": 0, - "KernelMemory": 0, - "CpuShares": 0, - "CpuPeriod": 0, - "CpusetCpus": "", - "CpusetMems": "", - "CpuQuota": 0, - "BlkioWeight": 0, - "OomKillDisable": false, - "MemorySwappiness": -1, - "Privileged": false, - "PortBindings": {}, - "Links": null, - "PublishAllPorts": false, - "Dns": null, - "DnsOptions": null, - "DnsSearch": null, - "ExtraHosts": null, - "VolumesFrom": null, - "Devices": [], - "NetworkMode": "default", - "IpcMode": "", - "PidMode": "", - "UTSMode": "", - "CapAdd": null, - "CapDrop": null, - "GroupAdd": null, - "RestartPolicy": { - "Name": "no", - "MaximumRetryCount": 0 - }, - "SecurityOpt": null, - "ReadonlyRootfs": false, - "Ulimits": null, - "LogConfig": { - "Type": "json-file", - "Config": {} - }, - "CgroupParent": "", - "ConsoleSize": [ - 0, - 0 - ], - "VolumeDriver": "" - }, - "GraphDriver": { - "Name": "aufs", - "Data": null - }, - "Mounts": [], - "Config": { - "Hostname": "fc1243c01bbb", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": true, - "StdinOnce": false, - "Env": null, - "Cmd": [ - "cat" - ], - "Image": "busybox", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": null, - "Labels": {}, - "StopSignal": "SIGTERM" - }, - "NetworkSettings": { - "Bridge": "", - "SandboxID": "5a6ded01bf23cc180e8ba6a059449ac832f28fa1d8367127e316607f92d3228c", - "HairpinMode": false, - "LinkLocalIPv6Address": "", - "LinkLocalIPv6PrefixLen": 0, - "Ports": {}, - "SandboxKey": "/var/run/docker/netns/5a6ded01bf23", - "SecondaryIPAddresses": null, - "SecondaryIPv6Addresses": null, - "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", - "Gateway": "172.17.0.1", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "MacAddress": "02:42:ac:11:00:02", - "Networks": { - "bridge": { - "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", - "Gateway": "172.17.0.1", - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "MacAddress": "02:42:ac:11:00:02" + { + "Id": "fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045", + "Created": "2015-11-20T21:10:34.775649753Z", + "Path": "cat", + "Args": [], + "State": { + "Status": "running", + "Running": true, + "Paused": false, + "Restarting": false, + "OOMKilled": false, + "Dead": false, + "Pid": 10912, + "ExitCode": 0, + "Error": "", + "StartedAt": "2015-11-20T21:10:34.845546358Z", + "FinishedAt": "0001-01-01T00:00:00Z" + }, + "Image": "c51f86c283408d1749d066333f7acd5d33b053b003a61ff6a7b36819ddcbc7b7", + "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/resolv.conf", + "HostnamePath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hostname", + "HostsPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hosts", + "LogPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045-json.log", + "Name": "/small_hodgkin", + "RestartCount": 0, + "Driver": "aufs", + "ExecDriver": "native-0.2", + "MountLabel": "", + "ProcessLabel": "", + "AppArmorProfile": "", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Memory": 0, + "MemoryReservation": 0, + "MemorySwap": 0, + "KernelMemory": 0, + "CpuShares": 0, + "CpuPeriod": 0, + "CpusetCpus": "", + "CpusetMems": "", + "CpuQuota": 0, + "BlkioWeight": 0, + "OomKillDisable": false, + "MemorySwappiness": -1, + "Privileged": false, + "PortBindings": {}, + "Links": null, + "PublishAllPorts": false, + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "VolumesFrom": null, + "Devices": [], + "NetworkMode": "default", + "IpcMode": "", + "PidMode": "", + "UTSMode": "", + "CapAdd": null, + "CapDrop": null, + "GroupAdd": null, + "RestartPolicy": { + "Name": "no", + "MaximumRetryCount": 0 + }, + "SecurityOpt": null, + "ReadonlyRootfs": false, + "Ulimits": null, + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "CgroupParent": "", + "ConsoleSize": [ + 0, + 0 + ], + "VolumeDriver": "" + }, + "GraphDriver": { + "Name": "aufs", + "Data": null + }, + "Mounts": [], + "Config": { + "Hostname": "fc1243c01bbb", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "cat" + ], + "Image": "busybox", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": {}, + "StopSignal": "SIGTERM" + }, + "NetworkSettings": { + "Bridge": "", + "SandboxID": "5a6ded01bf23cc180e8ba6a059449ac832f28fa1d8367127e316607f92d3228c", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": {}, + "SandboxKey": "/var/run/docker/netns/5a6ded01bf23", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, + "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", + "Gateway": "172.17.0.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "MacAddress": "02:42:ac:11:00:02", + "Networks": { + "bridge": { + "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } } - } } - } ] diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26a.json b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26a.json index 688ea2689..35fbf55b9 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26a.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26a.json @@ -1,156 +1,156 @@ [ - { - "Driver" : "aufs", - "Path" : "docker-entrypoint.sh", - "Args" : [ - "postgres" - ], - "SizeRootFs" : null, - "SizeRw" : null, - "HostConfig" : { - "KernelMemory" : 0, - "MemorySwappiness" : -1, - "PidMode" : "", - "CpuPeriod" : 0, - "LogConfig" : { - "Type" : "json-file", - "Config" : {} - }, - "ReadonlyRootfs" : false, - "CgroupParent" : "", - "PublishAllPorts" : false, - "VolumeDriver" : "", - "NetworkMode" : "default", - "BlkioWeight" : 0, - "OomKillDisable" : false, - "Privileged" : false, - "CpusetMems" : "", - "ContainerIDFile" : "", - "ShmSize" : 67108864, - "CpusetCpus" : "", - "CpuShares" : 0, - "PidsLimit" : 0, - "RestartPolicy" : { - "Name" : "", - "MaximumRetryCount" : 0 - }, - "Memory" : 0, - "MemorySwap" : 0, - "CpuQuota" : 0, - "OomScoreAdj" : 500, - "MemoryReservation" : 0 - }, - "Id" : "58fd1abe8e43a65fb6231b76a9678e7bb4e91686f838945e782a4b74119ce959", - "Volumes" : null, - "State" : { - "Pid" : 0, - "ExitCode" : 0, - "FinishedAt" : "0001-01-01T00:00:00Z", - "Paused" : false, - "Error" : "", - "Status" : "created", - "OOMKilled" : false, - "Health" : null, - "oomkilled" : false, - "StartedAt" : "0001-01-01T00:00:00Z", - "Dead" : false, - "Running" : false, - "Restarting" : false - }, - "Config" : { - "OpenStdin" : false, - "Hostname" : "58fd1abe8e43", - "StdinOnce" : false, - "Domainname" : "", - "Env" : [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin", - "GOSU_VERSION=1.10", - "LANG=en_US.utf8", - "PG_MAJOR=10", - "PG_VERSION=10.4-2.pgdg90+1", - "PGDATA=/var/lib/postgresql/data" - ], - "Entrypoint" : [ - "docker-entrypoint.sh" - ], - "User" : "", - "AttachStdout" : false, - "Cmd" : [ - "postgres" - ], - "ExposedPorts" : { - "5432/tcp" : {} - }, - "Image" : "postgres:latest", - "AttachStderr" : false, - "Labels" : {}, - "Volumes" : { - "/var/lib/postgresql/data" : {} - }, - "Tty" : false, - "WorkingDir" : "", - "AttachStdin" : false - }, - "ProcessLabel" : "", - "HostsPath" : "", - "Name" : "/fmi-test01", - "ExecDriver" : null, - "LogPath" : "", - "ExecIDs" : null, - "MountLabel" : "", - "Created" : "2018-05-30T08:37:12.308001081Z", - "Image" : "sha256:61d053fc271ce1313896a2edf7719fb3b68637b53397e61d8114793b39e9ae65", - "ResolvConfPath" : "", - "HostnamePath" : "", - "RestartCount" : 0, - "NetworkSettings" : { - "GlobalIPv6PrefixLen" : 0, - "LinkLocalIPv6PrefixLen" : 0, - "EndpointID" : "", - "SandboxID" : "", - "GlobalIPv6Address" : "", - "LinkLocalIPv6Address" : "", - "HairpinMode" : false, - "PortMapping" : null, - "SecondaryIPv6Addresses" : null, - "SecondaryIPAddresses" : null, - "Gateway" : "", - "Ports" : null, - "MacAddress" : "", - "Networks" : { - "bridge" : { - "IPv6Gateway" : "", - "IPPrefixLen" : 0, - "GlobalIPv6Address" : "", - "IPAddress" : "", - "EndpointID" : "", - "Aliases" : null, - "GlobalIPv6PrefixLen" : 0, - "Gateway" : "", - "NetworkID" : "", - "IPAMConfig" : null, - "Links" : null, - "MacAddress" : "" - } - }, - "IPAddress" : "", - "Bridge" : "", - "IPPrefixLen" : 0, - "IPv6Gateway" : "", - "SandboxKey" : "" - }, - "VolumesRW" : null, - "Mounts" : [ - { - "RW" : true, - "Driver" : "local", - "Name" : "d9e76cbb4f797b0b8d62f5f4cd46ee6502fc520c6ce1187a62d200bc8364dd74", - "Source" : "/var/lib/docker/volumes/d9e76cbb4f797b0b8d62f5f4cd46ee6502fc520c6ce1187a62d200bc8364dd74/_data", - "Mode" : "", - "Destination" : { - "path" : "/var/lib/postgresql/data" - } - } - ] - } + { + "Driver": "aufs", + "Path": "docker-entrypoint.sh", + "Args": [ + "postgres" + ], + "SizeRootFs": null, + "SizeRw": null, + "HostConfig": { + "KernelMemory": 0, + "MemorySwappiness": -1, + "PidMode": "", + "CpuPeriod": 0, + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "ReadonlyRootfs": false, + "CgroupParent": "", + "PublishAllPorts": false, + "VolumeDriver": "", + "NetworkMode": "default", + "BlkioWeight": 0, + "OomKillDisable": false, + "Privileged": false, + "CpusetMems": "", + "ContainerIDFile": "", + "ShmSize": 67108864, + "CpusetCpus": "", + "CpuShares": 0, + "PidsLimit": 0, + "RestartPolicy": { + "Name": "", + "MaximumRetryCount": 0 + }, + "Memory": 0, + "MemorySwap": 0, + "CpuQuota": 0, + "OomScoreAdj": 500, + "MemoryReservation": 0 + }, + "Id": "58fd1abe8e43a65fb6231b76a9678e7bb4e91686f838945e782a4b74119ce959", + "Volumes": null, + "State": { + "Pid": 0, + "ExitCode": 0, + "FinishedAt": "0001-01-01T00:00:00Z", + "Paused": false, + "Error": "", + "Status": "created", + "OOMKilled": false, + "Health": null, + "oomkilled": false, + "StartedAt": "0001-01-01T00:00:00Z", + "Dead": false, + "Running": false, + "Restarting": false + }, + "Config": { + "OpenStdin": false, + "Hostname": "58fd1abe8e43", + "StdinOnce": false, + "Domainname": "", + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin", + "GOSU_VERSION=1.10", + "LANG=en_US.utf8", + "PG_MAJOR=10", + "PG_VERSION=10.4-2.pgdg90+1", + "PGDATA=/var/lib/postgresql/data" + ], + "Entrypoint": [ + "docker-entrypoint.sh" + ], + "User": "", + "AttachStdout": false, + "Cmd": [ + "postgres" + ], + "ExposedPorts": { + "5432/tcp": {} + }, + "Image": "postgres:latest", + "AttachStderr": false, + "Labels": {}, + "Volumes": { + "/var/lib/postgresql/data": {} + }, + "Tty": false, + "WorkingDir": "", + "AttachStdin": false + }, + "ProcessLabel": "", + "HostsPath": "", + "Name": "/fmi-test01", + "ExecDriver": null, + "LogPath": "", + "ExecIDs": null, + "MountLabel": "", + "Created": "2018-05-30T08:37:12.308001081Z", + "Image": "sha256:61d053fc271ce1313896a2edf7719fb3b68637b53397e61d8114793b39e9ae65", + "ResolvConfPath": "", + "HostnamePath": "", + "RestartCount": 0, + "NetworkSettings": { + "GlobalIPv6PrefixLen": 0, + "LinkLocalIPv6PrefixLen": 0, + "EndpointID": "", + "SandboxID": "", + "GlobalIPv6Address": "", + "LinkLocalIPv6Address": "", + "HairpinMode": false, + "PortMapping": null, + "SecondaryIPv6Addresses": null, + "SecondaryIPAddresses": null, + "Gateway": "", + "Ports": null, + "MacAddress": "", + "Networks": { + "bridge": { + "IPv6Gateway": "", + "IPPrefixLen": 0, + "GlobalIPv6Address": "", + "IPAddress": "", + "EndpointID": "", + "Aliases": null, + "GlobalIPv6PrefixLen": 0, + "Gateway": "", + "NetworkID": "", + "IPAMConfig": null, + "Links": null, + "MacAddress": "" + } + }, + "IPAddress": "", + "Bridge": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "SandboxKey": "" + }, + "VolumesRW": null, + "Mounts": [ + { + "RW": true, + "Driver": "local", + "Name": "d9e76cbb4f797b0b8d62f5f4cd46ee6502fc520c6ce1187a62d200bc8364dd74", + "Source": "/var/lib/docker/volumes/d9e76cbb4f797b0b8d62f5f4cd46ee6502fc520c6ce1187a62d200bc8364dd74/_data", + "Mode": "", + "Destination": { + "path": "/var/lib/postgresql/data" + } + } + ] + } ] diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26b.json b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26b.json index 916ab3e9c..48413a7b8 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26b.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/command/inspectContainerResponse_full_1_26b.json @@ -1,180 +1,180 @@ [ - { - "HostsPath" : "", - "RestartCount" : 0, - "ProcessLabel" : "", - "Args" : [], - "GraphDriver" : { - "Name" : "aufs", - "Data" : null - }, - "Config" : { - "OpenStdin" : false, - "Volumes" : { - "/srv/test" : {} - }, - "User" : "", - "Image" : "busybox:latest", - "Entrypoint" : null, - "Tty" : false, - "Env" : [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - ], - "StdinOnce" : false, - "OnBuild" : null, - "Hostname" : "812f8c0d2342", - "Domainname" : "", - "AttachStdout" : false, - "Cmd" : [ - "true" - ], - "AttachStdin" : false, - "WorkingDir" : "", - "AttachStderr" : false, - "Labels" : {} - }, - "Driver" : "aufs", - "Image" : "sha256:8c811b4aec35f259572d0f79207bc0678df4c736eeec50bc9fec37ed936a472a", - "LogPath" : "", - "Mounts" : [ - { - "Source" : "/var/lib/docker/volumes/53690c8e68d587308c3b8c8c76a7912aecf5abd4851f555df687229ac625112f/_data", - "Name" : "53690c8e68d587308c3b8c8c76a7912aecf5abd4851f555df687229ac625112f", - "RW" : true, - "Type" : "volume", - "Destination" : "/srv/test", - "Driver" : "local", - "Propagation" : "", - "Mode" : "" - } - ], - "MountLabel" : "", - "ResolvConfPath" : "", - "AppArmorProfile" : "", - "NetworkSettings" : { - "MacAddress" : "", - "SecondaryIPv6Addresses" : null, - "LinkLocalIPv6PrefixLen" : 0, - "LinkLocalIPv6Address" : "", - "GlobalIPv6PrefixLen" : 0, - "Networks" : { - "bridge" : { - "GlobalIPv6Address" : "", - "NetworkID" : "", - "Gateway" : "", - "IPAddress" : "", - "IPPrefixLen" : 0, - "MacAddress" : "", - "EndpointID" : "", - "IPAMConfig" : null, - "IPv6Gateway" : "", - "GlobalIPv6PrefixLen" : 0, - "Aliases" : null, - "Links" : null + { + "HostsPath": "", + "RestartCount": 0, + "ProcessLabel": "", + "Args": [], + "GraphDriver": { + "Name": "aufs", + "Data": null + }, + "Config": { + "OpenStdin": false, + "Volumes": { + "/srv/test": {} + }, + "User": "", + "Image": "busybox:latest", + "Entrypoint": null, + "Tty": false, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "StdinOnce": false, + "OnBuild": null, + "Hostname": "812f8c0d2342", + "Domainname": "", + "AttachStdout": false, + "Cmd": [ + "true" + ], + "AttachStdin": false, + "WorkingDir": "", + "AttachStderr": false, + "Labels": {} + }, + "Driver": "aufs", + "Image": "sha256:8c811b4aec35f259572d0f79207bc0678df4c736eeec50bc9fec37ed936a472a", + "LogPath": "", + "Mounts": [ + { + "Source": "/var/lib/docker/volumes/53690c8e68d587308c3b8c8c76a7912aecf5abd4851f555df687229ac625112f/_data", + "Name": "53690c8e68d587308c3b8c8c76a7912aecf5abd4851f555df687229ac625112f", + "RW": true, + "Type": "volume", + "Destination": "/srv/test", + "Driver": "local", + "Propagation": "", + "Mode": "" + } + ], + "MountLabel": "", + "ResolvConfPath": "", + "AppArmorProfile": "", + "NetworkSettings": { + "MacAddress": "", + "SecondaryIPv6Addresses": null, + "LinkLocalIPv6PrefixLen": 0, + "LinkLocalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "Networks": { + "bridge": { + "GlobalIPv6Address": "", + "NetworkID": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "MacAddress": "", + "EndpointID": "", + "IPAMConfig": null, + "IPv6Gateway": "", + "GlobalIPv6PrefixLen": 0, + "Aliases": null, + "Links": null + } + }, + "SandboxKey": "", + "EndpointID": "", + "Bridge": "", + "IPPrefixLen": 0, + "Ports": null, + "IPAddress": "", + "IPv6Gateway": "", + "SandboxID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "SecondaryIPAddresses": null, + "HairpinMode": false + }, + "Name": "/elegant_mccarthy", + "Id": "812f8c0d2342c45bda537b856dd50f65f6c4cd13cded5231d0424edfb9132f38", + "HostConfig": { + "Dns": null, + "BlkioDeviceWriteBps": null, + "BlkioWeight": 0, + "CpuQuota": 0, + "ExtraHosts": null, + "NanoCpus": 0, + "KernelMemory": 0, + "MemorySwap": 0, + "CgroupParent": "", + "ShmSize": 67108864, + "CpuPercent": 0, + "DnsOptions": null, + "PidMode": "", + "BlkioDeviceWriteIOps": null, + "Devices": null, + "Binds": null, + "Memory": 0, + "RestartPolicy": { + "MaximumRetryCount": 0, + "Name": "" + }, + "IOMaximumIOps": 0, + "CpuRealtimeRuntime": 0, + "PublishAllPorts": false, + "CapAdd": null, + "ReadonlyRootfs": false, + "GroupAdd": null, + "MemoryReservation": 0, + "AutoRe ove": false, + "UsernsMode": "", + "Runtime": "runc", + "BlkioWeightDevice": null, + "Ulimits": null, + "Cgroup": "", + "NetworkMode": "default", + "CpusetCpus": "", + "Isolation": "", + "CpuCount": 0, + "CpuRealtimePeriod": 0, + "IOMaximumBandwidth": 0, + "IpcMode": "", + "OomKillDisable": false, + "OomScoreAdj": 0, + "SecurityOpt": null, + "MemorySwappiness": -1, + "ContainerIDFile": "", + "BlkioDeviceReadBps": null, + "CpusetMems": "", + "PortBindings": null, + "BlkioDeviceReadIOps": null, + "PidsLimit": 0, + "VolumesFrom": null, + "Links": null, + "Privileged": false, + "ConsoleSize": [ + 0, + 0 + ], + "DnsSearch": null, + "UTSMode": "", + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "CpuShares": 0, + "VolumeDriver": "", + "CpuPeriod": 0, + "CapDrop": null, + "DiskQuota": 0 + }, + "Created": "2018-06-04T08:09:33.086574793Z", + "HostnamePath": "", + "ExecIDs": null, + "Path": "true", + "State": { + "Error": "", + "Pid": 0, + "Running": false, + "Dead": false, + "OOMKilled": false, + "ExitCode": 0, + "StartedAt": "0001-01-01T00:00:00Z", + "Paused": false, + "Restarting": false, + "FinishedAt": "0001-01-01T00:00:00Z", + "Status": "created" } - }, - "SandboxKey" : "", - "EndpointID" : "", - "Bridge" : "", - "IPPrefixLen" : 0, - "Ports" : null, - "IPAddress" : "", - "IPv6Gateway" : "", - "SandboxID" : "", - "Gateway" : "", - "GlobalIPv6Address" : "", - "SecondaryIPAddresses" : null, - "HairpinMode" : false - }, - "Name" : "/elegant_mccarthy", - "Id" : "812f8c0d2342c45bda537b856dd50f65f6c4cd13cded5231d0424edfb9132f38", - "HostConfig" : { - "Dns" : null, - "BlkioDeviceWriteBps" : null, - "BlkioWeight" : 0, - "CpuQuota" : 0, - "ExtraHosts" : null, - "NanoCpus" : 0, - "KernelMemory" : 0, - "MemorySwap" : 0, - "CgroupParent" : "", - "ShmSize" : 67108864, - "CpuPercent" : 0, - "DnsOptions" : null, - "PidMode" : "", - "BlkioDeviceWriteIOps" : null, - "Devices" : null, - "Binds" : null, - "Memory" : 0, - "RestartPolicy" : { - "MaximumRetryCount" : 0, - "Name" : "" - }, - "IOMaximumIOps" : 0, - "CpuRealtimeRuntime" : 0, - "PublishAllPorts" : false, - "CapAdd" : null, - "ReadonlyRootfs" : false, - "GroupAdd" : null, - "MemoryReservation" : 0, - "AutoRe ove" : false, - "UsernsMode" : "", - "Runtime" : "runc", - "BlkioWeightDevice" : null, - "Ulimits" : null, - "Cgroup" : "", - "NetworkMode" : "default", - "CpusetCpus" : "", - "Isolation" : "", - "CpuCount" : 0, - "CpuRealtimePeriod" : 0, - "IOMaximumBandwidth" : 0, - "IpcMode" : "", - "OomKillDisable" : false, - "OomScoreAdj" : 0, - "SecurityOpt" : null, - "MemorySwappiness" : -1, - "ContainerIDFile" : "", - "BlkioDeviceReadBps" : null, - "CpusetMems" : "", - "PortBindings" : null, - "BlkioDeviceReadIOps" : null, - "PidsLimit" : 0, - "VolumesFrom" : null, - "Links" : null, - "Privileged" : false, - "ConsoleSize" : [ - 0, - 0 - ], - "DnsSearch" : null, - "UTSMode" : "", - "LogConfig" : { - "Type" : "json-file", - "Config" : {} - }, - "CpuShares" : 0, - "VolumeDriver" : "", - "CpuPeriod" : 0, - "CapDrop" : null, - "DiskQuota" : 0 - }, - "Created" : "2018-06-04T08:09:33.086574793Z", - "HostnamePath" : "", - "ExecIDs" : null, - "Path" : "true", - "State" : { - "Error" : "", - "Pid" : 0, - "Running" : false, - "Dead" : false, - "OOMKilled" : false, - "ExitCode" : 0, - "StartedAt" : "0001-01-01T00:00:00Z", - "Paused" : false, - "Restarting" : false, - "FinishedAt" : "0001-01-01T00:00:00Z", - "Status" : "created" } - } ] diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_alreadyExists.json b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_alreadyExists.json index ae318e29d..b039802a6 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_alreadyExists.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_alreadyExists.json @@ -1 +1,3 @@ -{"status":"Already exists"} +{ + "status": "Already exists" +} diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_error.json b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_error.json index f2ed0ddf2..adf1f457c 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_error.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_error.json @@ -1 +1,6 @@ -{"errorDetail":{"message":"Error: image cccxxx/xxxccc:latest not found"},"error":"Error: image cccxxx/xxxccc:latest not found"} +{ + "errorDetail": { + "message": "Error: image cccxxx/xxxccc:latest not found" + }, + "error": "Error: image cccxxx/xxxccc:latest not found" +} diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_legacy.json b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_legacy.json index 9c755cf5b..f5d42e036 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_legacy.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_legacy.json @@ -1 +1,3 @@ -{"status":"docker.com/xxxxcv/ccccxx: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker."} +{ + "status": "docker.com/xxxxcv/ccccxx: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker." +} diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_newerImage.json b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_newerImage.json index e5046c8b1..5bdd7f34c 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_newerImage.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_newerImage.json @@ -1 +1,3 @@ -{"status":"Downloaded newer image for docker.com/xxxxcv/ccccxx"} +{ + "status": "Downloaded newer image for docker.com/xxxxcv/ccccxx" +} diff --git a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_upToDate.json b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_upToDate.json index e821ce688..da7d730c0 100644 --- a/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_upToDate.json +++ b/docker-java/src/test/resources/com/github/dockerjava/api/model/pullImageResponse_upToDate.json @@ -1 +1,3 @@ -{"status":"Image is up to date for docker.com/xxxxcv/ccccxx"} +{ + "status": "Image is up to date for docker.com/xxxxcv/ccccxx" +} diff --git a/docker-java/src/test/resources/dockerContextHomeDir/.docker/config.json b/docker-java/src/test/resources/dockerContextHomeDir/.docker/config.json index 5bb2ebebe..e40e480af 100644 --- a/docker-java/src/test/resources/dockerContextHomeDir/.docker/config.json +++ b/docker-java/src/test/resources/dockerContextHomeDir/.docker/config.json @@ -1,4 +1,4 @@ { - "auths": {}, - "currentContext": "configcontext" + "auths": {}, + "currentContext": "configcontext" } diff --git a/docker-java/src/test/resources/logback.xml b/docker-java/src/test/resources/logback.xml index 8fb1a7a6d..210a46983 100644 --- a/docker-java/src/test/resources/logback.xml +++ b/docker-java/src/test/resources/logback.xml @@ -1,20 +1,20 @@ - - - %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n - - + + + %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n + + - - - - - + + + + + - - - + + + diff --git a/docker-java/src/test/resources/samples/1.22/containers/container/json/1.json b/docker-java/src/test/resources/samples/1.22/containers/container/json/1.json index 6cb71cc82..bb4173dca 100644 --- a/docker-java/src/test/resources/samples/1.22/containers/container/json/1.json +++ b/docker-java/src/test/resources/samples/1.22/containers/container/json/1.json @@ -1,151 +1,151 @@ { - "Id": "095351afe7b4995dfb3e965f9cfd3a07b1fe69198c50085a2cb7c2b5a5c9b62f", - "Created": "2016-02-16T22:40:51.465045919Z", - "Path": "echo", - "Args": [], - "State": { - "Status": "created", - "Running": false, - "Paused": false, - "Restarting": false, - "OOMKilled": false, - "Dead": false, - "Pid": 0, - "ExitCode": 0, - "Error": "", - "StartedAt": "0001-01-01T00:00:00Z", - "FinishedAt": "0001-01-01T00:00:00Z" - }, - "Image": "sha256:0cb40641836c461bc97c793971d84d758371ed682042457523e4ae701efe7ec9", - "ResolvConfPath": "", - "HostnamePath": "", - "HostsPath": "", - "LogPath": "", - "Name": "/drunk_golick", - "RestartCount": 0, - "Driver": "aufs", - "MountLabel": "", - "ProcessLabel": "", - "AppArmorProfile": "", - "ExecIDs": null, - "HostConfig": { - "Binds": null, - "ContainerIDFile": "", - "LogConfig": { - "Type": "json-file", - "Config": {} + "Id": "095351afe7b4995dfb3e965f9cfd3a07b1fe69198c50085a2cb7c2b5a5c9b62f", + "Created": "2016-02-16T22:40:51.465045919Z", + "Path": "echo", + "Args": [], + "State": { + "Status": "created", + "Running": false, + "Paused": false, + "Restarting": false, + "OOMKilled": false, + "Dead": false, + "Pid": 0, + "ExitCode": 0, + "Error": "", + "StartedAt": "0001-01-01T00:00:00Z", + "FinishedAt": "0001-01-01T00:00:00Z" }, - "NetworkMode": "default", - "PortBindings": null, - "RestartPolicy": { - "Name": "", - "MaximumRetryCount": 0 - }, - "VolumeDriver": "", - "VolumesFrom": null, - "CapAdd": null, - "CapDrop": null, - "Dns": null, - "DnsOptions": null, - "DnsSearch": null, - "ExtraHosts": null, - "GroupAdd": null, - "IpcMode": "", - "Links": null, - "OomScoreAdj": 0, - "PidMode": "", - "Privileged": false, - "PublishAllPorts": false, - "ReadonlyRootfs": false, - "SecurityOpt": null, - "UTSMode": "", - "ShmSize": 67108864, - "ConsoleSize": [ - 0, - 0 - ], - "Isolation": "", - "CpuShares": 0, - "CgroupParent": "", - "BlkioWeight": 0, - "BlkioWeightDevice": null, - "BlkioDeviceReadBps": null, - "BlkioDeviceWriteBps": null, - "BlkioDeviceReadIOps": null, - "BlkioDeviceWriteIOps": null, - "CpuPeriod": 0, - "CpuQuota": 0, - "CpusetCpus": "", - "CpusetMems": "", - "Devices": null, - "KernelMemory": 0, - "Memory": 0, - "MemoryReservation": 0, - "MemorySwap": 0, - "MemorySwappiness": -1, - "OomKillDisable": false, - "PidsLimit": 0, - "Ulimits": null - }, - "GraphDriver": { - "Name": "aufs", - "Data": null - }, - "Mounts": [], - "Config": { - "Hostname": "095351afe7b4", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": null, - "Cmd": [ - "echo" - ], - "Image": "busybox", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": null, - "Labels": {} - }, - "NetworkSettings": { - "Bridge": "", - "SandboxID": "", - "HairpinMode": false, - "LinkLocalIPv6Address": "", - "LinkLocalIPv6PrefixLen": 0, - "Ports": null, - "SandboxKey": "", - "SecondaryIPAddresses": null, - "SecondaryIPv6Addresses": null, - "EndpointID": "", - "Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "IPAddress": "", - "IPPrefixLen": 0, - "IPv6Gateway": "", - "MacAddress": "", - "Networks": { - "bridge": { - "IPAMConfig": null, + "Image": "sha256:0cb40641836c461bc97c793971d84d758371ed682042457523e4ae701efe7ec9", + "ResolvConfPath": "", + "HostnamePath": "", + "HostsPath": "", + "LogPath": "", + "Name": "/drunk_golick", + "RestartCount": 0, + "Driver": "aufs", + "MountLabel": "", + "ProcessLabel": "", + "AppArmorProfile": "", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "NetworkMode": "default", + "PortBindings": null, + "RestartPolicy": { + "Name": "", + "MaximumRetryCount": 0 + }, + "VolumeDriver": "", + "VolumesFrom": null, + "CapAdd": null, + "CapDrop": null, + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "GroupAdd": null, + "IpcMode": "", "Links": null, - "Aliases": null, - "NetworkID": "", + "OomScoreAdj": 0, + "PidMode": "", + "Privileged": false, + "PublishAllPorts": false, + "ReadonlyRootfs": false, + "SecurityOpt": null, + "UTSMode": "", + "ShmSize": 67108864, + "ConsoleSize": [ + 0, + 0 + ], + "Isolation": "", + "CpuShares": 0, + "CgroupParent": "", + "BlkioWeight": 0, + "BlkioWeightDevice": null, + "BlkioDeviceReadBps": null, + "BlkioDeviceWriteBps": null, + "BlkioDeviceReadIOps": null, + "BlkioDeviceWriteIOps": null, + "CpuPeriod": 0, + "CpuQuota": 0, + "CpusetCpus": "", + "CpusetMems": "", + "Devices": null, + "KernelMemory": 0, + "Memory": 0, + "MemoryReservation": 0, + "MemorySwap": 0, + "MemorySwappiness": -1, + "OomKillDisable": false, + "PidsLimit": 0, + "Ulimits": null + }, + "GraphDriver": { + "Name": "aufs", + "Data": null + }, + "Mounts": [], + "Config": { + "Hostname": "095351afe7b4", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "echo" + ], + "Image": "busybox", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": {} + }, + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": null, + "SandboxKey": "", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "MacAddress": "" - } + "MacAddress": "", + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "", + "EndpointID": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "" + } + } } - } } diff --git a/docker-java/src/test/resources/samples/1.22/containers/container/update/docs.json b/docker-java/src/test/resources/samples/1.22/containers/container/update/docs.json index 9d26fcb2f..3961c8ba4 100644 --- a/docker-java/src/test/resources/samples/1.22/containers/container/update/docs.json +++ b/docker-java/src/test/resources/samples/1.22/containers/container/update/docs.json @@ -1,12 +1,12 @@ { - "BlkioWeight": 300, - "CpuShares": 512, - "CpuPeriod": 100000, - "CpuQuota": 50000, - "CpusetCpus": "0,1", - "CpusetMems": "0", - "Memory": 314572800, - "MemorySwap": 514288000, - "MemoryReservation": 209715200, - "KernelMemory": 52428800 + "BlkioWeight": 300, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0", + "Memory": 314572800, + "MemorySwap": 514288000, + "MemoryReservation": 209715200, + "KernelMemory": 52428800 } diff --git a/docker-java/src/test/resources/samples/1.22/containers/create/docs.json b/docker-java/src/test/resources/samples/1.22/containers/create/docs.json index 4bafc3cb5..310126212 100644 --- a/docker-java/src/test/resources/samples/1.22/containers/create/docs.json +++ b/docker-java/src/test/resources/samples/1.22/containers/create/docs.json @@ -1,131 +1,131 @@ { - "Hostname": "", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": true, - "AttachStderr": true, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": [ - "FOO=bar", - "BAZ=quux" - ], - "Cmd": [ - "date" - ], - "Entrypoint": "", - "Image": "ubuntu", - "Labels": { - "com.example.vendor": "Acme", - "com.example.license": "GPL", - "com.example.version": "1.0" - }, - "Mounts": [ - { - "Name": "fac362...80535", - "Source": "/data", - "Destination": "/data", - "Driver": "local", - "Mode": "ro,Z", - "RW": false, - "Propagation": "" - } - ], - "WorkingDir": "", - "NetworkDisabled": false, - "MacAddress": "12:34:56:78:9a:bc", - "ExposedPorts": { - "22/tcp": {} - }, - "StopSignal": "SIGTERM", - "HostConfig": { - "Binds": [ - "/tmp:/tmp" - ], - "Links": [ - "redis3:redis" - ], - "Memory": 0, - "MemorySwap": 0, - "MemoryReservation": 0, - "KernelMemory": 0, - "CpuShares": 512, - "CpuPeriod": 100000, - "CpuQuota": 50000, - "CpusetCpus": "0,1", - "CpusetMems": "0,1", - "BlkioWeight": 300, - "BlkioWeightDevice": [ - {} - ], - "BlkioDeviceReadBps": [ - {} - ], - "BlkioDeviceReadIOps": [ - {} - ], - "BlkioDeviceWriteBps": [ - {} - ], - "BlkioDeviceWriteIOps": [ - {} - ], - "MemorySwappiness": 60, - "OomKillDisable": false, - "OomScoreAdj": 500, - "PortBindings": { - "22/tcp": [ + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": "", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Mounts": [ { - "HostPort": "11022" + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" } - ] - }, - "PublishAllPorts": false, - "Privileged": false, - "ReadonlyRootfs": false, - "Dns": [ - "8.8.8.8" ], - "DnsOptions": [ - "" - ], - "DnsSearch": [ - "" - ], - "ExtraHosts": null, - "VolumesFrom": [ - "parent", - "other:ro" - ], - "CapAdd": [ - "NET_ADMIN" - ], - "CapDrop": [ - "MKNOD" - ], - "GroupAdd": [ - "newgroup" - ], - "RestartPolicy": { - "Name": "", - "MaximumRetryCount": 0 - }, - "NetworkMode": "bridge", - "Devices": [], - "Ulimits": [ - {} - ], - "LogConfig": { - "Type": "json-file", - "Config": {} + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} }, - "SecurityOpt": [ - "" - ], - "CgroupParent": "", - "VolumeDriver": "", - "ShmSize": 67108864 - } + "StopSignal": "SIGTERM", + "HostConfig": { + "Binds": [ + "/tmp:/tmp" + ], + "Links": [ + "redis3:redis" + ], + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0,1", + "BlkioWeight": 300, + "BlkioWeightDevice": [ + {} + ], + "BlkioDeviceReadBps": [ + {} + ], + "BlkioDeviceReadIOps": [ + {} + ], + "BlkioDeviceWriteBps": [ + {} + ], + "BlkioDeviceWriteIOps": [ + {} + ], + "MemorySwappiness": 60, + "OomKillDisable": false, + "OomScoreAdj": 500, + "PortBindings": { + "22/tcp": [ + { + "HostPort": "11022" + } + ] + }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": [ + "8.8.8.8" + ], + "DnsOptions": [ + "" + ], + "DnsSearch": [ + "" + ], + "ExtraHosts": null, + "VolumesFrom": [ + "parent", + "other:ro" + ], + "CapAdd": [ + "NET_ADMIN" + ], + "CapDrop": [ + "MKNOD" + ], + "GroupAdd": [ + "newgroup" + ], + "RestartPolicy": { + "Name": "", + "MaximumRetryCount": 0 + }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [ + {} + ], + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "SecurityOpt": [ + "" + ], + "CgroupParent": "", + "VolumeDriver": "", + "ShmSize": 67108864 + } } diff --git a/docker-java/src/test/resources/samples/1.22/containers/json/filter1.json b/docker-java/src/test/resources/samples/1.22/containers/json/filter1.json index 51329bb63..e7aec0f60 100644 --- a/docker-java/src/test/resources/samples/1.22/containers/json/filter1.json +++ b/docker-java/src/test/resources/samples/1.22/containers/json/filter1.json @@ -1,38 +1,38 @@ [ - { - "Id": "095351afe7b4995dfb3e965f9cfd3a07b1fe69198c50085a2cb7c2b5a5c9b62f", - "Names": [ - "/drunk_golick" - ], - "Image": "busybox", - "ImageID": "sha256:0cb40641836c461bc97c793971d84d758371ed682042457523e4ae701efe7ec9", - "Command": "echo", - "Created": 1455662451, - "Ports": [], - "SizeRootFs": 1113554, - "SizeRw": 0, - "Labels": {}, - "Status": "Up Less than a second", - "HostConfig": { - "NetworkMode": "default" - }, - "NetworkSettings": { - "Networks": { - "bridge": { - "IPAMConfig": null, - "Links": null, - "Aliases": null, - "NetworkID": "", - "EndpointID": "f69f5cff77b527c829bc45d71ba8c5eabca005ef3a8da8c7ee88c13ffc1ab602", - "Gateway": "172.17.0.1", - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "MacAddress": "02:42:ac:11:00:02" + { + "Id": "095351afe7b4995dfb3e965f9cfd3a07b1fe69198c50085a2cb7c2b5a5c9b62f", + "Names": [ + "/drunk_golick" + ], + "Image": "busybox", + "ImageID": "sha256:0cb40641836c461bc97c793971d84d758371ed682042457523e4ae701efe7ec9", + "Command": "echo", + "Created": 1455662451, + "Ports": [], + "SizeRootFs": 1113554, + "SizeRw": 0, + "Labels": {}, + "Status": "Up Less than a second", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "", + "EndpointID": "f69f5cff77b527c829bc45d71ba8c5eabca005ef3a8da8c7ee88c13ffc1ab602", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } } - } } - } ] diff --git a/docker-java/src/test/resources/samples/1.22/exec/ID/1.json b/docker-java/src/test/resources/samples/1.22/exec/ID/1.json index f06c807af..39639220f 100644 --- a/docker-java/src/test/resources/samples/1.22/exec/ID/1.json +++ b/docker-java/src/test/resources/samples/1.22/exec/ID/1.json @@ -1,18 +1,18 @@ { - "ID": "1ca2ca598fab202f86dd9281196c405456069013958a475396b707e85c56473b", - "Running": false, - "ExitCode": null, - "ProcessConfig": { - "tty": false, - "entrypoint": "/bin/bash", - "arguments": [], - "privileged": false, - "user": "" - }, - "OpenStdin": false, - "OpenStderr": true, - "OpenStdout": true, - "CanRemove": false, - "ContainerID": "ffa39805f089af3099e36452a985481f96170a9dff40be69d34d1722c7660d38", - "DetachKeys": "" + "ID": "1ca2ca598fab202f86dd9281196c405456069013958a475396b707e85c56473b", + "Running": false, + "ExitCode": null, + "ProcessConfig": { + "tty": false, + "entrypoint": "/bin/bash", + "arguments": [], + "privileged": false, + "user": "" + }, + "OpenStdin": false, + "OpenStderr": true, + "OpenStdout": true, + "CanRemove": false, + "ContainerID": "ffa39805f089af3099e36452a985481f96170a9dff40be69d34d1722c7660d38", + "DetachKeys": "" } diff --git a/docker-java/src/test/resources/samples/1.22/images/docImage/doc.json b/docker-java/src/test/resources/samples/1.22/images/docImage/doc.json index 4cbb269c4..5b76369d5 100644 --- a/docker-java/src/test/resources/samples/1.22/images/docImage/doc.json +++ b/docker-java/src/test/resources/samples/1.22/images/docImage/doc.json @@ -1,89 +1,89 @@ { - "Id": "85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", - "Container": "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", - "Comment": "", - "Os": "linux", - "Architecture": "amd64", - "Parent": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", - "ContainerConfig": { - "Tty": false, - "Hostname": "e611e15f9c9d", - "Volumes": null, - "Domainname": "", - "AttachStdout": false, - "PublishService": "", - "AttachStdin": false, - "OpenStdin": false, - "StdinOnce": false, - "NetworkDisabled": false, - "OnBuild": [], - "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", - "User": "", - "WorkingDir": "", - "Entrypoint": null, - "MacAddress": "", - "AttachStderr": false, - "Labels": { - "com.example.license": "GPL", - "com.example.version": "1.0", - "com.example.vendor": "Acme" + "Id": "85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", + "Container": "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", + "Comment": "", + "Os": "linux", + "Architecture": "amd64", + "Parent": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "ContainerConfig": { + "Tty": false, + "Hostname": "e611e15f9c9d", + "Volumes": null, + "Domainname": "", + "AttachStdout": false, + "PublishService": "", + "AttachStdin": false, + "OpenStdin": false, + "StdinOnce": false, + "NetworkDisabled": false, + "OnBuild": [], + "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "User": "", + "WorkingDir": "", + "Entrypoint": null, + "MacAddress": "", + "AttachStderr": false, + "Labels": { + "com.example.license": "GPL", + "com.example.version": "1.0", + "com.example.vendor": "Acme" + }, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Cmd": [ + "/bin/sh", + "-c", + "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" + ] }, - "Env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - ], - "ExposedPorts": null, - "Cmd": [ - "/bin/sh", - "-c", - "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" - ] - }, - "DockerVersion": "1.9.0-dev", - "VirtualSize": 188359297, - "Size": 0, - "Author": "", - "Created": "2015-09-10T08:30:53.26995814Z", - "GraphDriver": { - "Name": "aufs", - "Data": null - }, - "RepoDigests": [ - "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" - ], - "RepoTags": [ - "example:1.0", - "example:latest", - "example:stable" - ], - "Config": { - "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", - "NetworkDisabled": false, - "OnBuild": [], - "StdinOnce": false, - "PublishService": "", - "AttachStdin": false, - "OpenStdin": false, - "Domainname": "", - "AttachStdout": false, - "Tty": false, - "Hostname": "e611e15f9c9d", - "Volumes": null, - "Cmd": [ - "/bin/bash" + "DockerVersion": "1.9.0-dev", + "VirtualSize": 188359297, + "Size": 0, + "Author": "", + "Created": "2015-09-10T08:30:53.26995814Z", + "GraphDriver": { + "Name": "aufs", + "Data": null + }, + "RepoDigests": [ + "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" ], - "ExposedPorts": null, - "Env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + "RepoTags": [ + "example:1.0", + "example:latest", + "example:stable" ], - "Labels": { - "com.example.vendor": "Acme", - "com.example.version": "1.0", - "com.example.license": "GPL" - }, - "Entrypoint": null, - "MacAddress": "", - "AttachStderr": false, - "WorkingDir": "", - "User": "" - } + "Config": { + "Image": "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "NetworkDisabled": false, + "OnBuild": [], + "StdinOnce": false, + "PublishService": "", + "AttachStdin": false, + "OpenStdin": false, + "Domainname": "", + "AttachStdout": false, + "Tty": false, + "Hostname": "e611e15f9c9d", + "Volumes": null, + "Cmd": [ + "/bin/bash" + ], + "ExposedPorts": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Labels": { + "com.example.vendor": "Acme", + "com.example.version": "1.0", + "com.example.license": "GPL" + }, + "Entrypoint": null, + "MacAddress": "", + "AttachStderr": false, + "WorkingDir": "", + "User": "" + } } diff --git a/docker-java/src/test/resources/samples/1.22/images/docImage/inspect_doc.json b/docker-java/src/test/resources/samples/1.22/images/docImage/inspect_doc.json index 5ffc187cb..015a791ae 100644 --- a/docker-java/src/test/resources/samples/1.22/images/docImage/inspect_doc.json +++ b/docker-java/src/test/resources/samples/1.22/images/docImage/inspect_doc.json @@ -1,150 +1,150 @@ { - "Id": "d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", - "Created": "2015-06-08T16:18:02.505155285Z", - "Path": "bash", - "Args": [], - "State": { - "Running": false, - "Paused": false, - "Restarting": false, - "OOMKilled": false, - "Dead": false, - "Pid": 0, - "ExitCode": 0, - "Error": "", - "StartedAt": "2015-06-08T16:18:03.643865954Z", - "FinishedAt": "2015-06-08T16:57:06.448552862Z" - }, - "Image": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", - "NetworkSettings": { - "Bridge": "", - "SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f", - "HairpinMode": false, - "LinkLocalIPv6Address": "", - "LinkLocalIPv6PrefixLen": 0, - "Ports": {}, - "SandboxKey": "/var/run/docker/netns/6b4851d1903e", - "SecondaryIPAddresses": null, - "SecondaryIPv6Addresses": null, - "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", - "Gateway": "172.17.0.1", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "MacAddress": "02:42:ac:12:00:02", - "Networks": { - "bridge": { - "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "Id": "d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", + "Created": "2015-06-08T16:18:02.505155285Z", + "Path": "bash", + "Args": [], + "State": { + "Running": false, + "Paused": false, + "Restarting": false, + "OOMKilled": false, + "Dead": false, + "Pid": 0, + "ExitCode": 0, + "Error": "", + "StartedAt": "2015-06-08T16:18:03.643865954Z", + "FinishedAt": "2015-06-08T16:57:06.448552862Z" + }, + "Image": "ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": {}, + "SandboxKey": "/var/run/docker/netns/6b4851d1903e", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", "Gateway": "172.17.0.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "MacAddress": "02:42:ac:12:00:02" - } - } - }, - "ResolvConfPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf", - "HostnamePath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname", - "HostsPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts", - "LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log", - "Name": "/adoring_wozniak", - "RestartCount": 0, - "Driver": "devicemapper", - "MountLabel": "", - "ProcessLabel": "", - "Mounts": [ - { - "Source": "/data", - "Destination": "/data", - "Mode": "ro,Z", - "RW": false, - "Propagation": "" - } - ], - "AppArmorProfile": "", - "ExecIDs": null, - "HostConfig": { - "Binds": null, - "ContainerIDFile": "", - "Memory": 0, - "MemorySwap": 0, - "CpuShares": 0, - "CpuPeriod": 0, - "CpusetCpus": "", - "CpusetMems": "", - "CpuQuota": 0, - "BlkioWeight": 0, - "OomKillDisable": false, - "Privileged": false, - "PortBindings": {}, - "Links": null, - "PublishAllPorts": false, - "Dns": null, - "DnsSearch": null, - "DnsOptions": null, - "ExtraHosts": null, - "VolumesFrom": null, - "Devices": [], - "NetworkMode": "bridge", - "IpcMode": "", - "PidMode": "", - "UTSMode": "", - "CapAdd": null, - "CapDrop": null, - "RestartPolicy": { - "Name": "no", - "MaximumRetryCount": 0 + "MacAddress": "02:42:ac:12:00:02", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } }, - "SecurityOpt": null, - "ReadonlyRootfs": false, - "Ulimits": null, - "LogConfig": { - "Type": "json-file", - "Config": {} + "ResolvConfPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf", + "HostnamePath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname", + "HostsPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts", + "LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log", + "Name": "/adoring_wozniak", + "RestartCount": 0, + "Driver": "devicemapper", + "MountLabel": "", + "ProcessLabel": "", + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ], + "AppArmorProfile": "", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 0, + "CpuPeriod": 0, + "CpusetCpus": "", + "CpusetMems": "", + "CpuQuota": 0, + "BlkioWeight": 0, + "OomKillDisable": false, + "Privileged": false, + "PortBindings": {}, + "Links": null, + "PublishAllPorts": false, + "Dns": null, + "DnsSearch": null, + "DnsOptions": null, + "ExtraHosts": null, + "VolumesFrom": null, + "Devices": [], + "NetworkMode": "bridge", + "IpcMode": "", + "PidMode": "", + "UTSMode": "", + "CapAdd": null, + "CapDrop": null, + "RestartPolicy": { + "Name": "no", + "MaximumRetryCount": 0 + }, + "SecurityOpt": null, + "ReadonlyRootfs": false, + "Ulimits": null, + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "CgroupParent": "" }, - "CgroupParent": "" - }, - "GraphDriver": { - "Name": "devicemapper", - "Data": { - "DeviceId": "5", - "DeviceName": "docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", - "DeviceSize": "171798691840" + "GraphDriver": { + "Name": "devicemapper", + "Data": { + "DeviceId": "5", + "DeviceName": "docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47", + "DeviceSize": "171798691840" + } + }, + "Config": { + "Hostname": "d2cc496561d6", + "Domainname": "", + "User": "", + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "ExposedPorts": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": true, + "Env": null, + "Cmd": [ + "bash" + ], + "Image": "fedora", + "Volumes": null, + "VolumeDriver": "", + "WorkingDir": "", + "Entrypoint": null, + "NetworkDisabled": false, + "MacAddress": "", + "OnBuild": null, + "Labels": {}, + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 0, + "Cpuset": "", + "StopSignal": "SIGTERM" } - }, - "Config": { - "Hostname": "d2cc496561d6", - "Domainname": "", - "User": "", - "AttachStdin": true, - "AttachStdout": true, - "AttachStderr": true, - "ExposedPorts": null, - "Tty": true, - "OpenStdin": true, - "StdinOnce": true, - "Env": null, - "Cmd": [ - "bash" - ], - "Image": "fedora", - "Volumes": null, - "VolumeDriver": "", - "WorkingDir": "", - "Entrypoint": null, - "NetworkDisabled": false, - "MacAddress": "", - "OnBuild": null, - "Labels": {}, - "Memory": 0, - "MemorySwap": 0, - "CpuShares": 0, - "Cpuset": "", - "StopSignal": "SIGTERM" - } } diff --git a/docker-java/src/test/resources/samples/1.22/images/image1/inspect1.json b/docker-java/src/test/resources/samples/1.22/images/image1/inspect1.json index ef674df2b..9b05f49a6 100644 --- a/docker-java/src/test/resources/samples/1.22/images/image1/inspect1.json +++ b/docker-java/src/test/resources/samples/1.22/images/image1/inspect1.json @@ -1,69 +1,69 @@ { - "Id": "sha256:ee45fe0d1fcdf1a0f9c2d1e36c6f4b3202bbb2032f14d7c9312b27bfcf6aee24", - "RepoTags": [ - "hackmann/empty:latest" - ], - "RepoDigests": [], - "Parent": "", - "Comment": "", - "Created": "2014-04-29T19:59:10.84997669Z", - "Container": "aee9ba801acca0e648ffd91df204ba82ae85d97608a4864a019e2004d7e1b133", - "ContainerConfig": { - "Hostname": "aee9ba801acc", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": [ - "HOME=/", - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + "Id": "sha256:ee45fe0d1fcdf1a0f9c2d1e36c6f4b3202bbb2032f14d7c9312b27bfcf6aee24", + "RepoTags": [ + "hackmann/empty:latest" ], - "Cmd": [ - "/bin/sh", - "-c", - "#(nop) MAINTAINER hack@worldticket.net" - ], - "Image": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": [], - "Labels": null - }, - "DockerVersion": "0.8.1", - "Author": "hack@worldticket.net", - "Config": { - "Hostname": "aee9ba801acc", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": [ - "HOME=/", - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - ], - "Cmd": null, - "Image": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": [], - "Labels": null - }, - "Architecture": "amd64", - "Os": "linux", - "Size": 0, - "VirtualSize": 0, - "GraphDriver": { - "Name": "aufs", - "Data": null - } + "RepoDigests": [], + "Parent": "", + "Comment": "", + "Created": "2014-04-29T19:59:10.84997669Z", + "Container": "aee9ba801acca0e648ffd91df204ba82ae85d97608a4864a019e2004d7e1b133", + "ContainerConfig": { + "Hostname": "aee9ba801acc", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "HOME=/", + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": [ + "/bin/sh", + "-c", + "#(nop) MAINTAINER hack@worldticket.net" + ], + "Image": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": [], + "Labels": null + }, + "DockerVersion": "0.8.1", + "Author": "hack@worldticket.net", + "Config": { + "Hostname": "aee9ba801acc", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "HOME=/", + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": null, + "Image": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": [], + "Labels": null + }, + "Architecture": "amd64", + "Os": "linux", + "Size": 0, + "VirtualSize": 0, + "GraphDriver": { + "Name": "aufs", + "Data": null + } } diff --git a/docker-java/src/test/resources/samples/1.22/images/overlay/inspectOverlay.json b/docker-java/src/test/resources/samples/1.22/images/overlay/inspectOverlay.json index 7e3fe0bea..d9159f350 100644 --- a/docker-java/src/test/resources/samples/1.22/images/overlay/inspectOverlay.json +++ b/docker-java/src/test/resources/samples/1.22/images/overlay/inspectOverlay.json @@ -1,93 +1,93 @@ { - "Id": "sha256:0ac989a7cba2ce7f5fbe5d520b338e780055ec251371ee35f7462ae9944696c5", - "RepoTags": [ - "test-image:latest" - ], - "RepoDigests": [], - "Parent": "", - "Comment": "", - "Created": "2016-05-24T19:25:01.31608131Z", - "Container": "221f000eccdec85b74cd4f4f37c7c0392d0f620bee45e9618cac3e57409a6d2c", - "ContainerConfig": { - "Hostname": "6ea525e7ec5c", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + "Id": "sha256:0ac989a7cba2ce7f5fbe5d520b338e780055ec251371ee35f7462ae9944696c5", + "RepoTags": [ + "test-image:latest" ], - "Cmd": [ - "/bin/sh", - "-c", - "#(nop) ENTRYPOINT [\"bin/run.sh\"]" - ], - "Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7", - "Volumes": { - "/var/lib/docker": {} + "RepoDigests": [], + "Parent": "", + "Comment": "", + "Created": "2016-05-24T19:25:01.31608131Z", + "Container": "221f000eccdec85b74cd4f4f37c7c0392d0f620bee45e9618cac3e57409a6d2c", + "ContainerConfig": { + "Hostname": "6ea525e7ec5c", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": [ + "/bin/sh", + "-c", + "#(nop) ENTRYPOINT [\"bin/run.sh\"]" + ], + "Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7", + "Volumes": { + "/var/lib/docker": {} + }, + "WorkingDir": "/opt", + "Entrypoint": [ + "bin/run.sh" + ], + "OnBuild": [], + "Labels": {} }, - "WorkingDir": "/opt", - "Entrypoint": [ - "bin/run.sh" - ], - "OnBuild": [], - "Labels": {} - }, - "DockerVersion": "1.11.1", - "Author": "", - "Config": { - "Hostname": "6ea525e7ec5c", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - ], - "Cmd": null, - "Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7", - "Volumes": { - "/var/lib/docker": {} + "DockerVersion": "1.11.1", + "Author": "", + "Config": { + "Hostname": "6ea525e7ec5c", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Cmd": null, + "Image": "sha256:f8321fac5b5484874c1c5c02719905ec815c8ad20c2bc66222cfde19cd0491b7", + "Volumes": { + "/var/lib/docker": {} + }, + "WorkingDir": "/opt", + "Entrypoint": [ + "bin/run.sh" + ], + "OnBuild": [], + "Labels": {} }, - "WorkingDir": "/opt", - "Entrypoint": [ - "bin/run.sh" - ], - "OnBuild": [], - "Labels": {} - }, - "Architecture": "amd64", - "Os": "linux", - "Size": 345943268, - "VirtualSize": 345943268, - "GraphDriver": { - "Name": "overlay", - "Data": { - "RootDir": "/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root" + "Architecture": "amd64", + "Os": "linux", + "Size": 345943268, + "VirtualSize": 345943268, + "GraphDriver": { + "Name": "overlay", + "Data": { + "RootDir": "/var/lib/docker/overlay/7e8d362d6b78d47eafe4863fd129cbcada35dbd419d7188cc1dbf1233d505576/root" + } + }, + "RootFS": { + "Type": "layers", + "Layers": [ + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "sha256:bd8153423e4131205018c431283e0a08298b291838db9bc6c19620523f5a818c", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "sha256:bb0716c3f5f5be1e5ee6912f7e9f44193898e0b3ed9031a0416f8ca262e89975", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", + "sha256:58845ae9bfa7659900a9b30abb2c96330eff09bfbc6521ea77937ba60f8cc131", + "sha256:8c22161a61c24eb6f7aa130d45189354fd8dbe9467e5b2debf828908113eacb0", + "sha256:0c0c9045d2542e7845a2bdd8ead0e0fb2722be2c07c5553838dd61ffe051d672" + ] } - }, - "RootFS": { - "Type": "layers", - "Layers": [ - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", - "sha256:bd8153423e4131205018c431283e0a08298b291838db9bc6c19620523f5a818c", - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", - "sha256:bb0716c3f5f5be1e5ee6912f7e9f44193898e0b3ed9031a0416f8ca262e89975", - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef", - "sha256:58845ae9bfa7659900a9b30abb2c96330eff09bfbc6521ea77937ba60f8cc131", - "sha256:8c22161a61c24eb6f7aa130d45189354fd8dbe9467e5b2debf828908113eacb0", - "sha256:0c0c9045d2542e7845a2bdd8ead0e0fb2722be2c07c5553838dd61ffe051d672" - ] - } -} \ No newline at end of file +} diff --git a/docker-java/src/test/resources/samples/1.22/info/1.json b/docker-java/src/test/resources/samples/1.22/info/1.json index 42ceb1b6e..d4971c11e 100644 --- a/docker-java/src/test/resources/samples/1.22/info/1.json +++ b/docker-java/src/test/resources/samples/1.22/info/1.json @@ -1,91 +1,91 @@ { - "ID": "HLN2:5SBU:SRQR:CQI6:AB52:LZZ2:DED5:REDM:BU73:JFHE:R37A:5HMX", - "Containers": 2, - "ContainersRunning": 2, - "ContainersPaused": 10, - "ContainersStopped": 3, - "Images": 13, - "Driver": "aufs", - "DriverStatus": [ - [ - "Root Dir", - "/mnt/sda1/var/lib/docker/aufs" + "ID": "HLN2:5SBU:SRQR:CQI6:AB52:LZZ2:DED5:REDM:BU73:JFHE:R37A:5HMX", + "Containers": 2, + "ContainersRunning": 2, + "ContainersPaused": 10, + "ContainersStopped": 3, + "Images": 13, + "Driver": "aufs", + "DriverStatus": [ + [ + "Root Dir", + "/mnt/sda1/var/lib/docker/aufs" + ], + [ + "Backing Filesystem", + "extfs" + ], + [ + "Dirs", + "31" + ], + [ + "Dirperm1 Supported", + "true" + ] ], - [ - "Backing Filesystem", - "extfs" - ], - [ - "Dirs", - "31" - ], - [ - "Dirperm1 Supported", - "true" - ] - ], - "SystemStatus": null, - "Plugins": { - "Volume": [ - "local" - ], - "Network": [ - "bridge", - "null", - "host" - ], - "Authorization": null - }, - "MemoryLimit": true, - "SwapLimit": true, - "CpuCfsPeriod": true, - "CpuCfsQuota": true, - "CPUShares": true, - "CPUSet": true, - "IPv4Forwarding": true, - "BridgeNfIptables": true, - "BridgeNfIp6tables": true, - "Debug": true, - "NFd": 24, - "OomKillDisable": true, - "NGoroutines": 40, - "SystemTime": "2016-02-17T14:56:35.212841831Z", - "ExecutionDriver": "native-0.2", - "LoggingDriver": "json-file", - "NEventsListener": 0, - "KernelVersion": "4.1.17-boot2docker", - "OperatingSystem": "Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016", - "OSType": "linux", - "Architecture": "x86_64", - "IndexServerAddress": "https://index.docker.io/v1/", - "RegistryConfig": { - "InsecureRegistryCIDRs": [ - "127.0.0.0/8" - ], - "IndexConfigs": { - "docker.io": { - "Name": "docker.io", - "Mirrors": null, - "Secure": true, - "Official": true - } + "SystemStatus": null, + "Plugins": { + "Volume": [ + "local" + ], + "Network": [ + "bridge", + "null", + "host" + ], + "Authorization": null + }, + "MemoryLimit": true, + "SwapLimit": true, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "CPUShares": true, + "CPUSet": true, + "IPv4Forwarding": true, + "BridgeNfIptables": true, + "BridgeNfIp6tables": true, + "Debug": true, + "NFd": 24, + "OomKillDisable": true, + "NGoroutines": 40, + "SystemTime": "2016-02-17T14:56:35.212841831Z", + "ExecutionDriver": "native-0.2", + "LoggingDriver": "json-file", + "NEventsListener": 0, + "KernelVersion": "4.1.17-boot2docker", + "OperatingSystem": "Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu Feb 11 22:34:01 UTC 2016", + "OSType": "linux", + "Architecture": "x86_64", + "IndexServerAddress": "https://index.docker.io/v1/", + "RegistryConfig": { + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ], + "IndexConfigs": { + "docker.io": { + "Name": "docker.io", + "Mirrors": null, + "Secure": true, + "Official": true + } + }, + "Mirrors": null }, - "Mirrors": null - }, - "InitSha1": "", - "InitPath": "/usr/local/bin/docker", - "NCPU": 1, - "MemTotal": 1044574208, - "DockerRootDir": "/mnt/sda1/var/lib/docker", - "HttpProxy": "", - "HttpsProxy": "", - "NoProxy": "", - "Name": "docker-java", - "Labels": [ - "provider=virtualbox" - ], - "ExperimentalBuild": false, - "ServerVersion": "1.10.1", - "ClusterStore": "", - "ClusterAdvertise": "" + "InitSha1": "", + "InitPath": "/usr/local/bin/docker", + "NCPU": 1, + "MemTotal": 1044574208, + "DockerRootDir": "/mnt/sda1/var/lib/docker", + "HttpProxy": "", + "HttpsProxy": "", + "NoProxy": "", + "Name": "docker-java", + "Labels": [ + "provider=virtualbox" + ], + "ExperimentalBuild": false, + "ServerVersion": "1.10.1", + "ClusterStore": "", + "ClusterAdvertise": "" } diff --git a/docker-java/src/test/resources/samples/1.22/info/2.json b/docker-java/src/test/resources/samples/1.22/info/2.json index c30dca325..542c7a092 100644 --- a/docker-java/src/test/resources/samples/1.22/info/2.json +++ b/docker-java/src/test/resources/samples/1.22/info/2.json @@ -1,165 +1,164 @@ { - "ID":"H52J:52LG:YP4W:EHKY:SRK5:RYG6:ETWR:7AR3:MTFJ:PC6C:4YF2:NTN2", - "Containers":2, - "ContainersRunning":0, - "ContainersPaused":0, - "ContainersStopped":2, - "Images":55, - "Driver":"devicemapper", - "DriverStatus":[ - [ - "Pool Name", - "docker-253:2-17567992-pool" - ], - [ - "Pool Blocksize", - "65.54 kB" - ], - [ - "Base Device Size", - "107.4 GB" - ], - [ - "Backing Filesystem", - "ext4" - ], - [ - "Data file", - "/dev/loop0" - ], - [ - "Metadata file", - "/dev/loop1" - ], - [ - "Data Space Used", - "3.89 GB" - ], - [ - "Data Space Total", - "107.4 GB" - ], - [ - "Data Space Available", - "103.5 GB" - ], - [ - "Metadata Space Used", - "5.46 MB" - ], - [ - "Metadata Space Total", - "2.147 GB" - ], - [ - "Metadata Space Available", - "2.142 GB" - ], - [ - "Udev Sync Supported", - "true" - ], - [ - "Deferred Removal Enabled", - "false" - ], - [ - "Deferred Deletion Enabled", - "false" - ], - [ - "Deferred Deleted Device Count", - "0" - ], - [ - "Data loop file", - "/var/lib/docker/devicemapper/devicemapper/data" - ], - [ - "Metadata loop file", - "/var/lib/docker/devicemapper/devicemapper/metadata" - ], - [ - "Library Version", - "1.02.107-RHEL7 (2015-12-01)" - ] - ], - "SystemStatus":null, - "Plugins":{ - "Volume":[ - "local" - ], - "Network":[ - "null", - "host", - "bridge" - ], - "Authorization":null - }, - "MemoryLimit":true, - "SwapLimit":true, - "CpuCfsPeriod":true, - "CpuCfsQuota":true, - "CPUShares":true, - "CPUSet":true, - "IPv4Forwarding":true, - "BridgeNfIptables":false, - "BridgeNfIp6tables":false, - "Debug":false, - "NFd":13, - "OomKillDisable":true, - "NGoroutines":30, - "SystemTime":"2016-03-20T17:32:06.598846244+01:00", - "ExecutionDriver":"native-0.2", - "LoggingDriver":"json-file", - "NEventsListener":0, - "KernelVersion":"3.10.0-327.10.1.el7.x86_64", - "PkgVersion":"docker-1.10.2-6.git0f5ac89.el7.x86_64", - "OperatingSystem":"Red Hat Enterprise Linux Workstation 7.2 (Maipo)", - "OSType":"linux", - "Architecture":"x86_64", - "IndexServerAddress":"https://index.docker.io/v1/", - "IndexServerName":"docker.io", - "RegistryConfig":{ - "InsecureRegistryCIDRs":[ - "127.0.0.0/8" - ], - "IndexConfigs":{ - "docker.io":{ - "Name":"docker.io", - "Mirrors":null, - "Secure":true, - "Official":true - }, - "somehost:80":{ - "Name":"somehost:80", - "Mirrors":[ - - ], - "Secure":false, - "Official":false - } - }, - "Mirrors":null - }, - "InitSha1":"672d65f3cf8816fbda421afeed7e52c0ca17d5e7", - "InitPath":"/usr/libexec/docker/dockerinit", - "NCPU":8, - "MemTotal":33350918144, - "DockerRootDir":"/var/lib/docker", - "HttpProxy":"", - "HttpsProxy":"", - "NoProxy":"", - "Name":"somename", - "Labels":null, - "ExperimentalBuild":false, - "ServerVersion":"1.10.2", - "ClusterStore":"", - "ClusterAdvertise":"", - "Registries":[ - { - "Name":"docker.io", - "Secure":true - } - ] + "ID": "H52J:52LG:YP4W:EHKY:SRK5:RYG6:ETWR:7AR3:MTFJ:PC6C:4YF2:NTN2", + "Containers": 2, + "ContainersRunning": 0, + "ContainersPaused": 0, + "ContainersStopped": 2, + "Images": 55, + "Driver": "devicemapper", + "DriverStatus": [ + [ + "Pool Name", + "docker-253:2-17567992-pool" + ], + [ + "Pool Blocksize", + "65.54 kB" + ], + [ + "Base Device Size", + "107.4 GB" + ], + [ + "Backing Filesystem", + "ext4" + ], + [ + "Data file", + "/dev/loop0" + ], + [ + "Metadata file", + "/dev/loop1" + ], + [ + "Data Space Used", + "3.89 GB" + ], + [ + "Data Space Total", + "107.4 GB" + ], + [ + "Data Space Available", + "103.5 GB" + ], + [ + "Metadata Space Used", + "5.46 MB" + ], + [ + "Metadata Space Total", + "2.147 GB" + ], + [ + "Metadata Space Available", + "2.142 GB" + ], + [ + "Udev Sync Supported", + "true" + ], + [ + "Deferred Removal Enabled", + "false" + ], + [ + "Deferred Deletion Enabled", + "false" + ], + [ + "Deferred Deleted Device Count", + "0" + ], + [ + "Data loop file", + "/var/lib/docker/devicemapper/devicemapper/data" + ], + [ + "Metadata loop file", + "/var/lib/docker/devicemapper/devicemapper/metadata" + ], + [ + "Library Version", + "1.02.107-RHEL7 (2015-12-01)" + ] + ], + "SystemStatus": null, + "Plugins": { + "Volume": [ + "local" + ], + "Network": [ + "null", + "host", + "bridge" + ], + "Authorization": null + }, + "MemoryLimit": true, + "SwapLimit": true, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "CPUShares": true, + "CPUSet": true, + "IPv4Forwarding": true, + "BridgeNfIptables": false, + "BridgeNfIp6tables": false, + "Debug": false, + "NFd": 13, + "OomKillDisable": true, + "NGoroutines": 30, + "SystemTime": "2016-03-20T17:32:06.598846244+01:00", + "ExecutionDriver": "native-0.2", + "LoggingDriver": "json-file", + "NEventsListener": 0, + "KernelVersion": "3.10.0-327.10.1.el7.x86_64", + "PkgVersion": "docker-1.10.2-6.git0f5ac89.el7.x86_64", + "OperatingSystem": "Red Hat Enterprise Linux Workstation 7.2 (Maipo)", + "OSType": "linux", + "Architecture": "x86_64", + "IndexServerAddress": "https://index.docker.io/v1/", + "IndexServerName": "docker.io", + "RegistryConfig": { + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ], + "IndexConfigs": { + "docker.io": { + "Name": "docker.io", + "Mirrors": null, + "Secure": true, + "Official": true + }, + "somehost:80": { + "Name": "somehost:80", + "Mirrors": [ + ], + "Secure": false, + "Official": false + } + }, + "Mirrors": null + }, + "InitSha1": "672d65f3cf8816fbda421afeed7e52c0ca17d5e7", + "InitPath": "/usr/libexec/docker/dockerinit", + "NCPU": 8, + "MemTotal": 33350918144, + "DockerRootDir": "/var/lib/docker", + "HttpProxy": "", + "HttpsProxy": "", + "NoProxy": "", + "Name": "somename", + "Labels": null, + "ExperimentalBuild": false, + "ServerVersion": "1.10.2", + "ClusterStore": "", + "ClusterAdvertise": "", + "Registries": [ + { + "Name": "docker.io", + "Secure": true + } + ] } diff --git a/docker-java/src/test/resources/samples/1.22/info/docs.json b/docker-java/src/test/resources/samples/1.22/info/docs.json index 537a0a1d2..97cd0f495 100644 --- a/docker-java/src/test/resources/samples/1.22/info/docs.json +++ b/docker-java/src/test/resources/samples/1.22/info/docs.json @@ -1,76 +1,76 @@ { - "Architecture": "x86_64", - "Containers": 11, - "ContainersRunning": 7, - "ContainersStopped": 3, - "ContainersPaused": 1, - "CpuCfsPeriod": true, - "CpuCfsQuota": true, - "Debug": false, - "DiscoveryBackend": "etcd://localhost:2379", - "DockerRootDir": "/var/lib/docker", - "Driver": "btrfs", - "DriverStatus": [ - [ - "" - ] - ], - "SystemStatus": [ - [ - "State", - "Healthy" - ] - ], - "Plugins": { - "Volume": [ - "local" + "Architecture": "x86_64", + "Containers": 11, + "ContainersRunning": 7, + "ContainersStopped": 3, + "ContainersPaused": 1, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "Debug": false, + "DiscoveryBackend": "etcd://localhost:2379", + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [ + [ + "" + ] ], - "Network": [ - "null", - "host", - "bridge" - ] - }, - "ExecutionDriver": "native-0.1", - "ExperimentalBuild": false, - "HttpProxy": "http://test:test@localhost:8080", - "HttpsProxy": "https://test:test@localhost:8080", - "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", - "IPv4Forwarding": true, - "Images": 16, - "IndexServerAddress": "https://index.docker.io/v1/", - "InitPath": "/usr/bin/docker", - "InitSha1": "", - "KernelVersion": "3.12.0-1-amd64", - "Labels": [ - "storage=ssd" - ], - "MemTotal": 2099236864, - "MemoryLimit": true, - "NCPU": 1, - "NEventsListener": 0, - "NFd": 11, - "NGoroutines": 21, - "Name": "prod-server-42", - "NoProxy": "9.81.1.160", - "OomKillDisable": true, - "OSType": "linux", - "OomScoreAdj": 500, - "OperatingSystem": "Boot2Docker", - "RegistryConfig": { - "IndexConfigs": { - "docker.io": { - "Mirrors": null, - "Name": "docker.io", - "Official": true, - "Secure": true - } + "SystemStatus": [ + [ + "State", + "Healthy" + ] + ], + "Plugins": { + "Volume": [ + "local" + ], + "Network": [ + "null", + "host", + "bridge" + ] + }, + "ExecutionDriver": "native-0.1", + "ExperimentalBuild": false, + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": true, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": true, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OomKillDisable": true, + "OSType": "linux", + "OomScoreAdj": 500, + "OperatingSystem": "Boot2Docker", + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] }, - "InsecureRegistryCIDRs": [ - "127.0.0.0/8" - ] - }, - "SwapLimit": false, - "SystemTime": "2015-03-10T11:11:23.730591467-07:00", - "ServerVersion": "1.9.0" + "SwapLimit": false, + "SystemTime": "2015-03-10T11:11:23.730591467-07:00", + "ServerVersion": "1.9.0" } diff --git a/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs1.json b/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs1.json index 5f712fb62..3af32550c 100644 --- a/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs1.json +++ b/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs1.json @@ -1,5 +1,5 @@ { - "username": "jdoe", - "password": "secret", - "email": "jdoe@acme.com" + "username": "jdoe", + "password": "secret", + "email": "jdoe@acme.com" } diff --git a/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs2.json b/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs2.json index 8ac70c20a..45c3ec38d 100644 --- a/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs2.json +++ b/docker-java/src/test/resources/samples/1.22/other/AuthConfig/docs2.json @@ -1,3 +1,3 @@ { - "registrytoken": "9cbaf023786cd7..." + "registrytoken": "9cbaf023786cd7..." } diff --git a/docker-java/src/test/resources/samples/1.22/version/1.json b/docker-java/src/test/resources/samples/1.22/version/1.json index 454c767ba..032f477f9 100644 --- a/docker-java/src/test/resources/samples/1.22/version/1.json +++ b/docker-java/src/test/resources/samples/1.22/version/1.json @@ -1,10 +1,10 @@ { - "Version": "1.10.1", - "ApiVersion": "1.22", - "GitCommit": "9e83765", - "GoVersion": "go1.5.3", - "Os": "linux", - "Arch": "amd64", - "KernelVersion": "4.1.17-boot2docker", - "BuildTime": "2016-02-11T20:39:58.688092588+00:00" + "Version": "1.10.1", + "ApiVersion": "1.22", + "GitCommit": "9e83765", + "GoVersion": "go1.5.3", + "Os": "linux", + "Arch": "amd64", + "KernelVersion": "4.1.17-boot2docker", + "BuildTime": "2016-02-11T20:39:58.688092588+00:00" } diff --git a/docker-java/src/test/resources/samples/1.23/other/AuthConfig/docs1.json b/docker-java/src/test/resources/samples/1.23/other/AuthConfig/docs1.json index 1ebc88193..3a39323b8 100644 --- a/docker-java/src/test/resources/samples/1.23/other/AuthConfig/docs1.json +++ b/docker-java/src/test/resources/samples/1.23/other/AuthConfig/docs1.json @@ -1,4 +1,4 @@ { - "auth": "YWRtaW46", - "identitytoken": "1cba468e-8cbe-4c55-9098-2c2ed769e885" -} \ No newline at end of file + "auth": "YWRtaW46", + "identitytoken": "1cba468e-8cbe-4c55-9098-2c2ed769e885" +} diff --git a/docker-java/src/test/resources/samples/1.24/containers/inspect/1.json b/docker-java/src/test/resources/samples/1.24/containers/inspect/1.json index 54d23923f..7de02f5fd 100644 --- a/docker-java/src/test/resources/samples/1.24/containers/inspect/1.json +++ b/docker-java/src/test/resources/samples/1.24/containers/inspect/1.json @@ -1,167 +1,167 @@ { - "Id": "fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045", - "Created": "2015-11-20T21:10:34.775649753Z", - "Path": "cat", - "Args": [], - "State": { - "Status": "running", - "Running": true, - "Paused": false, - "Restarting": false, - "OOMKilled": false, - "Dead": false, - "Pid": 10912, - "ExitCode": 0, - "Error": "", - "StartedAt": "2015-11-20T21:10:34.845546358Z", - "FinishedAt": "0001-01-01T00:00:00Z", - "Health": { - "Status": "healthy", - "FailingStreak": 0, - "Log": [ - { - "Start": "2016-11-12T03:23:03.351561Z", - "End": "2016-11-12T03:23:03.422176171Z", - "ExitCode": 0, - "Output" : "Hello" + "Id": "fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045", + "Created": "2015-11-20T21:10:34.775649753Z", + "Path": "cat", + "Args": [], + "State": { + "Status": "running", + "Running": true, + "Paused": false, + "Restarting": false, + "OOMKilled": false, + "Dead": false, + "Pid": 10912, + "ExitCode": 0, + "Error": "", + "StartedAt": "2015-11-20T21:10:34.845546358Z", + "FinishedAt": "0001-01-01T00:00:00Z", + "Health": { + "Status": "healthy", + "FailingStreak": 0, + "Log": [ + { + "Start": "2016-11-12T03:23:03.351561Z", + "End": "2016-11-12T03:23:03.422176171Z", + "ExitCode": 0, + "Output": "Hello" + }, + { + "Start": "2016-11-12T03:23:08.423558928Z", + "End": "2016-11-12T03:23:08.510122392Z", + "ExitCode": 0, + "Output": "World" + } + ] + } + }, + "Image": "c51f86c283408d1749d066333f7acd5d33b053b003a61ff6a7b36819ddcbc7b7", + "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/resolv.conf", + "HostnamePath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hostname", + "HostsPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hosts", + "LogPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045-json.log", + "Name": "/small_hodgkin", + "RestartCount": 0, + "Driver": "aufs", + "ExecDriver": "native-0.2", + "MountLabel": "", + "ProcessLabel": "", + "AppArmorProfile": "", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Memory": 0, + "MemoryReservation": 0, + "MemorySwap": 0, + "KernelMemory": 0, + "CpuShares": 0, + "CpuPeriod": 0, + "CpusetCpus": "", + "CpusetMems": "", + "CpuQuota": 0, + "BlkioWeight": 0, + "OomKillDisable": false, + "MemorySwappiness": -1, + "Privileged": false, + "PortBindings": {}, + "Links": null, + "PublishAllPorts": false, + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "VolumesFrom": null, + "Devices": [], + "NetworkMode": "default", + "IpcMode": "", + "PidMode": "", + "UTSMode": "", + "CapAdd": null, + "CapDrop": null, + "GroupAdd": null, + "RestartPolicy": { + "Name": "no", + "MaximumRetryCount": 0 }, - { - "Start": "2016-11-12T03:23:08.423558928Z", - "End": "2016-11-12T03:23:08.510122392Z", - "ExitCode": 0, - "Output" : "World" - } - ] - } - }, - "Image": "c51f86c283408d1749d066333f7acd5d33b053b003a61ff6a7b36819ddcbc7b7", - "ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/resolv.conf", - "HostnamePath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hostname", - "HostsPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/hosts", - "LogPath": "/mnt/sda1/var/lib/docker/containers/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045/fc1243c01bbb791d9eca64204d76f72fc47fbebbca892d7dd0a5cd0e4e346045-json.log", - "Name": "/small_hodgkin", - "RestartCount": 0, - "Driver": "aufs", - "ExecDriver": "native-0.2", - "MountLabel": "", - "ProcessLabel": "", - "AppArmorProfile": "", - "ExecIDs": null, - "HostConfig": { - "Binds": null, - "ContainerIDFile": "", - "LxcConf": [], - "Memory": 0, - "MemoryReservation": 0, - "MemorySwap": 0, - "KernelMemory": 0, - "CpuShares": 0, - "CpuPeriod": 0, - "CpusetCpus": "", - "CpusetMems": "", - "CpuQuota": 0, - "BlkioWeight": 0, - "OomKillDisable": false, - "MemorySwappiness": -1, - "Privileged": false, - "PortBindings": {}, - "Links": null, - "PublishAllPorts": false, - "Dns": null, - "DnsOptions": null, - "DnsSearch": null, - "ExtraHosts": null, - "VolumesFrom": null, - "Devices": [], - "NetworkMode": "default", - "IpcMode": "", - "PidMode": "", - "UTSMode": "", - "CapAdd": null, - "CapDrop": null, - "GroupAdd": null, - "RestartPolicy": { - "Name": "no", - "MaximumRetryCount": 0 + "SecurityOpt": null, + "ReadonlyRootfs": false, + "Ulimits": null, + "LogConfig": { + "Type": "json-file", + "Config": {} + }, + "CgroupParent": "", + "ConsoleSize": [ + 0, + 0 + ], + "VolumeDriver": "" }, - "SecurityOpt": null, - "ReadonlyRootfs": false, - "Ulimits": null, - "LogConfig": { - "Type": "json-file", - "Config": {} + "GraphDriver": { + "Name": "aufs", + "Data": null }, - "CgroupParent": "", - "ConsoleSize": [ - 0, - 0 - ], - "VolumeDriver": "" - }, - "GraphDriver": { - "Name": "aufs", - "Data": null - }, - "Mounts": [], - "Config": { - "Hostname": "fc1243c01bbb", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": true, - "StdinOnce": false, - "Env": null, - "Cmd": [ - "cat" - ], - "Healthcheck": { - "Test": [ - "CMD-SHELL", - "mysqladmin ping --silent" - ], - "Interval": 2000000000, - "Timeout": 3000000000 + "Mounts": [], + "Config": { + "Hostname": "fc1243c01bbb", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "cat" + ], + "Healthcheck": { + "Test": [ + "CMD-SHELL", + "mysqladmin ping --silent" + ], + "Interval": 2000000000, + "Timeout": 3000000000 + }, + "Image": "busybox", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": {}, + "StopSignal": "SIGTERM" }, - "Image": "busybox", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": null, - "Labels": {}, - "StopSignal": "SIGTERM" - }, - "NetworkSettings": { - "Bridge": "", - "SandboxID": "5a6ded01bf23cc180e8ba6a059449ac832f28fa1d8367127e316607f92d3228c", - "HairpinMode": false, - "LinkLocalIPv6Address": "", - "LinkLocalIPv6PrefixLen": 0, - "Ports": {}, - "SandboxKey": "/var/run/docker/netns/5a6ded01bf23", - "SecondaryIPAddresses": null, - "SecondaryIPv6Addresses": null, - "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", - "Gateway": "172.17.0.1", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "IPAddress": "172.17.0.2", - "IPPrefixLen": 16, - "IPv6Gateway": "", - "MacAddress": "02:42:ac:11:00:02", - "Networks": { - "bridge": { + "NetworkSettings": { + "Bridge": "", + "SandboxID": "5a6ded01bf23cc180e8ba6a059449ac832f28fa1d8367127e316607f92d3228c", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": {}, + "SandboxKey": "/var/run/docker/netns/5a6ded01bf23", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", "Gateway": "172.17.0.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2", "IPPrefixLen": 16, "IPv6Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "MacAddress": "02:42:ac:11:00:02" - } + "MacAddress": "02:42:ac:11:00:02", + "Networks": { + "bridge": { + "EndpointID": "6b4bb2aff9981d6e132cf37ebbfd370069061fab848ae56247b154717a99aba7", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } } - } } diff --git a/docker-java/src/test/resources/samples/1.24/events/docs1.json b/docker-java/src/test/resources/samples/1.24/events/docs1.json index f62f2284e..8720abd1f 100644 --- a/docker-java/src/test/resources/samples/1.24/events/docs1.json +++ b/docker-java/src/test/resources/samples/1.24/events/docs1.json @@ -1,17 +1,17 @@ { - "status": "create", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", - "Type": "container", - "Action": "create", - "Actor": { - "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "Attributes": { - "com.example.some-label": "some-label-value", - "image": "alpine", - "name": "my-container" - } - }, - "time": 1461943101, - "timeNano": 1461943101381709551 + "status": "create", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "create", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101381709551 } diff --git a/docker-java/src/test/resources/samples/1.25/images/windowsImage/doc.json b/docker-java/src/test/resources/samples/1.25/images/windowsImage/doc.json index e7b68c078..bf5726d23 100644 --- a/docker-java/src/test/resources/samples/1.25/images/windowsImage/doc.json +++ b/docker-java/src/test/resources/samples/1.25/images/windowsImage/doc.json @@ -1,72 +1,72 @@ { - "Id": "sha256:105d76d0f40e38427c63023ffe649bf36fa85058d3469551e43e4dcc2431fb31", - "RepoTags": [ - "microsoft/nanoserver:latest" - ], - "RepoDigests": [ - "microsoft/nanoserver@sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b" - ], - "Parent": "", - "Comment": "", - "Created": "2016-09-22T02:39:30.9154862-07:00", - "Container": "", - "ContainerConfig": { - "Hostname": "", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": null, - "Cmd": null, - "Image": "", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": null, - "Labels": null - }, - "DockerVersion": "", - "Author": "", - "Config": { - "Hostname": "", - "Domainname": "", - "User": "", - "AttachStdin": false, - "AttachStdout": false, - "AttachStderr": false, - "Tty": false, - "OpenStdin": false, - "StdinOnce": false, - "Env": null, - "Cmd": [ - "c:\\windows\\system32\\cmd.exe" + "Id": "sha256:105d76d0f40e38427c63023ffe649bf36fa85058d3469551e43e4dcc2431fb31", + "RepoTags": [ + "microsoft/nanoserver:latest" ], - "Image": "", - "Volumes": null, - "WorkingDir": "", - "Entrypoint": null, - "OnBuild": null, - "Labels": null - }, - "Architecture": "", - "Os": "windows", - "OsVersion": "10.0.14393", - "Size": 651862727, - "VirtualSize": 651862727, - "GraphDriver": { - "Name": "windowsfilter", - "Data": { - "dir": "C:\\control\\windowsfilter\\6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf" + "RepoDigests": [ + "microsoft/nanoserver@sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b" + ], + "Parent": "", + "Comment": "", + "Created": "2016-09-22T02:39:30.9154862-07:00", + "Container": "", + "ContainerConfig": { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": null, + "Image": "", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": null + }, + "DockerVersion": "", + "Author": "", + "Config": { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "c:\\windows\\system32\\cmd.exe" + ], + "Image": "", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": null + }, + "Architecture": "", + "Os": "windows", + "OsVersion": "10.0.14393", + "Size": 651862727, + "VirtualSize": 651862727, + "GraphDriver": { + "Name": "windowsfilter", + "Data": { + "dir": "C:\\control\\windowsfilter\\6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf" + } + }, + "RootFS": { + "Type": "layers", + "Layers": [ + "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063" + ] } - }, - "RootFS": { - "Type": "layers", - "Layers": [ - "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063" - ] - } -} \ No newline at end of file +} diff --git a/docker-java/src/test/resources/samples/1.25/other/AuthConfig/orchestrators.json b/docker-java/src/test/resources/samples/1.25/other/AuthConfig/orchestrators.json index 3b67b1941..4c3f29cb6 100644 --- a/docker-java/src/test/resources/samples/1.25/other/AuthConfig/orchestrators.json +++ b/docker-java/src/test/resources/samples/1.25/other/AuthConfig/orchestrators.json @@ -1,3 +1,3 @@ { - "stackOrchestrator" : "kubernetes" -} \ No newline at end of file + "stackOrchestrator": "kubernetes" +} diff --git a/docker-java/src/test/resources/samples/1.27/containers/container/stats/stats1.json b/docker-java/src/test/resources/samples/1.27/containers/container/stats/stats1.json index 5a80cd99c..8ba0aecf7 100644 --- a/docker-java/src/test/resources/samples/1.27/containers/container/stats/stats1.json +++ b/docker-java/src/test/resources/samples/1.27/containers/container/stats/stats1.json @@ -1,191 +1,184 @@ { - "read":"2017-12-06T00:42:03.8352972Z", - "preread":"2017-12-06T00:42:02.8366736Z", - "pids_stats":{ - "current":2 - }, - "blkio_stats":{ - "io_service_bytes_recursive":[ - { - "major":259, - "minor":0, - "op":"Read", - "value":823296 - }, - { - "major":259, - "minor":0, - "op":"Write", - "value":122880 - }, - { - "major":259, - "minor":0, - "op":"Sync", - "value":835584 - }, - { - "major":259, - "minor":0, - "op":"Async", - "value":110592 - }, - { - "major":259, - "minor":0, - "op":"Total", - "value":946176 - } - ], - "io_serviced_recursive":[ - { - "major":259, - "minor":0, - "op":"Read", - "value":145 - }, - { - "major":259, - "minor":0, - "op":"Write", - "value":4 - }, - { - "major":259, - "minor":0, - "op":"Sync", - "value":148 - }, - { - "major":259, - "minor":0, - "op":"Async", - "value":1 - }, - { - "major":259, - "minor":0, - "op":"Total", - "value":149 - } - ], - "io_queue_recursive":[ - - ], - "io_service_time_recursive":[ - - ], - "io_wait_time_recursive":[ - - ], - "io_merged_recursive":[ - - ], - "io_time_recursive":[ - - ], - "sectors_recursive":[ - - ] - }, - "num_procs":0, - "storage_stats":{ - - }, - "cpu_stats":{ - "cpu_usage":{ - "total_usage":212198028, - "percpu_usage":[ - 71592953, - 42494761, - 59298344, - 38811970 - ], - "usage_in_kernelmode":170000000, - "usage_in_usermode":20000000 + "read": "2017-12-06T00:42:03.8352972Z", + "preread": "2017-12-06T00:42:02.8366736Z", + "pids_stats": { + "current": 2 }, - "system_cpu_usage":545941980000000, - "online_cpus":4, - "throttling_data":{ - "periods":0, - "throttled_periods":0, - "throttled_time":0 - } - }, - "precpu_stats":{ - "cpu_usage":{ - "total_usage":211307214, - "percpu_usage":[ - 71451389, - 42097782, - 59298344, - 38459699 - ], - "usage_in_kernelmode":170000000, - "usage_in_usermode":20000000 + "blkio_stats": { + "io_service_bytes_recursive": [ + { + "major": 259, + "minor": 0, + "op": "Read", + "value": 823296 + }, + { + "major": 259, + "minor": 0, + "op": "Write", + "value": 122880 + }, + { + "major": 259, + "minor": 0, + "op": "Sync", + "value": 835584 + }, + { + "major": 259, + "minor": 0, + "op": "Async", + "value": 110592 + }, + { + "major": 259, + "minor": 0, + "op": "Total", + "value": 946176 + } + ], + "io_serviced_recursive": [ + { + "major": 259, + "minor": 0, + "op": "Read", + "value": 145 + }, + { + "major": 259, + "minor": 0, + "op": "Write", + "value": 4 + }, + { + "major": 259, + "minor": 0, + "op": "Sync", + "value": 148 + }, + { + "major": 259, + "minor": 0, + "op": "Async", + "value": 1 + }, + { + "major": 259, + "minor": 0, + "op": "Total", + "value": 149 + } + ], + "io_queue_recursive": [ + ], + "io_service_time_recursive": [ + ], + "io_wait_time_recursive": [ + ], + "io_merged_recursive": [ + ], + "io_time_recursive": [ + ], + "sectors_recursive": [ + ] }, - "system_cpu_usage":545937990000000, - "online_cpus":4, - "throttling_data":{ - "periods":0, - "throttled_periods":0, - "throttled_time":0 - } - }, - "memory_stats":{ - "usage":647168, - "max_usage":1703936, - "stats":{ - "active_anon":102400, - "active_file":0, - "cache":0, - "dirty":0, - "hierarchical_memory_limit":9223372036854771712, - "hierarchical_memsw_limit":9223372036854771712, - "inactive_anon":0, - "inactive_file":0, - "mapped_file":0, - "pgfault":9656, - "pgmajfault":0, - "pgpgin":3425, - "pgpgout":3400, - "rss":102400, - "rss_huge":0, - "swap":0, - "total_active_anon":102400, - "total_active_file":0, - "total_cache":0, - "total_dirty":0, - "total_inactive_anon":0, - "total_inactive_file":0, - "total_mapped_file":0, - "total_pgfault":9656, - "total_pgmajfault":0, - "total_pgpgin":3425, - "total_pgpgout":3400, - "total_rss":102400, - "total_rss_huge":0, - "total_swap":0, - "total_unevictable":0, - "total_writeback":0, - "unevictable":0, - "writeback":0 + "num_procs": 0, + "storage_stats": { + }, + "cpu_stats": { + "cpu_usage": { + "total_usage": 212198028, + "percpu_usage": [ + 71592953, + 42494761, + 59298344, + 38811970 + ], + "usage_in_kernelmode": 170000000, + "usage_in_usermode": 20000000 + }, + "system_cpu_usage": 545941980000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "precpu_stats": { + "cpu_usage": { + "total_usage": 211307214, + "percpu_usage": [ + 71451389, + 42097782, + 59298344, + 38459699 + ], + "usage_in_kernelmode": 170000000, + "usage_in_usermode": 20000000 + }, + "system_cpu_usage": 545937990000000, + "online_cpus": 4, + "throttling_data": { + "periods": 0, + "throttled_periods": 0, + "throttled_time": 0 + } + }, + "memory_stats": { + "usage": 647168, + "max_usage": 1703936, + "stats": { + "active_anon": 102400, + "active_file": 0, + "cache": 0, + "dirty": 0, + "hierarchical_memory_limit": 9223372036854771712, + "hierarchical_memsw_limit": 9223372036854771712, + "inactive_anon": 0, + "inactive_file": 0, + "mapped_file": 0, + "pgfault": 9656, + "pgmajfault": 0, + "pgpgin": 3425, + "pgpgout": 3400, + "rss": 102400, + "rss_huge": 0, + "swap": 0, + "total_active_anon": 102400, + "total_active_file": 0, + "total_cache": 0, + "total_dirty": 0, + "total_inactive_anon": 0, + "total_inactive_file": 0, + "total_mapped_file": 0, + "total_pgfault": 9656, + "total_pgmajfault": 0, + "total_pgpgin": 3425, + "total_pgpgout": 3400, + "total_rss": 102400, + "total_rss_huge": 0, + "total_swap": 0, + "total_unevictable": 0, + "total_writeback": 0, + "unevictable": 0, + "writeback": 0 + }, + "limit": 2095874048, + "failcnt": 0 }, - "limit":2095874048, - "failcnt":0 - }, - "name":"/gallant_hamilton", - "id":"b581d78b03e41d81c9fe941f03f5d35e23733ff96370456b58d2906e002b0deb", - "networks":{ - "eth0":{ - "rx_bytes":1230, - "rx_packets":19, - "rx_errors":0, - "rx_dropped":0, - "tx_bytes":0, - "tx_packets":0, - "tx_errors":0, - "tx_dropped":0 + "name": "/gallant_hamilton", + "id": "b581d78b03e41d81c9fe941f03f5d35e23733ff96370456b58d2906e002b0deb", + "networks": { + "eth0": { + "rx_bytes": 1230, + "rx_packets": 19, + "rx_errors": 0, + "rx_dropped": 0, + "tx_bytes": 0, + "tx_packets": 0, + "tx_errors": 0, + "tx_dropped": 0 + } } - } } diff --git a/docker-java/src/test/resources/samples/1.38/containers/inspect/lcow.json b/docker-java/src/test/resources/samples/1.38/containers/inspect/lcow.json index 4e7725def..1f793d13b 100644 --- a/docker-java/src/test/resources/samples/1.38/containers/inspect/lcow.json +++ b/docker-java/src/test/resources/samples/1.38/containers/inspect/lcow.json @@ -1,169 +1,169 @@ { - "AppArmorProfile": "", - "Args": [], - "Config": { - "AttachStderr": true, - "AttachStdin": true, - "AttachStdout": true, - "Cmd": [ - "cmd" - ], - "Domainname": "", - "Entrypoint": null, - "Env": null, - "Hostname": "35da02ca897b", - "Image": "microsoft/nanoserver", - "Labels": {}, - "OnBuild": null, - "OpenStdin": true, - "StdinOnce": true, - "Tty": true, - "User": "", - "Volumes": null, - "WorkingDir": "" - }, - "Created": "2018-09-18T10:37:25.0470753Z", - "Driver": "windowsfilter", - "ExecIDs": null, - "GraphDriver": { - "Data": { - "dir": "C:\\ProgramData\\Docker\\windowsfilter\\35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556" + "AppArmorProfile": "", + "Args": [], + "Config": { + "AttachStderr": true, + "AttachStdin": true, + "AttachStdout": true, + "Cmd": [ + "cmd" + ], + "Domainname": "", + "Entrypoint": null, + "Env": null, + "Hostname": "35da02ca897b", + "Image": "microsoft/nanoserver", + "Labels": {}, + "OnBuild": null, + "OpenStdin": true, + "StdinOnce": true, + "Tty": true, + "User": "", + "Volumes": null, + "WorkingDir": "" }, - "Name": "windowsfilter" - }, - "HostConfig": { - "AutoRemove": true, - "Binds": null, - "BlkioDeviceReadBps": null, - "BlkioDeviceReadIOps": null, - "BlkioDeviceWriteBps": null, - "BlkioDeviceWriteIOps": null, - "BlkioWeight": 0, - "BlkioWeightDevice": [], - "CapAdd": null, - "CapDrop": null, - "Cgroup": "", - "CgroupParent": "", - "ConsoleSize": [ - 50, - 173 - ], - "ContainerIDFile": "", - "CpuCount": 0, - "CpuPercent": 0, - "CpuPeriod": 0, - "CpuQuota": 0, - "CpuRealtimePeriod": 0, - "CpuRealtimeRuntime": 0, - "CpuShares": 0, - "CpusetCpus": "", - "CpusetMems": "", - "DeviceCgroupRules": null, - "Devices": [], - "DiskQuota": 0, - "Dns": [], - "DnsOptions": [], - "DnsSearch": [], - "ExtraHosts": null, - "GroupAdd": null, - "IOMaximumBandwidth": 0, - "IOMaximumIOps": 0, - "IpcMode": "", - "Isolation": "hyperv", - "KernelMemory": 0, - "Links": null, - "LogConfig": { - "Config": {}, - "Type": "json-file" + "Created": "2018-09-18T10:37:25.0470753Z", + "Driver": "windowsfilter", + "ExecIDs": null, + "GraphDriver": { + "Data": { + "dir": "C:\\ProgramData\\Docker\\windowsfilter\\35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556" + }, + "Name": "windowsfilter" }, - "MaskedPaths": null, - "Memory": 0, - "MemoryReservation": 0, - "MemorySwap": 0, - "MemorySwappiness": null, - "NanoCpus": 0, - "NetworkMode": "default", - "OomKillDisable": false, - "OomScoreAdj": 0, - "PidMode": "", - "PidsLimit": 0, - "PortBindings": {}, - "Privileged": false, - "PublishAllPorts": false, - "ReadonlyPaths": null, - "ReadonlyRootfs": false, - "RestartPolicy": { - "MaximumRetryCount": 0, - "Name": "no" + "HostConfig": { + "AutoRemove": true, + "Binds": null, + "BlkioDeviceReadBps": null, + "BlkioDeviceReadIOps": null, + "BlkioDeviceWriteBps": null, + "BlkioDeviceWriteIOps": null, + "BlkioWeight": 0, + "BlkioWeightDevice": [], + "CapAdd": null, + "CapDrop": null, + "Cgroup": "", + "CgroupParent": "", + "ConsoleSize": [ + 50, + 173 + ], + "ContainerIDFile": "", + "CpuCount": 0, + "CpuPercent": 0, + "CpuPeriod": 0, + "CpuQuota": 0, + "CpuRealtimePeriod": 0, + "CpuRealtimeRuntime": 0, + "CpuShares": 0, + "CpusetCpus": "", + "CpusetMems": "", + "DeviceCgroupRules": null, + "Devices": [], + "DiskQuota": 0, + "Dns": [], + "DnsOptions": [], + "DnsSearch": [], + "ExtraHosts": null, + "GroupAdd": null, + "IOMaximumBandwidth": 0, + "IOMaximumIOps": 0, + "IpcMode": "", + "Isolation": "hyperv", + "KernelMemory": 0, + "Links": null, + "LogConfig": { + "Config": {}, + "Type": "json-file" + }, + "MaskedPaths": null, + "Memory": 0, + "MemoryReservation": 0, + "MemorySwap": 0, + "MemorySwappiness": null, + "NanoCpus": 0, + "NetworkMode": "default", + "OomKillDisable": false, + "OomScoreAdj": 0, + "PidMode": "", + "PidsLimit": 0, + "PortBindings": {}, + "Privileged": false, + "PublishAllPorts": false, + "ReadonlyPaths": null, + "ReadonlyRootfs": false, + "RestartPolicy": { + "MaximumRetryCount": 0, + "Name": "no" + }, + "SecurityOpt": null, + "ShmSize": 0, + "UTSMode": "", + "Ulimits": null, + "UsernsMode": "", + "VolumeDriver": "", + "VolumesFrom": null }, - "SecurityOpt": null, - "ShmSize": 0, - "UTSMode": "", - "Ulimits": null, - "UsernsMode": "", - "VolumeDriver": "", - "VolumesFrom": null - }, - "HostnamePath": "", - "HostsPath": "", - "Id": "35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556", - "Image": "sha256:1381511ec0122f197b6abff5bc0692bef19943ddafd6680eff41197afa3a6dda", - "LogPath": "C:\\ProgramData\\Docker\\containers\\35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556\\35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556-json.log", - "MountLabel": "", - "Mounts": [], - "Name": "/cranky_clarke", - "NetworkSettings": { - "Bridge": "", - "EndpointID": "", - "Gateway": "", - "GlobalIPv6Address": "", - "GlobalIPv6PrefixLen": 0, - "HairpinMode": false, - "IPAddress": "", - "IPPrefixLen": 0, - "IPv6Gateway": "", - "LinkLocalIPv6Address": "", - "LinkLocalIPv6PrefixLen": 0, - "MacAddress": "", - "Networks": { - "nat": { - "Aliases": null, - "DriverOpts": null, - "EndpointID": "493b77d6fe7e3b92435b1eb01461fde669781330deb84a9cbada360db8997ebc", - "Gateway": "172.17.18.1", + "HostnamePath": "", + "HostsPath": "", + "Id": "35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556", + "Image": "sha256:1381511ec0122f197b6abff5bc0692bef19943ddafd6680eff41197afa3a6dda", + "LogPath": "C:\\ProgramData\\Docker\\containers\\35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556\\35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556-json.log", + "MountLabel": "", + "Mounts": [], + "Name": "/cranky_clarke", + "NetworkSettings": { + "Bridge": "", + "EndpointID": "", + "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, - "IPAMConfig": null, - "IPAddress": "172.17.18.123", - "IPPrefixLen": 16, + "HairpinMode": false, + "IPAddress": "", + "IPPrefixLen": 0, "IPv6Gateway": "", - "Links": null, - "MacAddress": "00:aa:ff:cf:dd:09", - "NetworkID": "398c0e206dd677ed4a6566f9de458311f5767d8c7a8b963275490ab64c5d10a7" - } + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "MacAddress": "", + "Networks": { + "nat": { + "Aliases": null, + "DriverOpts": null, + "EndpointID": "493b77d6fe7e3b92435b1eb01461fde669781330deb84a9cbada360db8997ebc", + "Gateway": "172.17.18.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAMConfig": null, + "IPAddress": "172.17.18.123", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "Links": null, + "MacAddress": "00:aa:ff:cf:dd:09", + "NetworkID": "398c0e206dd677ed4a6566f9de458311f5767d8c7a8b963275490ab64c5d10a7" + } + }, + "Ports": {}, + "SandboxID": "35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556", + "SandboxKey": "35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null }, - "Ports": {}, - "SandboxID": "35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556", - "SandboxKey": "35da02ca897bd378ee52be3066c847fee396ba1a28a00b4be36f42c6686bf556", - "SecondaryIPAddresses": null, - "SecondaryIPv6Addresses": null - }, - "Path": "cmd", - "Platform": "windows", - "ProcessLabel": "", - "ResolvConfPath": "", - "RestartCount": 0, - "State": { - "Dead": false, - "Error": "", - "ExitCode": 0, - "FinishedAt": "0001-01-01T00:00:00Z", - "OOMKilled": false, - "Paused": false, - "Pid": 1588, - "Restarting": false, - "Running": true, - "StartedAt": "2018-09-18T10:37:28.3668368Z", - "Status": "running" - } -} \ No newline at end of file + "Path": "cmd", + "Platform": "windows", + "ProcessLabel": "", + "ResolvConfPath": "", + "RestartCount": 0, + "State": { + "Dead": false, + "Error": "", + "ExitCode": 0, + "FinishedAt": "0001-01-01T00:00:00Z", + "OOMKilled": false, + "Paused": false, + "Pid": 1588, + "Restarting": false, + "Running": true, + "StartedAt": "2018-09-18T10:37:28.3668368Z", + "Status": "running" + } +} diff --git a/docker-java/src/test/resources/samples/1.38/info/lcow.json b/docker-java/src/test/resources/samples/1.38/info/lcow.json index 7ab600449..9c31020d0 100644 --- a/docker-java/src/test/resources/samples/1.38/info/lcow.json +++ b/docker-java/src/test/resources/samples/1.38/info/lcow.json @@ -1,93 +1,123 @@ { - "Architecture": "x86_64", - "BridgeNfIp6tables": true, - "BridgeNfIptables": true, - "CPUSet": false, - "CPUShares": false, - "CgroupDriver": "", - "ClusterAdvertise": "", - "ClusterStore": "", - "ContainerdCommit": { - "Expected": "", - "ID": "" - }, - "Containers": 3, - "ContainersPaused": 0, - "ContainersRunning": 0, - "ContainersStopped": 3, - "CpuCfsPeriod": false, - "CpuCfsQuota": false, - "Debug": true, - "DefaultRuntime": "", - "DockerRootDir": "C:\\ProgramData\\Docker", - "Driver": "windowsfilter (windows) lcow (linux)", - "DriverStatus": [["Windows", ""], ["LCOW", ""]], - "ExperimentalBuild": true, - "GenericResources": null, - "HttpProxy": "", - "HttpsProxy": "", - "ID": "ZOGT:VB24:YEPZ:Y7HU:JHPB:WNUE:UYQG:7YRY:VLZV:FLWV:R65B:ICZG", - "IPv4Forwarding": true, - "Images": 2, - "IndexServerAddress": "https://index.docker.io/v1/", - "InitBinary": "", - "InitCommit": { - "Expected": "", - "ID": "" - }, - "Isolation": "hyperv", - "KernelMemory": false, - "KernelVersion": "10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)", - "Labels": [], - "LiveRestoreEnabled": false, - "LoggingDriver": "json-file", - "MemTotal": 68684476416, - "MemoryLimit": false, - "NCPU": 8, - "NEventsListener": 1, - "NFd": -1, - "NGoroutines": 28, - "Name": "somename", - "NoProxy": "", - "OSType": "windows", - "OomKillDisable": false, - "OperatingSystem": "Windows 10 Pro Version 1803 (OS Build 17134.228)", - "Plugins": { - "Authorization": null, - "Log": ["awslogs", "etwlogs", "fluentd", "gelf", "json-file", "logentries", "splunk", "syslog"], - "Network": ["ics", "l2bridge", "l2tunnel", "nat", "null", "overlay", "transparent"], - "Volume": ["local"] - }, - "RegistryConfig": { - "AllowNondistributableArtifactsCIDRs": [], - "AllowNondistributableArtifactsHostnames": [], - "IndexConfigs": { - "docker.io": { - "Mirrors": [], - "Name": "docker.io", - "Official": true, - "Secure": true - } + "Architecture": "x86_64", + "BridgeNfIp6tables": true, + "BridgeNfIptables": true, + "CPUSet": false, + "CPUShares": false, + "CgroupDriver": "", + "ClusterAdvertise": "", + "ClusterStore": "", + "ContainerdCommit": { + "Expected": "", + "ID": "" }, - "InsecureRegistryCIDRs": ["127.0.0.0/8"], - "Mirrors": [] - }, - "RuncCommit": { - "Expected": "", - "ID": "" - }, - "Runtimes": null, - "SecurityOptions": [], - "ServerVersion": "18.06.1-ce", - "SwapLimit": false, - "Swarm": { - "ControlAvailable": false, - "Error": "", - "LocalNodeState": "inactive", - "NodeAddr": "", - "NodeID": "", - "RemoteManagers": null - }, - "SystemStatus": null, - "SystemTime": "2018-09-14T09:40:05.1369294+02:00" + "Containers": 3, + "ContainersPaused": 0, + "ContainersRunning": 0, + "ContainersStopped": 3, + "CpuCfsPeriod": false, + "CpuCfsQuota": false, + "Debug": true, + "DefaultRuntime": "", + "DockerRootDir": "C:\\ProgramData\\Docker", + "Driver": "windowsfilter (windows) lcow (linux)", + "DriverStatus": [ + [ + "Windows", + "" + ], + [ + "LCOW", + "" + ] + ], + "ExperimentalBuild": true, + "GenericResources": null, + "HttpProxy": "", + "HttpsProxy": "", + "ID": "ZOGT:VB24:YEPZ:Y7HU:JHPB:WNUE:UYQG:7YRY:VLZV:FLWV:R65B:ICZG", + "IPv4Forwarding": true, + "Images": 2, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitBinary": "", + "InitCommit": { + "Expected": "", + "ID": "" + }, + "Isolation": "hyperv", + "KernelMemory": false, + "KernelVersion": "10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)", + "Labels": [], + "LiveRestoreEnabled": false, + "LoggingDriver": "json-file", + "MemTotal": 68684476416, + "MemoryLimit": false, + "NCPU": 8, + "NEventsListener": 1, + "NFd": -1, + "NGoroutines": 28, + "Name": "somename", + "NoProxy": "", + "OSType": "windows", + "OomKillDisable": false, + "OperatingSystem": "Windows 10 Pro Version 1803 (OS Build 17134.228)", + "Plugins": { + "Authorization": null, + "Log": [ + "awslogs", + "etwlogs", + "fluentd", + "gelf", + "json-file", + "logentries", + "splunk", + "syslog" + ], + "Network": [ + "ics", + "l2bridge", + "l2tunnel", + "nat", + "null", + "overlay", + "transparent" + ], + "Volume": [ + "local" + ] + }, + "RegistryConfig": { + "AllowNondistributableArtifactsCIDRs": [], + "AllowNondistributableArtifactsHostnames": [], + "IndexConfigs": { + "docker.io": { + "Mirrors": [], + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ], + "Mirrors": [] + }, + "RuncCommit": { + "Expected": "", + "ID": "" + }, + "Runtimes": null, + "SecurityOptions": [], + "ServerVersion": "18.06.1-ce", + "SwapLimit": false, + "Swarm": { + "ControlAvailable": false, + "Error": "", + "LocalNodeState": "inactive", + "NodeAddr": "", + "NodeID": "", + "RemoteManagers": null + }, + "SystemStatus": null, + "SystemTime": "2018-09-14T09:40:05.1369294+02:00" } diff --git a/docker-java/src/test/resources/samples/1.38/version/lcow.json b/docker-java/src/test/resources/samples/1.38/version/lcow.json index 21f496823..bcb363351 100644 --- a/docker-java/src/test/resources/samples/1.38/version/lcow.json +++ b/docker-java/src/test/resources/samples/1.38/version/lcow.json @@ -1,31 +1,32 @@ { - "ApiVersion": "1.38", - "Arch": "amd64", - "BuildTime": "2018-08-21T17:36:40.000000000+00:00", - "Components": [{ - "Details": { - "ApiVersion": "1.38", - "Arch": "amd64", - "BuildTime": "2018-08-21T17:36:40.000000000+00:00", - "Experimental": "true", - "GitCommit": "e68fc7a", - "GoVersion": "go1.10.3", - "KernelVersion": "10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)", - "MinAPIVersion": "1.24", - "Os": "windows" + "ApiVersion": "1.38", + "Arch": "amd64", + "BuildTime": "2018-08-21T17:36:40.000000000+00:00", + "Components": [ + { + "Details": { + "ApiVersion": "1.38", + "Arch": "amd64", + "BuildTime": "2018-08-21T17:36:40.000000000+00:00", + "Experimental": "true", + "GitCommit": "e68fc7a", + "GoVersion": "go1.10.3", + "KernelVersion": "10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)", + "MinAPIVersion": "1.24", + "Os": "windows" + }, + "Name": "Engine", + "Version": "18.06.1-ce" + } + ], + "Experimental": true, + "GitCommit": "e68fc7a", + "GoVersion": "go1.10.3", + "KernelVersion": "10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)", + "MinAPIVersion": "1.24", + "Os": "windows", + "Platform": { + "Name": "" }, - "Name": "Engine", "Version": "18.06.1-ce" - } - ], - "Experimental": true, - "GitCommit": "e68fc7a", - "GoVersion": "go1.10.3", - "KernelVersion": "10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)", - "MinAPIVersion": "1.24", - "Os": "windows", - "Platform": { - "Name": "" - }, - "Version": "18.06.1-ce" } diff --git a/docker-java/src/test/resources/someHomeDir/.docker/config.json b/docker-java/src/test/resources/someHomeDir/.docker/config.json index 02ed0cf7f..b8a7746c0 100644 --- a/docker-java/src/test/resources/someHomeDir/.docker/config.json +++ b/docker-java/src/test/resources/someHomeDir/.docker/config.json @@ -1,9 +1,8 @@ { - "auths":{ - "https://index.docker.io/v1/":{ - "auth":"dXNlcm5hbWU6cGFzc3dvcmQ=", - "email":"foo.bar@test.com" + "auths": { + "https://index.docker.io/v1/": { + "auth": "dXNlcm5hbWU6cGFzc3dvcmQ=", + "email": "foo.bar@test.com" } - } } diff --git a/docker-java/src/test/resources/testAuthConfigFile/validDockerConfig/config.json b/docker-java/src/test/resources/testAuthConfigFile/validDockerConfig/config.json index ee32e91ed..765595d62 100644 --- a/docker-java/src/test/resources/testAuthConfigFile/validDockerConfig/config.json +++ b/docker-java/src/test/resources/testAuthConfigFile/validDockerConfig/config.json @@ -1,12 +1,12 @@ { "auths": { - "quay.io" : { - "auth" : "Zm9vOmJhcg==", - "email" :"foo@example.com" + "quay.io": { + "auth": "Zm9vOmJhcg==", + "email": "foo@example.com" }, - "https://index.docker.io/v1/" : { - "auth" : "Zm9vMTpiYXIx", - "email" : "moo@example.com" + "https://index.docker.io/v1/": { + "auth": "Zm9vMTpiYXIx", + "email": "moo@example.com" } } -} \ No newline at end of file +} diff --git a/docker-java/src/test/resources/testAuthConfigFile/validDockerConfigWithCurrentContext/config.json b/docker-java/src/test/resources/testAuthConfigFile/validDockerConfigWithCurrentContext/config.json index 8c5963f87..3b77a8bfa 100644 --- a/docker-java/src/test/resources/testAuthConfigFile/validDockerConfigWithCurrentContext/config.json +++ b/docker-java/src/test/resources/testAuthConfigFile/validDockerConfigWithCurrentContext/config.json @@ -1,4 +1,4 @@ { - "auths": {}, - "currentContext": "expectedContext" + "auths": {}, + "currentContext": "expectedContext" } diff --git a/docker-java/src/test/resources/testAuthConfigFile/validJsonWithOnlyUnknown/config.json b/docker-java/src/test/resources/testAuthConfigFile/validJsonWithOnlyUnknown/config.json index cd5f7a124..e4d11456d 100644 --- a/docker-java/src/test/resources/testAuthConfigFile/validJsonWithOnlyUnknown/config.json +++ b/docker-java/src/test/resources/testAuthConfigFile/validJsonWithOnlyUnknown/config.json @@ -1,3 +1,3 @@ { - "credsStore" : "osxkeychain" + "credsStore": "osxkeychain" } diff --git a/docker-java/src/test/resources/testAuthConfigFile/validJsonWithUnknown/config.json b/docker-java/src/test/resources/testAuthConfigFile/validJsonWithUnknown/config.json index 557714668..19c43ba74 100644 --- a/docker-java/src/test/resources/testAuthConfigFile/validJsonWithUnknown/config.json +++ b/docker-java/src/test/resources/testAuthConfigFile/validJsonWithUnknown/config.json @@ -1,12 +1,12 @@ { - "auths": { - "192.168.99.100:32768": {}, - "https://index.docker.io/v1/": { - "auth": "Zm9vOmJhcg==", - "email": "foo@example.com" + "auths": { + "192.168.99.100:32768": {}, + "https://index.docker.io/v1/": { + "auth": "Zm9vOmJhcg==", + "email": "foo@example.com" + } + }, + "HttpHeaders": { + "User-Agent": "user agent" } - }, - "HttpHeaders": { - "User-Agent": "user agent" - } } diff --git a/docker-java/src/test/resources/travis-logback.xml b/docker-java/src/test/resources/travis-logback.xml index 06574e1a5..3edf8e57d 100644 --- a/docker-java/src/test/resources/travis-logback.xml +++ b/docker-java/src/test/resources/travis-logback.xml @@ -1,19 +1,19 @@ - - - %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n - - + + + %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n + + - - - - + + + + - - - + + + diff --git a/docs/getting_started.md b/docs/getting_started.md index 7781e38ec..486327ff7 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -3,18 +3,21 @@ ## Dependencies To start using `docker-java` , you need to add at least two dependencies: + 1. `com.github.docker-java:docker-java-core` for the `DockerClient` -1. one of `com.github.docker-java:docker-java-transport-*` to communicate with the Docker daemon. See [Available Transports](./transports.md) for more info. +1. one of `com.github.docker-java:docker-java-transport-*` to communicate with the Docker daemon. + See [Available Transports](./transports.md) for more info. -The latest available version: +The latest available version: [![Maven Central](https://img.shields.io/maven-central/v/com.github.docker-java/docker-java.svg)](https://mvnrepository.com/artifact/com.github.docker-java/docker-java) - ## Instantiating a `DockerClientConfig` -You will need an instance of `DockerClientConfig` to tell the library how to access Docker, which credentials to use to pull from Docker registries, etc etc. +You will need an instance of `DockerClientConfig` to tell the library how to access Docker, which credentials to use to pull from Docker +registries, etc etc. The builder is available and allows you to configure every property of the client: + ```java import com.github.dockerjava.core.DockerClientConfig import com.github.dockerjava.core.DefaultDockerClientConfig @@ -85,10 +88,13 @@ In the class path at `/docker-java.properties` ### Jackson -Should you need to customize the Jackson's `ObjectMapper` used by `docker-java`, you can create your own `DockerClientConfig` and override `DockerClientConfig#getObjectMapper()`. +Should you need to customize the Jackson's `ObjectMapper` used by `docker-java`, you can create your own `DockerClientConfig` and override +`DockerClientConfig#getObjectMapper()`. ## Instantiating a `DockerHttpClient` + Once you decided which transport to use, you will need to instantiate an HTTP client: + ```java DockerClientConfig config = ...; @@ -104,6 +110,7 @@ DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder() Please refer to selected transport's builder for other available configuration options (like timeouts). Once you have an HTTP client, you can make raw requests to the Docker daemon directly: + ```java Request request = Request.builder() .method(Request.Method.GET) @@ -119,11 +126,13 @@ try (Response response = httpClient.execute(request)) { ## Instantiating a `DockerClient` To get an instance of `DockerClient`, you need to pass both `DockerClientConfig` and `DockerHttpClient`: + ```java DockerClient dockerClient = DockerClientImpl.getInstance(config, httpClient); ``` Once you have it, you can start executing Docker commands: + ```java dockerClient.pingCmd().exec(); ``` diff --git a/docs/transports.md b/docs/transports.md index 18a93d9e0..8ada81397 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -1,74 +1,87 @@ # Available transports ## Apache HttpClient 5 -| | | -|---|---| -| Maven coordinates | `com.github.docker-java:docker-java-transport-httpclient5` | -| Stability | 🙂| -| Long term support plans | ✅ | -| Unix sockets support | ✅ | -| Windows Npipe support | ✅ | -| Stdin attachment support | ✅ | -This transport is based on Apache HttpClient library version 5, which has a great flexibility and allows us to implement all Docker-specific features and protocols required, without having to use internal APIs or anything. +| | | +|--------------------------|------------------------------------------------------------| +| Maven coordinates | `com.github.docker-java:docker-java-transport-httpclient5` | +| Stability | 🙂 | +| Long term support plans | ✅ | +| Unix sockets support | ✅ | +| Windows Npipe support | ✅ | +| Stdin attachment support | ✅ | + +This transport is based on Apache HttpClient library version 5, which has a great flexibility and allows us to implement all Docker-specific +features and protocols required, without having to use internal APIs or anything. It has everything to become the default transport of docker-java in future releases. ## "Zerodep" -| | | -|---|---| -| Maven coordinates | `com.github.docker-java:docker-java-transport-zerodep` | -| Stability | 🙂| -| Long term support plans | ✅ | -| Unix sockets support | ✅ | -| Windows Npipe support | ✅ | -| Stdin attachment support | ✅ | -The idea of this transport is to provide a transport that supports 100% of the features without having to worry about transitive dependencies. +| | | +|--------------------------|--------------------------------------------------------| +| Maven coordinates | `com.github.docker-java:docker-java-transport-zerodep` | +| Stability | 🙂 | +| Long term support plans | ✅ | +| Unix sockets support | ✅ | +| Windows Npipe support | ✅ | +| Stdin attachment support | ✅ | + +The idea of this transport is to provide a transport that supports 100% of the features without having to worry about transitive +dependencies. Note: due to the implementation details, it cannot be true "0 dependencies" module, so it needs to depend on `slf4j-api` and JNA. ## OkHttp -| | | -|---|---| -| Maven coordinates | `com.github.docker-java:docker-java-transport-okhttp` | -| Stability | 🧐| -| Long term support plans | ❓ | -| Unix sockets support | ✅ | -| Windows Npipe support | ✅ | -| Stdin attachment support | ✅ | -The OkHttp transport was first implemented in [the Testcontainers library](http://github.com/testcontainers/testcontainers-java) as a replacement for Netty. The main motivation for it was to not have heavy-weight Netty-specific native dependencies and the lack of Npipe support in the Netty one. +| | | +|--------------------------|-------------------------------------------------------| +| Maven coordinates | `com.github.docker-java:docker-java-transport-okhttp` | +| Stability | 🧐 | +| Long term support plans | ❓ | +| Unix sockets support | ✅ | +| Windows Npipe support | ✅ | +| Stdin attachment support | ✅ | + +The OkHttp transport was first implemented in [the Testcontainers library](http://github.com/testcontainers/testcontainers-java) as a +replacement for Netty. The main motivation for it was to not have heavy-weight Netty-specific native dependencies and the lack of Npipe +support in the Netty one. -OkHttp's migration to Kotlin and the need to use internal APIs for doing stdin hijacking makes us question the future of this transport (still under the consideration). +OkHttp's migration to Kotlin and the need to use internal APIs for doing stdin hijacking makes us question the future of this transport ( +still under the consideration). ## Netty -| | | -|---|---| -| Maven coordinates | `com.github.docker-java:docker-java-transport-netty` | -| Stability | 🧐| -| Long term support plans | ❌ | -| Unix sockets support | ✅ | -| Windows Npipe support | ❌ | -| Stdin attachment support | ✅ | + +| | | +|--------------------------|------------------------------------------------------| +| Maven coordinates | `com.github.docker-java:docker-java-transport-netty` | +| Stability | 🧐 | +| Long term support plans | ❌ | +| Unix sockets support | ✅ | +| Windows Npipe support | ❌ | +| Stdin attachment support | ✅ | Netty was the first alternative transport introduced as an alternative to Jersey. -Although it gives a very low level access to the protocol, the lack of Windows Npipe support and the native library dependency for Unix Sockets make it hard to maintain and there are no plans to continue including this transport option in future versions. +Although it gives a very low level access to the protocol, the lack of Windows Npipe support and the native library dependency for Unix +Sockets make it hard to maintain and there are no plans to continue including this transport option in future versions. -The community may decide to pick it up and continue the development as a 3rd party transport based on the existing abstractions `docker-java` provides. +The community may decide to pick it up and continue the development as a 3rd party transport based on the existing abstractions +`docker-java` provides. ## Jersey -| | | -|---|---| -| Maven coordinates | `com.github.docker-java:docker-java-transport-jersey` | -| Stability | 🙃| -| Long term support plans | ❌ | -| Unix sockets support | ✅ | -| Windows Npipe support | ❌ | -| Stdin attachment support | ❌ | - -Jersey was the initial transport of the project. And, while working well, it was lacking support for connection hijacking (e.g. stdin attachment) or Windows Npipes. + +| | | +|--------------------------|-------------------------------------------------------| +| Maven coordinates | `com.github.docker-java:docker-java-transport-jersey` | +| Stability | 🙃 | +| Long term support plans | ❌ | +| Unix sockets support | ✅ | +| Windows Npipe support | ❌ | +| Stdin attachment support | ❌ | + +Jersey was the initial transport of the project. And, while working well, it was lacking support for connection hijacking (e.g. stdin +attachment) or Windows Npipes. The big amount of dependencies was also causing issues. Since Apache HttpClient 5-based transport is available now, there is no reason to keep Jersey and it will eventually be removed. diff --git a/etc/certs/README.md b/etc/certs/README.md index 165265a0d..575245d7a 100644 --- a/etc/certs/README.md +++ b/etc/certs/README.md @@ -1,15 +1,18 @@ # Creating Certificates for Docker ## Warning + > These certificates are only meant for integration tests on CI environments (like circleCI). Do not use them for any real machine. > Since all keys are publicly available anybody could gain root access to your machine. ### 1. Create the certificate files + There is an [excellent guide](https://docs.docker.com/articles/https/) on the official docker homepage. This document contains the log on how the certificates in this folder were created. It differs slightly form the official guide. - - Certificates are valid for 10 years instead of 1 year. - - Certificates use v3_req extension to support both `127.0.0.1` and `localhost` (see config file [server-cert.txt](server-cert.txt)). + +- Certificates are valid for 10 years instead of 1 year. +- Certificates use v3_req extension to support both `127.0.0.1` and `localhost` (see config file [server-cert.txt](server-cert.txt)). ``` $ cd ~ @@ -133,13 +136,16 @@ openssl x509 -in .pem -inform pem -noout -text ``` ### 2. Configuring the docker daemon + On linux the docker daemon allows to specify options in the file `/etc/default/docker`. By adding the following line (or modifying an existing line) one can get the docker daemon to listen on both *unix socket* and *https*. + ``` DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://127.0.0.1:2376 --tlsverify --tlscacert=~/.docker/ca.pem --tlscert=~/.docker/server-cert.pem --tlskey=~/.docker/server-key.pem" ``` ### 3. Restart the daemon and test the setup + After changing the daemon options it must be restarted ``` diff --git a/etc/docker-java-formatter.xml b/etc/docker-java-formatter.xml index 211b0a223..5a9852724 100644 --- a/etc/docker-java-formatter.xml +++ b/etc/docker-java-formatter.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -36,287 +36,287 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -328,260 +328,260 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index f58a3d448..9fa324d98 100644 --- a/pom.xml +++ b/pom.xml @@ -57,37 +57,55 @@ 1.8 1.8 - 2.30.1 - 2.10.3 - 2.10.3 - 4.5.12 - 1.21 - 2.13.0 - 3.12.0 - 1.7.30 + 3.1.10 + 2.18.2 + 2.18.2 + 4.5.14 + 5.3.1 + 4.4.16 + 1.27.1 + 2.18.0 + 3.17.0 + 2.0.16 + 5.0.0-alpha.14 - 1.76 - 2.6.1 - 19.0 + 1.80 + 2.10.1 + 33.4.0-jre + 3.27.3 - 1.2.3 - 4.1.46.Final + 4.13.2 + 5.12.0-RC2 + 1.4.0 + 1.5.16 + 4.2.0.RC3 2.2 1.8 2.3.3 - 3.3.0 + 5.15.2 + 1.20.4 + + 1.0 + 4.2.2 + 4.9.1 + 1.18.36 + 2.10.1 + 5.16.0 + 2.0.16 - 3.0.2 - 3.8.1 - 3.0.0-M1 - 3.0.0-M4 - 3.0.0-M4 - 1.8 + + 3.4.2 + 3.13.0 + 3.1.1 + 3.5.2 + 3.5.2 + 3.1.0 1.1.2.RELEASE - 3.0.0 - 1.6.8 + 3.6.0 + 1.7.0 + 0.18.3 @@ -238,13 +256,11 @@ maven-bundle-plugin 4.2.1 - - com.github.siom79.japicmp japicmp-maven-plugin - 0.18.3 + ${japicmp-maven-plugin.version} @@ -260,6 +276,9 @@ + + javax.ws.rs.WebApplicationException + true public true @@ -277,14 +296,6 @@ - - - verify - - cmp - - - diff --git a/src/test/resources/checkstyle/checkstyle-config.xml b/src/test/resources/checkstyle/checkstyle-config.xml index 76671ded3..415561825 100644 --- a/src/test/resources/checkstyle/checkstyle-config.xml +++ b/src/test/resources/checkstyle/checkstyle-config.xml @@ -1,170 +1,170 @@ + "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +