{"action":"created","comment":{"url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/comments/67773626","id":67773626,"diff_hunk":"@@ -0,0 +1,61 @@\n+package io.bittiger.ads.activity;\n+\n+import io.bittiger.ads.model.Ad;\n+import org.junit.Test;\n+\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.List;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertNotNull;\n+\n+public class AdsSelectionTest {\n+\n+    @Test\n+    public void testAdsSelection() {\n+\n+        Ad ad1 = initAd(1, new String[]{\"word1\"});\n+        Ad ad2 = initAd(2, new String[]{\"word2\"});\n+        Ad ad3 = initAd(3, new String[]{\"word1\", \"word2\", \"word3\"});\n+\n+        List<Ad> expectedAdsWithWord1 = new ArrayList<Ad>(Arrays.asList(ad1, ad3));\n+        List<Ad> expectedAdsWithWord2 = new ArrayList<Ad>(Arrays.asList(ad2, ad3));\n+        List<Ad> expectedAdsWithWord3 = new ArrayList<Ad>(Arrays.asList(ad3));\n+        List<Ad> expectedAdsWithWord12 = new ArrayList<Ad>(Arrays.asList(ad1, ad2, ad3));\n+\n+        AdsDao.getInstance().setAd(ad1);\n+        AdsDao.getInstance().setAd(ad2);\n+        AdsDao.getInstance().setAd(ad3);\n+\n+        List<Ad> res1 = AdsSelection.getInstance().getMatchedAds(new String[]{\"word1\"});\n+        List<Ad> res2 = AdsSelection.getInstance().getMatchedAds(new String[]{\"word2\"});\n+        List<Ad> res3 = AdsSelection.getInstance().getMatchedAds(new String[]{\"word3\"});\n+        List<Ad> res4 = AdsSelection.getInstance().getMatchedAds(new String[]{\"word1\", \"word2\"});\n+\n+        assertNotNull(res1);\n+        assertEquals(2, res1.size());\n+\n+        assertNotNull(res2);\n+        assertEquals(2, res2.size());\n+        //assertEquals(expectedAdsWithWord2.get(0), res2.get(0));\n+        //assertEquals(expectedAdsWithWord2.get(1), res2.get(1));\n+\n+        assertNotNull(res3);\n+        assertEquals(1, res3.size());\n+        //assertEquals(expectedAdsWithWord1.get(0), res1.get(0));\n+        \n+        assertNotNull(res4);\n+        assertEquals(3, res4.size());\n+        //assertEquals(expectedAdsWithWord1.get(0), res1.get(0));\n+        //assertEquals(expectedAdsWithWord1.get(1), res1.get(1));\n+        //assertEquals(expectedAdsWithWord1.get(2), res1.get(2));*/","path":"src/test/java/io/bittiger/ads/activity/AdsSelectionTest.java","position":52,"original_position":52,"commit_id":"1063091bd731dac21573950f7b423bd271ee5a14","original_commit_id":"1063091bd731dac21573950f7b423bd271ee5a14","user":{"login":"sleephu","id":5606556,"avatar_url":"https://avatars.githubusercontent.com/u/5606556?v=3","gravatar_id":"","url":"https://api.github.com/users/sleephu","html_url":"https://github.com/sleephu","followers_url":"https://api.github.com/users/sleephu/followers","following_url":"https://api.github.com/users/sleephu/following{/other_user}","gists_url":"https://api.github.com/users/sleephu/gists{/gist_id}","starred_url":"https://api.github.com/users/sleephu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleephu/subscriptions","organizations_url":"https://api.github.com/users/sleephu/orgs","repos_url":"https://api.github.com/users/sleephu/repos","events_url":"https://api.github.com/users/sleephu/events{/privacy}","received_events_url":"https://api.github.com/users/sleephu/received_events","type":"User","site_admin":false},"body":"Will it be better to add some test cases to test selected ads's relevant score?","created_at":"2016-06-20T21:51:58Z","updated_at":"2016-06-20T21:51:58Z","html_url":"https://github.com/lijljacklee/ads-searching-system/pull/7#discussion_r67773626","pull_request_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/comments/67773626"},"html":{"href":"https://github.com/lijljacklee/ads-searching-system/pull/7#discussion_r67773626"},"pull_request":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7","id":73880247,"html_url":"https://github.com/lijljacklee/ads-searching-system/pull/7","diff_url":"https://github.com/lijljacklee/ads-searching-system/pull/7.diff","patch_url":"https://github.com/lijljacklee/ads-searching-system/pull/7.patch","issue_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues/7","number":7,"state":"open","locked":false,"title":"Select ads","user":{"login":"dojiangv","id":7834001,"avatar_url":"https://avatars.githubusercontent.com/u/7834001?v=3","gravatar_id":"","url":"https://api.github.com/users/dojiangv","html_url":"https://github.com/dojiangv","followers_url":"https://api.github.com/users/dojiangv/followers","following_url":"https://api.github.com/users/dojiangv/following{/other_user}","gists_url":"https://api.github.com/users/dojiangv/gists{/gist_id}","starred_url":"https://api.github.com/users/dojiangv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dojiangv/subscriptions","organizations_url":"https://api.github.com/users/dojiangv/orgs","repos_url":"https://api.github.com/users/dojiangv/repos","events_url":"https://api.github.com/users/dojiangv/events{/privacy}","received_events_url":"https://api.github.com/users/dojiangv/received_events","type":"User","site_admin":false},"body":"This PR create AdsSelect\r\n\r\n1) input String[] keywords;\r\n2) output List<Ad>\r\n3) The data structure of ads in memcached with same keyword need to be discussed in the next meeting.\r\n\r\n@lijljacklee @sleephu ","created_at":"2016-06-15T09:38:49Z","updated_at":"2016-06-20T21:51:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f21d22b53a99537135008bf908379ebb3220b8e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7/commits","review_comments_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7/comments","review_comment_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues/7/comments","statuses_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/statuses/1063091bd731dac21573950f7b423bd271ee5a14","head":{"label":"dojiangv:select-ads","ref":"select-ads","sha":"1063091bd731dac21573950f7b423bd271ee5a14","user":{"login":"dojiangv","id":7834001,"avatar_url":"https://avatars.githubusercontent.com/u/7834001?v=3","gravatar_id":"","url":"https://api.github.com/users/dojiangv","html_url":"https://github.com/dojiangv","followers_url":"https://api.github.com/users/dojiangv/followers","following_url":"https://api.github.com/users/dojiangv/following{/other_user}","gists_url":"https://api.github.com/users/dojiangv/gists{/gist_id}","starred_url":"https://api.github.com/users/dojiangv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dojiangv/subscriptions","organizations_url":"https://api.github.com/users/dojiangv/orgs","repos_url":"https://api.github.com/users/dojiangv/repos","events_url":"https://api.github.com/users/dojiangv/events{/privacy}","received_events_url":"https://api.github.com/users/dojiangv/received_events","type":"User","site_admin":false},"repo":{"id":61192706,"name":"ads-searching-system","full_name":"dojiangv/ads-searching-system","owner":{"login":"dojiangv","id":7834001,"avatar_url":"https://avatars.githubusercontent.com/u/7834001?v=3","gravatar_id":"","url":"https://api.github.com/users/dojiangv","html_url":"https://github.com/dojiangv","followers_url":"https://api.github.com/users/dojiangv/followers","following_url":"https://api.github.com/users/dojiangv/following{/other_user}","gists_url":"https://api.github.com/users/dojiangv/gists{/gist_id}","starred_url":"https://api.github.com/users/dojiangv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dojiangv/subscriptions","organizations_url":"https://api.github.com/users/dojiangv/orgs","repos_url":"https://api.github.com/users/dojiangv/repos","events_url":"https://api.github.com/users/dojiangv/events{/privacy}","received_events_url":"https://api.github.com/users/dojiangv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dojiangv/ads-searching-system","description":"This is the project of 2nd team","fork":true,"url":"https://api.github.com/repos/dojiangv/ads-searching-system","forks_url":"https://api.github.com/repos/dojiangv/ads-searching-system/forks","keys_url":"https://api.github.com/repos/dojiangv/ads-searching-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dojiangv/ads-searching-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dojiangv/ads-searching-system/teams","hooks_url":"https://api.github.com/repos/dojiangv/ads-searching-system/hooks","issue_events_url":"https://api.github.com/repos/dojiangv/ads-searching-system/issues/events{/number}","events_url":"https://api.github.com/repos/dojiangv/ads-searching-system/events","assignees_url":"https://api.github.com/repos/dojiangv/ads-searching-system/assignees{/user}","branches_url":"https://api.github.com/repos/dojiangv/ads-searching-system/branches{/branch}","tags_url":"https://api.github.com/repos/dojiangv/ads-searching-system/tags","blobs_url":"https://api.github.com/repos/dojiangv/ads-searching-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dojiangv/ads-searching-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dojiangv/ads-searching-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/dojiangv/ads-searching-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dojiangv/ads-searching-system/statuses/{sha}","languages_url":"https://api.github.com/repos/dojiangv/ads-searching-system/languages","stargazers_url":"https://api.github.com/repos/dojiangv/ads-searching-system/stargazers","contributors_url":"https://api.github.com/repos/dojiangv/ads-searching-system/contributors","subscribers_url":"https://api.github.com/repos/dojiangv/ads-searching-system/subscribers","subscription_url":"https://api.github.com/repos/dojiangv/ads-searching-system/subscription","commits_url":"https://api.github.com/repos/dojiangv/ads-searching-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/dojiangv/ads-searching-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/dojiangv/ads-searching-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/dojiangv/ads-searching-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/dojiangv/ads-searching-system/contents/{+path}","compare_url":"https://api.github.com/repos/dojiangv/ads-searching-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dojiangv/ads-searching-system/merges","archive_url":"https://api.github.com/repos/dojiangv/ads-searching-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dojiangv/ads-searching-system/downloads","issues_url":"https://api.github.com/repos/dojiangv/ads-searching-system/issues{/number}","pulls_url":"https://api.github.com/repos/dojiangv/ads-searching-system/pulls{/number}","milestones_url":"https://api.github.com/repos/dojiangv/ads-searching-system/milestones{/number}","notifications_url":"https://api.github.com/repos/dojiangv/ads-searching-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dojiangv/ads-searching-system/labels{/name}","releases_url":"https://api.github.com/repos/dojiangv/ads-searching-system/releases{/id}","deployments_url":"https://api.github.com/repos/dojiangv/ads-searching-system/deployments","created_at":"2016-06-15T08:50:40Z","updated_at":"2016-06-15T08:50:41Z","pushed_at":"2016-06-20T00:48:42Z","git_url":"git://github.com/dojiangv/ads-searching-system.git","ssh_url":"git@github.com:dojiangv/ads-searching-system.git","clone_url":"https://github.com/dojiangv/ads-searching-system.git","svn_url":"https://github.com/dojiangv/ads-searching-system","homepage":null,"size":21,"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":"lijljacklee:master","ref":"master","sha":"8cee8ff3f3d91e9833cd0a9ebc704abdf180ee1f","user":{"login":"lijljacklee","id":6657775,"avatar_url":"https://avatars.githubusercontent.com/u/6657775?v=3","gravatar_id":"","url":"https://api.github.com/users/lijljacklee","html_url":"https://github.com/lijljacklee","followers_url":"https://api.github.com/users/lijljacklee/followers","following_url":"https://api.github.com/users/lijljacklee/following{/other_user}","gists_url":"https://api.github.com/users/lijljacklee/gists{/gist_id}","starred_url":"https://api.github.com/users/lijljacklee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lijljacklee/subscriptions","organizations_url":"https://api.github.com/users/lijljacklee/orgs","repos_url":"https://api.github.com/users/lijljacklee/repos","events_url":"https://api.github.com/users/lijljacklee/events{/privacy}","received_events_url":"https://api.github.com/users/lijljacklee/received_events","type":"User","site_admin":false},"repo":{"id":60636766,"name":"ads-searching-system","full_name":"lijljacklee/ads-searching-system","owner":{"login":"lijljacklee","id":6657775,"avatar_url":"https://avatars.githubusercontent.com/u/6657775?v=3","gravatar_id":"","url":"https://api.github.com/users/lijljacklee","html_url":"https://github.com/lijljacklee","followers_url":"https://api.github.com/users/lijljacklee/followers","following_url":"https://api.github.com/users/lijljacklee/following{/other_user}","gists_url":"https://api.github.com/users/lijljacklee/gists{/gist_id}","starred_url":"https://api.github.com/users/lijljacklee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lijljacklee/subscriptions","organizations_url":"https://api.github.com/users/lijljacklee/orgs","repos_url":"https://api.github.com/users/lijljacklee/repos","events_url":"https://api.github.com/users/lijljacklee/events{/privacy}","received_events_url":"https://api.github.com/users/lijljacklee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lijljacklee/ads-searching-system","description":"This is the project of 2nd team","fork":true,"url":"https://api.github.com/repos/lijljacklee/ads-searching-system","forks_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/forks","keys_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/teams","hooks_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/hooks","issue_events_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues/events{/number}","events_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/events","assignees_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/assignees{/user}","branches_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/branches{/branch}","tags_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/tags","blobs_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/statuses/{sha}","languages_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/languages","stargazers_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/stargazers","contributors_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/contributors","subscribers_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/subscribers","subscription_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/subscription","commits_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/contents/{+path}","compare_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/merges","archive_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/downloads","issues_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues{/number}","pulls_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls{/number}","milestones_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/milestones{/number}","notifications_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/labels{/name}","releases_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/releases{/id}","deployments_url":"https://api.github.com/repos/lijljacklee/ads-searching-system/deployments","created_at":"2016-06-07T18:31:14Z","updated_at":"2016-06-13T23:12:20Z","pushed_at":"2016-06-20T03:35:53Z","git_url":"git://github.com/lijljacklee/ads-searching-system.git","ssh_url":"git@github.com:lijljacklee/ads-searching-system.git","clone_url":"https://github.com/lijljacklee/ads-searching-system.git","svn_url":"https://github.com/lijljacklee/ads-searching-system","homepage":null,"size":54,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7"},"html":{"href":"https://github.com/lijljacklee/ads-searching-system/pull/7"},"issue":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues/7"},"comments":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/lijljacklee/ads-searching-system/statuses/1063091bd731dac21573950f7b423bd271ee5a14"}}}}
{"actor":{"display_login":"sleephu"}}