File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
docker-java/src/test/java/com/github/dockerjava/cmd Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11package com .github .dockerjava .cmd ;
22
3+ import com .github .dockerjava .api .command .LoadImageCallback ;
34import com .github .dockerjava .api .model .Image ;
45import com .github .dockerjava .utils .TestResources ;
56import net .jcip .annotations .NotThreadSafe ;
@@ -53,6 +54,19 @@ public void loadImageFromTar() throws Exception {
5354 asList (image .getRepoTags ()), equalTo (singletonList ("docker-java/load:1.0" )));
5455 }
5556
57+ @ Test
58+ public void loadImageFromTarAsync () throws Exception {
59+ try (InputStream uploadStream = Files .newInputStream (TestResources .getApiImagesLoadTestTarball ())) {
60+ dockerRule .getClient ().loadImageAsyncCmd (uploadStream ).exec (new LoadImageCallback ()).awaitMessage ();
61+ }
62+
63+ final Image image = findImageWithId (expectedImageId , dockerRule .getClient ().listImagesCmd ().exec ());
64+
65+ assertThat ("Can't find expected image after loading from a tar archive!" , image , notNullValue ());
66+ assertThat ("Image after loading from a tar archive has wrong tags!" ,
67+ asList (image .getRepoTags ()), equalTo (singletonList ("docker-java/load:1.0" )));
68+ }
69+
5670 private Image findImageWithId (final String id , final List <Image > images ) {
5771 for (Image image : images ) {
5872 if (id .equals (image .getId ())) {
You can’t perform that action at this time.
0 commit comments