{"action":"created","comment":{"url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/comments/119274115","pull_request_review_id":41136486,"id":119274115,"diff_hunk":"@@ -0,0 +1,52 @@\n+\n+/**\n+ * （JUnit実践入門より）\n+ * 処理をバックグラウンドのスレッドで非同期に実行したい。\n+ * バックグラウンドスレッドで処理するBackgroundTaskクラスを作成し、\n+ * タスクがバックグラウンドのスレッドで実行されることを検証するテストを作成せよ。\n+ * なお、タスクはRunnableオブジェクトに実装する。\n+ *\n+ * ヒント\n+ *\n+ * 設計\n+ * BackgroundTaskは、コンストラクタでRunnableオブジェクトを引数に持つ\n+ * BackgroundTaskクラスに、invokeメソッドを定義する\n+ * invokeメソッドは、引数を持たず、戻り値をvoid型とする\n+ * invokeメソッドでは、バックグラウンドスレッドでタスクを実行し、すぐに制御を呼び出し元に返す\n+ *\n+ * テストケース\n+ * invokeメソッドによりRunnableオブジェクトのrunメソッドが別スレッドで実行される\n+*/\n+\n+import static org.hamcrest.CoreMatchers.*;\n+import static org.junit.Assert.*;\n+\n+import java.util.concurrent.LinkedBlockingQueue;\n+\n+import org.junit.Test;\n+\n+public class BackgroundTaskTest {\n+\n+    @Test\n+    public void Runnableオブジェクトを渡すとバックグラウンドでrunが実行されること() throws InterruptedException {\n+        LinkedBlockingQueue<Integer> queue = new LinkedBlockingQueue<>(1);\n+        StringBuffer str = new StringBuffer();","path":"Issues6/BackgroundTaskTest.java","position":33,"original_position":33,"commit_id":"b3f8446794aa233a5c8af112bcd7d5732421ce43","original_commit_id":"b3f8446794aa233a5c8af112bcd7d5732421ce43","user":{"login":"sakai-y","id":10514428,"avatar_url":"https://avatars0.githubusercontent.com/u/10514428?v=3","gravatar_id":"","url":"https://api.github.com/users/sakai-y","html_url":"https://github.com/sakai-y","followers_url":"https://api.github.com/users/sakai-y/followers","following_url":"https://api.github.com/users/sakai-y/following{/other_user}","gists_url":"https://api.github.com/users/sakai-y/gists{/gist_id}","starred_url":"https://api.github.com/users/sakai-y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakai-y/subscriptions","organizations_url":"https://api.github.com/users/sakai-y/orgs","repos_url":"https://api.github.com/users/sakai-y/repos","events_url":"https://api.github.com/users/sakai-y/events{/privacy}","received_events_url":"https://api.github.com/users/sakai-y/received_events","type":"User","site_admin":false},"body":"`StringBuffer`はスレッド間でデータを受け渡しするためのものでは・・・","created_at":"2017-05-31T05:38:35Z","updated_at":"2017-05-31T05:38:40Z","html_url":"https://github.com/hironoriohashi/JavaQuest/pull/30#discussion_r119274115","pull_request_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/comments/119274115"},"html":{"href":"https://github.com/hironoriohashi/JavaQuest/pull/30#discussion_r119274115"},"pull_request":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30","id":122600149,"html_url":"https://github.com/hironoriohashi/JavaQuest/pull/30","diff_url":"https://github.com/hironoriohashi/JavaQuest/pull/30.diff","patch_url":"https://github.com/hironoriohashi/JavaQuest/pull/30.patch","issue_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/30","number":30,"state":"open","locked":false,"title":"Issues6の課題","user":{"login":"hironoriohashi","id":27398594,"avatar_url":"https://avatars1.githubusercontent.com/u/27398594?v=3","gravatar_id":"","url":"https://api.github.com/users/hironoriohashi","html_url":"https://github.com/hironoriohashi","followers_url":"https://api.github.com/users/hironoriohashi/followers","following_url":"https://api.github.com/users/hironoriohashi/following{/other_user}","gists_url":"https://api.github.com/users/hironoriohashi/gists{/gist_id}","starred_url":"https://api.github.com/users/hironoriohashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hironoriohashi/subscriptions","organizations_url":"https://api.github.com/users/hironoriohashi/orgs","repos_url":"https://api.github.com/users/hironoriohashi/repos","events_url":"https://api.github.com/users/hironoriohashi/events{/privacy}","received_events_url":"https://api.github.com/users/hironoriohashi/received_events","type":"User","site_admin":false},"body":"Issues6の課題、BackgroundTask.javaとBackgroundTaskTest.javaを作成しました。\r\nレビューお願いします。\r\nclose #21","created_at":"2017-05-26T09:00:11Z","updated_at":"2017-05-31T05:38:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40e0ae29c5b0c63fa615a0a24a06947bf7cfc097","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30/commits","review_comments_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30/comments","review_comment_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/30/comments","statuses_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/statuses/b3f8446794aa233a5c8af112bcd7d5732421ce43","head":{"label":"hironoriohashi:Issues6","ref":"Issues6","sha":"b3f8446794aa233a5c8af112bcd7d5732421ce43","user":{"login":"hironoriohashi","id":27398594,"avatar_url":"https://avatars1.githubusercontent.com/u/27398594?v=3","gravatar_id":"","url":"https://api.github.com/users/hironoriohashi","html_url":"https://github.com/hironoriohashi","followers_url":"https://api.github.com/users/hironoriohashi/followers","following_url":"https://api.github.com/users/hironoriohashi/following{/other_user}","gists_url":"https://api.github.com/users/hironoriohashi/gists{/gist_id}","starred_url":"https://api.github.com/users/hironoriohashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hironoriohashi/subscriptions","organizations_url":"https://api.github.com/users/hironoriohashi/orgs","repos_url":"https://api.github.com/users/hironoriohashi/repos","events_url":"https://api.github.com/users/hironoriohashi/events{/privacy}","received_events_url":"https://api.github.com/users/hironoriohashi/received_events","type":"User","site_admin":false},"repo":{"id":88687381,"name":"JavaQuest","full_name":"hironoriohashi/JavaQuest","owner":{"login":"hironoriohashi","id":27398594,"avatar_url":"https://avatars1.githubusercontent.com/u/27398594?v=3","gravatar_id":"","url":"https://api.github.com/users/hironoriohashi","html_url":"https://github.com/hironoriohashi","followers_url":"https://api.github.com/users/hironoriohashi/followers","following_url":"https://api.github.com/users/hironoriohashi/following{/other_user}","gists_url":"https://api.github.com/users/hironoriohashi/gists{/gist_id}","starred_url":"https://api.github.com/users/hironoriohashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hironoriohashi/subscriptions","organizations_url":"https://api.github.com/users/hironoriohashi/orgs","repos_url":"https://api.github.com/users/hironoriohashi/repos","events_url":"https://api.github.com/users/hironoriohashi/events{/privacy}","received_events_url":"https://api.github.com/users/hironoriohashi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hironoriohashi/JavaQuest","description":"ProgrammingLesson","fork":false,"url":"https://api.github.com/repos/hironoriohashi/JavaQuest","forks_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/forks","keys_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/teams","hooks_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/hooks","issue_events_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/events{/number}","events_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/events","assignees_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/assignees{/user}","branches_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/branches{/branch}","tags_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/tags","blobs_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/refs{/sha}","trees_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/statuses/{sha}","languages_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/languages","stargazers_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/stargazers","contributors_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/contributors","subscribers_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/subscribers","subscription_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/subscription","commits_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/commits{/sha}","git_commits_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/commits{/sha}","comments_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/comments{/number}","issue_comment_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/comments{/number}","contents_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/contents/{+path}","compare_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/merges","archive_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/downloads","issues_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues{/number}","pulls_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls{/number}","milestones_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/milestones{/number}","notifications_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/labels{/name}","releases_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/releases{/id}","deployments_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/deployments","created_at":"2017-04-19T01:39:41Z","updated_at":"2017-04-21T01:49:40Z","pushed_at":"2017-05-31T05:36:09Z","git_url":"git://github.com/hironoriohashi/JavaQuest.git","ssh_url":"git@github.com:hironoriohashi/JavaQuest.git","clone_url":"https://github.com/hironoriohashi/JavaQuest.git","svn_url":"https://github.com/hironoriohashi/JavaQuest","homepage":null,"size":117,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"hironoriohashi:master","ref":"master","sha":"372958800ed63d60d9bfa4a361c05a4e315f8c5e","user":{"login":"hironoriohashi","id":27398594,"avatar_url":"https://avatars1.githubusercontent.com/u/27398594?v=3","gravatar_id":"","url":"https://api.github.com/users/hironoriohashi","html_url":"https://github.com/hironoriohashi","followers_url":"https://api.github.com/users/hironoriohashi/followers","following_url":"https://api.github.com/users/hironoriohashi/following{/other_user}","gists_url":"https://api.github.com/users/hironoriohashi/gists{/gist_id}","starred_url":"https://api.github.com/users/hironoriohashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hironoriohashi/subscriptions","organizations_url":"https://api.github.com/users/hironoriohashi/orgs","repos_url":"https://api.github.com/users/hironoriohashi/repos","events_url":"https://api.github.com/users/hironoriohashi/events{/privacy}","received_events_url":"https://api.github.com/users/hironoriohashi/received_events","type":"User","site_admin":false},"repo":{"id":88687381,"name":"JavaQuest","full_name":"hironoriohashi/JavaQuest","owner":{"login":"hironoriohashi","id":27398594,"avatar_url":"https://avatars1.githubusercontent.com/u/27398594?v=3","gravatar_id":"","url":"https://api.github.com/users/hironoriohashi","html_url":"https://github.com/hironoriohashi","followers_url":"https://api.github.com/users/hironoriohashi/followers","following_url":"https://api.github.com/users/hironoriohashi/following{/other_user}","gists_url":"https://api.github.com/users/hironoriohashi/gists{/gist_id}","starred_url":"https://api.github.com/users/hironoriohashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hironoriohashi/subscriptions","organizations_url":"https://api.github.com/users/hironoriohashi/orgs","repos_url":"https://api.github.com/users/hironoriohashi/repos","events_url":"https://api.github.com/users/hironoriohashi/events{/privacy}","received_events_url":"https://api.github.com/users/hironoriohashi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hironoriohashi/JavaQuest","description":"ProgrammingLesson","fork":false,"url":"https://api.github.com/repos/hironoriohashi/JavaQuest","forks_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/forks","keys_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/teams","hooks_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/hooks","issue_events_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/events{/number}","events_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/events","assignees_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/assignees{/user}","branches_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/branches{/branch}","tags_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/tags","blobs_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/refs{/sha}","trees_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/statuses/{sha}","languages_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/languages","stargazers_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/stargazers","contributors_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/contributors","subscribers_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/subscribers","subscription_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/subscription","commits_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/commits{/sha}","git_commits_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/git/commits{/sha}","comments_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/comments{/number}","issue_comment_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/comments{/number}","contents_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/contents/{+path}","compare_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/merges","archive_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/downloads","issues_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues{/number}","pulls_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls{/number}","milestones_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/milestones{/number}","notifications_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/labels{/name}","releases_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/releases{/id}","deployments_url":"https://api.github.com/repos/hironoriohashi/JavaQuest/deployments","created_at":"2017-04-19T01:39:41Z","updated_at":"2017-04-21T01:49:40Z","pushed_at":"2017-05-31T05:36:09Z","git_url":"git://github.com/hironoriohashi/JavaQuest.git","ssh_url":"git@github.com:hironoriohashi/JavaQuest.git","clone_url":"https://github.com/hironoriohashi/JavaQuest.git","svn_url":"https://github.com/hironoriohashi/JavaQuest","homepage":null,"size":117,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30"},"html":{"href":"https://github.com/hironoriohashi/JavaQuest/pull/30"},"issue":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/30"},"comments":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/hironoriohashi/JavaQuest/statuses/b3f8446794aa233a5c8af112bcd7d5732421ce43"}}}}
{"actor":{"display_login":"sakai-y"}}