{"action":"created","comment":{"url":"https://api.github.com/repos/docker-java/docker-java/pulls/comments/69719134","id":69719134,"diff_hunk":"@@ -0,0 +1,73 @@\n+package com.github.dockerjava.netty.exec;\n+\n+import com.github.dockerjava.api.model.Image;\n+\n+import com.github.dockerjava.netty.AbstractNettyDockerClientTest;\n+import org.testng.ITestResult;\n+import org.testng.annotations.AfterMethod;\n+import org.testng.annotations.AfterTest;\n+import org.testng.annotations.BeforeMethod;\n+import org.testng.annotations.BeforeTest;\n+import org.testng.annotations.Test;\n+\n+import java.io.InputStream;\n+import java.lang.reflect.Method;\n+import java.nio.file.Files;\n+import java.nio.file.Path;\n+import java.nio.file.Paths;\n+import java.util.List;\n+\n+@Test(groups = \"integration\")\n+public class LoadImageCmdExecTest extends AbstractNettyDockerClientTest {\n+\n+    private String expectedImageId;\n+\n+    @BeforeTest\n+    public void beforeTest() throws Exception {\n+        super.beforeTest();\n+    }\n+\n+    @AfterTest\n+    public void afterTest() {\n+        super.afterTest();\n+    }\n+\n+    @BeforeMethod\n+    public void beforeMethod(Method method) {\n+        super.beforeMethod(method);\n+        expectedImageId = \"sha256:5d195fbfc7b1ee5cef048b156c2eb9a6e7f00db14420b65d99d0f74a24235764\";\n+        if (findImageWithId(expectedImageId, dockerClient.listImagesCmd().exec()) != null) {\n+            dockerClient.removeImageCmd(expectedImageId).exec();\n+        }\n+    }\n+\n+    @AfterMethod\n+    public void afterMethod(ITestResult result) {\n+        dockerClient.removeImageCmd(expectedImageId).exec();\n+        super.afterMethod(result);\n+    }\n+\n+    @Test\n+    public void loadImageFromTar() throws Exception {\n+        final Path imageTarFile = Paths.get(\"src/test/resources/testLoadImageFromTar/image.tar\");","path":"src/test/java/com/github/dockerjava/netty/exec/LoadImageCmdExecTest.java","position":52,"original_position":52,"commit_id":"d9423d5462d60058c08f2ad2fe8b70ed08a7f078","original_commit_id":"d9423d5462d60058c08f2ad2fe8b70ed08a7f078","user":{"login":"lanwen","id":1964214,"avatar_url":"https://avatars.githubusercontent.com/u/1964214?v=3","gravatar_id":"","url":"https://api.github.com/users/lanwen","html_url":"https://github.com/lanwen","followers_url":"https://api.github.com/users/lanwen/followers","following_url":"https://api.github.com/users/lanwen/following{/other_user}","gists_url":"https://api.github.com/users/lanwen/gists{/gist_id}","starred_url":"https://api.github.com/users/lanwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lanwen/subscriptions","organizations_url":"https://api.github.com/users/lanwen/orgs","repos_url":"https://api.github.com/users/lanwen/repos","events_url":"https://api.github.com/users/lanwen/events{/privacy}","received_events_url":"https://api.github.com/users/lanwen/received_events","type":"User","site_admin":false},"body":"please use CurrentThread classloader to get input stream - as of on different os this path may be changed","created_at":"2016-07-06T12:16:46Z","updated_at":"2016-07-06T12:16:46Z","html_url":"https://github.com/docker-java/docker-java/pull/627#discussion_r69719134","pull_request_url":"https://api.github.com/repos/docker-java/docker-java/pulls/627","_links":{"self":{"href":"https://api.github.com/repos/docker-java/docker-java/pulls/comments/69719134"},"html":{"href":"https://github.com/docker-java/docker-java/pull/627#discussion_r69719134"},"pull_request":{"href":"https://api.github.com/repos/docker-java/docker-java/pulls/627"}}},"pull_request":{"url":"https://api.github.com/repos/docker-java/docker-java/pulls/627","id":76417535,"html_url":"https://github.com/docker-java/docker-java/pull/627","diff_url":"https://github.com/docker-java/docker-java/pull/627.diff","patch_url":"https://github.com/docker-java/docker-java/pull/627.patch","issue_url":"https://api.github.com/repos/docker-java/docker-java/issues/627","number":627,"state":"open","locked":false,"title":"Implementation of POST /images/load endpoint","user":{"login":"leonsabr","id":1412876,"avatar_url":"https://avatars.githubusercontent.com/u/1412876?v=3","gravatar_id":"","url":"https://api.github.com/users/leonsabr","html_url":"https://github.com/leonsabr","followers_url":"https://api.github.com/users/leonsabr/followers","following_url":"https://api.github.com/users/leonsabr/following{/other_user}","gists_url":"https://api.github.com/users/leonsabr/gists{/gist_id}","starred_url":"https://api.github.com/users/leonsabr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonsabr/subscriptions","organizations_url":"https://api.github.com/users/leonsabr/orgs","repos_url":"https://api.github.com/users/leonsabr/repos","events_url":"https://api.github.com/users/leonsabr/events{/privacy}","received_events_url":"https://api.github.com/users/leonsabr/received_events","type":"User","site_admin":false},"body":"This is an implementation of [POST /images/load](https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/load-a-tarball-with-a-set-of-images-and-tags-into-docker) endpoint.\r\n\r\nA few words about testing. I added a small tarball (20 kB) with a single image named \"docker-java/load:1.0\". Tests try to load this tarball into docker, check if expected image appears, and remove it in @AfterMethod. Test for `netty` implementation is the same as for `jaxrs/jersey` implementation.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/docker-java/docker-java/627)\n<!-- Reviewable:end -->\n","created_at":"2016-07-06T11:31:40Z","updated_at":"2016-07-06T12:16:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36c842e9168a2860a13b67c3a91d72bd99979138","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/docker-java/docker-java/pulls/627/commits","review_comments_url":"https://api.github.com/repos/docker-java/docker-java/pulls/627/comments","review_comment_url":"https://api.github.com/repos/docker-java/docker-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker-java/docker-java/issues/627/comments","statuses_url":"https://api.github.com/repos/docker-java/docker-java/statuses/d9423d5462d60058c08f2ad2fe8b70ed08a7f078","head":{"label":"leonsabr:images_load","ref":"images_load","sha":"d9423d5462d60058c08f2ad2fe8b70ed08a7f078","user":{"login":"leonsabr","id":1412876,"avatar_url":"https://avatars.githubusercontent.com/u/1412876?v=3","gravatar_id":"","url":"https://api.github.com/users/leonsabr","html_url":"https://github.com/leonsabr","followers_url":"https://api.github.com/users/leonsabr/followers","following_url":"https://api.github.com/users/leonsabr/following{/other_user}","gists_url":"https://api.github.com/users/leonsabr/gists{/gist_id}","starred_url":"https://api.github.com/users/leonsabr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonsabr/subscriptions","organizations_url":"https://api.github.com/users/leonsabr/orgs","repos_url":"https://api.github.com/users/leonsabr/repos","events_url":"https://api.github.com/users/leonsabr/events{/privacy}","received_events_url":"https://api.github.com/users/leonsabr/received_events","type":"User","site_admin":false},"repo":{"id":62572283,"name":"docker-java","full_name":"leonsabr/docker-java","owner":{"login":"leonsabr","id":1412876,"avatar_url":"https://avatars.githubusercontent.com/u/1412876?v=3","gravatar_id":"","url":"https://api.github.com/users/leonsabr","html_url":"https://github.com/leonsabr","followers_url":"https://api.github.com/users/leonsabr/followers","following_url":"https://api.github.com/users/leonsabr/following{/other_user}","gists_url":"https://api.github.com/users/leonsabr/gists{/gist_id}","starred_url":"https://api.github.com/users/leonsabr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonsabr/subscriptions","organizations_url":"https://api.github.com/users/leonsabr/orgs","repos_url":"https://api.github.com/users/leonsabr/repos","events_url":"https://api.github.com/users/leonsabr/events{/privacy}","received_events_url":"https://api.github.com/users/leonsabr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leonsabr/docker-java","description":"Java Docker API Client","fork":true,"url":"https://api.github.com/repos/leonsabr/docker-java","forks_url":"https://api.github.com/repos/leonsabr/docker-java/forks","keys_url":"https://api.github.com/repos/leonsabr/docker-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leonsabr/docker-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leonsabr/docker-java/teams","hooks_url":"https://api.github.com/repos/leonsabr/docker-java/hooks","issue_events_url":"https://api.github.com/repos/leonsabr/docker-java/issues/events{/number}","events_url":"https://api.github.com/repos/leonsabr/docker-java/events","assignees_url":"https://api.github.com/repos/leonsabr/docker-java/assignees{/user}","branches_url":"https://api.github.com/repos/leonsabr/docker-java/branches{/branch}","tags_url":"https://api.github.com/repos/leonsabr/docker-java/tags","blobs_url":"https://api.github.com/repos/leonsabr/docker-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leonsabr/docker-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leonsabr/docker-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/leonsabr/docker-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leonsabr/docker-java/statuses/{sha}","languages_url":"https://api.github.com/repos/leonsabr/docker-java/languages","stargazers_url":"https://api.github.com/repos/leonsabr/docker-java/stargazers","contributors_url":"https://api.github.com/repos/leonsabr/docker-java/contributors","subscribers_url":"https://api.github.com/repos/leonsabr/docker-java/subscribers","subscription_url":"https://api.github.com/repos/leonsabr/docker-java/subscription","commits_url":"https://api.github.com/repos/leonsabr/docker-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/leonsabr/docker-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/leonsabr/docker-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/leonsabr/docker-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/leonsabr/docker-java/contents/{+path}","compare_url":"https://api.github.com/repos/leonsabr/docker-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leonsabr/docker-java/merges","archive_url":"https://api.github.com/repos/leonsabr/docker-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leonsabr/docker-java/downloads","issues_url":"https://api.github.com/repos/leonsabr/docker-java/issues{/number}","pulls_url":"https://api.github.com/repos/leonsabr/docker-java/pulls{/number}","milestones_url":"https://api.github.com/repos/leonsabr/docker-java/milestones{/number}","notifications_url":"https://api.github.com/repos/leonsabr/docker-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leonsabr/docker-java/labels{/name}","releases_url":"https://api.github.com/repos/leonsabr/docker-java/releases{/id}","deployments_url":"https://api.github.com/repos/leonsabr/docker-java/deployments","created_at":"2016-07-04T15:34:16Z","updated_at":"2016-07-04T15:34:18Z","pushed_at":"2016-07-06T10:48:56Z","git_url":"git://github.com/leonsabr/docker-java.git","ssh_url":"git@github.com:leonsabr/docker-java.git","clone_url":"https://github.com/leonsabr/docker-java.git","svn_url":"https://github.com/leonsabr/docker-java","homepage":"","size":3300,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker-java:master","ref":"master","sha":"898d6fa3c7dd7367327f21ed3f3088e0f1f9e691","user":{"login":"docker-java","id":7772003,"avatar_url":"https://avatars.githubusercontent.com/u/7772003?v=3","gravatar_id":"","url":"https://api.github.com/users/docker-java","html_url":"https://github.com/docker-java","followers_url":"https://api.github.com/users/docker-java/followers","following_url":"https://api.github.com/users/docker-java/following{/other_user}","gists_url":"https://api.github.com/users/docker-java/gists{/gist_id}","starred_url":"https://api.github.com/users/docker-java/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker-java/subscriptions","organizations_url":"https://api.github.com/users/docker-java/orgs","repos_url":"https://api.github.com/users/docker-java/repos","events_url":"https://api.github.com/users/docker-java/events{/privacy}","received_events_url":"https://api.github.com/users/docker-java/received_events","type":"Organization","site_admin":false},"repo":{"id":20415251,"name":"docker-java","full_name":"docker-java/docker-java","owner":{"login":"docker-java","id":7772003,"avatar_url":"https://avatars.githubusercontent.com/u/7772003?v=3","gravatar_id":"","url":"https://api.github.com/users/docker-java","html_url":"https://github.com/docker-java","followers_url":"https://api.github.com/users/docker-java/followers","following_url":"https://api.github.com/users/docker-java/following{/other_user}","gists_url":"https://api.github.com/users/docker-java/gists{/gist_id}","starred_url":"https://api.github.com/users/docker-java/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker-java/subscriptions","organizations_url":"https://api.github.com/users/docker-java/orgs","repos_url":"https://api.github.com/users/docker-java/repos","events_url":"https://api.github.com/users/docker-java/events{/privacy}","received_events_url":"https://api.github.com/users/docker-java/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker-java/docker-java","description":"Java Docker API Client","fork":false,"url":"https://api.github.com/repos/docker-java/docker-java","forks_url":"https://api.github.com/repos/docker-java/docker-java/forks","keys_url":"https://api.github.com/repos/docker-java/docker-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker-java/docker-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker-java/docker-java/teams","hooks_url":"https://api.github.com/repos/docker-java/docker-java/hooks","issue_events_url":"https://api.github.com/repos/docker-java/docker-java/issues/events{/number}","events_url":"https://api.github.com/repos/docker-java/docker-java/events","assignees_url":"https://api.github.com/repos/docker-java/docker-java/assignees{/user}","branches_url":"https://api.github.com/repos/docker-java/docker-java/branches{/branch}","tags_url":"https://api.github.com/repos/docker-java/docker-java/tags","blobs_url":"https://api.github.com/repos/docker-java/docker-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker-java/docker-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker-java/docker-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker-java/docker-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker-java/docker-java/statuses/{sha}","languages_url":"https://api.github.com/repos/docker-java/docker-java/languages","stargazers_url":"https://api.github.com/repos/docker-java/docker-java/stargazers","contributors_url":"https://api.github.com/repos/docker-java/docker-java/contributors","subscribers_url":"https://api.github.com/repos/docker-java/docker-java/subscribers","subscription_url":"https://api.github.com/repos/docker-java/docker-java/subscription","commits_url":"https://api.github.com/repos/docker-java/docker-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker-java/docker-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker-java/docker-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker-java/docker-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker-java/docker-java/contents/{+path}","compare_url":"https://api.github.com/repos/docker-java/docker-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker-java/docker-java/merges","archive_url":"https://api.github.com/repos/docker-java/docker-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker-java/docker-java/downloads","issues_url":"https://api.github.com/repos/docker-java/docker-java/issues{/number}","pulls_url":"https://api.github.com/repos/docker-java/docker-java/pulls{/number}","milestones_url":"https://api.github.com/repos/docker-java/docker-java/milestones{/number}","notifications_url":"https://api.github.com/repos/docker-java/docker-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker-java/docker-java/labels{/name}","releases_url":"https://api.github.com/repos/docker-java/docker-java/releases{/id}","deployments_url":"https://api.github.com/repos/docker-java/docker-java/deployments","created_at":"2014-06-02T18:47:31Z","updated_at":"2016-07-06T09:46:05Z","pushed_at":"2016-07-06T11:31:44Z","git_url":"git://github.com/docker-java/docker-java.git","ssh_url":"git@github.com:docker-java/docker-java.git","clone_url":"https://github.com/docker-java/docker-java.git","svn_url":"https://github.com/docker-java/docker-java","homepage":"","size":4719,"stargazers_count":446,"watchers_count":446,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":305,"mirror_url":null,"open_issues_count":58,"forks":305,"open_issues":58,"watchers":446,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker-java/docker-java/pulls/627"},"html":{"href":"https://github.com/docker-java/docker-java/pull/627"},"issue":{"href":"https://api.github.com/repos/docker-java/docker-java/issues/627"},"comments":{"href":"https://api.github.com/repos/docker-java/docker-java/issues/627/comments"},"review_comments":{"href":"https://api.github.com/repos/docker-java/docker-java/pulls/627/comments"},"review_comment":{"href":"https://api.github.com/repos/docker-java/docker-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker-java/docker-java/pulls/627/commits"},"statuses":{"href":"https://api.github.com/repos/docker-java/docker-java/statuses/d9423d5462d60058c08f2ad2fe8b70ed08a7f078"}}}}
{"actor":{"display_login":"lanwen"}}