GitHub PullRequestReviewCommentEvent at 2014-08-12 13:21:26
Repository: hazelcast
Actor: pveentjer
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/16111919","id":16111919,"diff_hunk":"@@ -68,6 +85,16 @@ public void testRelease() {\n         assertEquals(semaphore.availablePermits(), numberOfPermits);\n     }\n \n+    @Test(expected = IllegalArgumentException.class, timeout = 30000)\n+    public void testRelease_whenArgumentNegative() {\n+        final ISemaphore semaphore = hz.getSemaphore(randomString());\n+        int numberOfPermits = 10;\n+        assertTrue(semaphore.init(numberOfPermits));\n+        assertEquals(10, semaphore.drainPermits());\n+        assertEquals(0, semaphore.availablePermits());\n+        semaphore.release(-5);","path":"hazelcast/src/test/java/com/hazelcast/concurrent/semaphore/SemaphoreTest.java","position":35,"original_position":35,"commit_id":"de965a64f171261e087ab46a1b838e33750ae29e","original_commit_id":"de965a64f171261e087ab46a1b838e33750ae29e","user":{"login":"pveentjer","id":105243,"avatar_url":"https://avatars.githubusercontent.com/u/105243?v=2","gravatar_id":"d8b5cf3679fa7a4f32994df31d6fb180","url":"https://api.github.com/users/pveentjer","html_url":"https://github.com/pveentjer","followers_url":"https://api.github.com/users/pveentjer/followers","following_url":"https://api.github.com/users/pveentjer/following{/other_user}","gists_url":"https://api.github.com/users/pveentjer/gists{/gist_id}","starred_url":"https://api.github.com/users/pveentjer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pveentjer/subscriptions","organizations_url":"https://api.github.com/users/pveentjer/orgs","repos_url":"https://api.github.com/users/pveentjer/repos","events_url":"https://api.github.com/users/pveentjer/events{/privacy}","received_events_url":"https://api.github.com/users/pveentjer/received_events","type":"User","site_admin":false},"body":"This is a good example of why the 'expected' is not the holy grails.\r\nac\r\nYou have called with a negative permit, but what are the number of licenses going to be after this call? Is it going to be 0? or -1?\r\n\r\nSo it is best to do this:\r\n\r\n```\r\ntry{\r\n  semaphore.release(-5);\r\n  fail();\r\n}catch(IllegalArgumentException expected){\r\n}\r\n\r\nassertEquals(5, semaphore.availablePermits())\r\n```","created_at":"2014-08-12T13:21:26Z","updated_at":"2014-08-12T13:21:26Z","html_url":"https://github.com/hazelcast/hazelcast/pull/3239#discussion_r16111919","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/16111919"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/3239#discussion_r16111919"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239","id":19649438,"html_url":"https://github.com/hazelcast/hazelcast/pull/3239","diff_url":"https://github.com/hazelcast/hazelcast/pull/3239.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/3239.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/3239","number":3239,"state":"open","title":"unit test for Semaphore","user":{"login":"hasancelik","id":6005622,"avatar_url":"https://avatars.githubusercontent.com/u/6005622?v=2","gravatar_id":"7ab5b5fe1b9a035b42fb7b19993dc229","url":"https://api.github.com/users/hasancelik","html_url":"https://github.com/hasancelik","followers_url":"https://api.github.com/users/hasancelik/followers","following_url":"https://api.github.com/users/hasancelik/following{/other_user}","gists_url":"https://api.github.com/users/hasancelik/gists{/gist_id}","starred_url":"https://api.github.com/users/hasancelik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasancelik/subscriptions","organizations_url":"https://api.github.com/users/hasancelik/orgs","repos_url":"https://api.github.com/users/hasancelik/repos","events_url":"https://api.github.com/users/hasancelik/events{/privacy}","received_events_url":"https://api.github.com/users/hasancelik/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-08-12T08:54:24Z","updated_at":"2014-08-12T13:21:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c32693a39e3b295becba58af306530d91d7038d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/3239/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/de965a64f171261e087ab46a1b838e33750ae29e","head":{"label":"hasancelik:feature/master/unitTestForSemaphore","ref":"feature/master/unitTestForSemaphore","sha":"de965a64f171261e087ab46a1b838e33750ae29e","user":{"login":"hasancelik","id":6005622,"avatar_url":"https://avatars.githubusercontent.com/u/6005622?v=2","gravatar_id":"7ab5b5fe1b9a035b42fb7b19993dc229","url":"https://api.github.com/users/hasancelik","html_url":"https://github.com/hasancelik","followers_url":"https://api.github.com/users/hasancelik/followers","following_url":"https://api.github.com/users/hasancelik/following{/other_user}","gists_url":"https://api.github.com/users/hasancelik/gists{/gist_id}","starred_url":"https://api.github.com/users/hasancelik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasancelik/subscriptions","organizations_url":"https://api.github.com/users/hasancelik/orgs","repos_url":"https://api.github.com/users/hasancelik/repos","events_url":"https://api.github.com/users/hasancelik/events{/privacy}","received_events_url":"https://api.github.com/users/hasancelik/received_events","type":"User","site_admin":false},"repo":{"id":17622712,"name":"hazelcast","full_name":"hasancelik/hazelcast","owner":{"login":"hasancelik","id":6005622,"avatar_url":"https://avatars.githubusercontent.com/u/6005622?v=2","gravatar_id":"7ab5b5fe1b9a035b42fb7b19993dc229","url":"https://api.github.com/users/hasancelik","html_url":"https://github.com/hasancelik","followers_url":"https://api.github.com/users/hasancelik/followers","following_url":"https://api.github.com/users/hasancelik/following{/other_user}","gists_url":"https://api.github.com/users/hasancelik/gists{/gist_id}","starred_url":"https://api.github.com/users/hasancelik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasancelik/subscriptions","organizations_url":"https://api.github.com/users/hasancelik/orgs","repos_url":"https://api.github.com/users/hasancelik/repos","events_url":"https://api.github.com/users/hasancelik/events{/privacy}","received_events_url":"https://api.github.com/users/hasancelik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hasancelik/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/hasancelik/hazelcast","forks_url":"https://api.github.com/repos/hasancelik/hazelcast/forks","keys_url":"https://api.github.com/repos/hasancelik/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hasancelik/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hasancelik/hazelcast/teams","hooks_url":"https://api.github.com/repos/hasancelik/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hasancelik/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hasancelik/hazelcast/events","assignees_url":"https://api.github.com/repos/hasancelik/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hasancelik/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hasancelik/hazelcast/tags","blobs_url":"https://api.github.com/repos/hasancelik/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hasancelik/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hasancelik/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hasancelik/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hasancelik/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hasancelik/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hasancelik/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hasancelik/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hasancelik/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hasancelik/hazelcast/subscription","commits_url":"https://api.github.com/repos/hasancelik/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hasancelik/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hasancelik/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hasancelik/hazelcast/issues/comments/{number}","contents_url":"https://api.github.com/repos/hasancelik/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hasancelik/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hasancelik/hazelcast/merges","archive_url":"https://api.github.com/repos/hasancelik/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hasancelik/hazelcast/downloads","issues_url":"https://api.github.com/repos/hasancelik/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hasancelik/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hasancelik/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hasancelik/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hasancelik/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hasancelik/hazelcast/releases{/id}","created_at":"2014-03-11T08:05:55Z","updated_at":"2014-06-25T09:09:14Z","pushed_at":"2014-08-12T09:32:16Z","git_url":"git://github.com/hasancelik/hazelcast.git","ssh_url":"git@github.com:hasancelik/hazelcast.git","clone_url":"https://github.com/hasancelik/hazelcast.git","svn_url":"https://github.com/hasancelik/hazelcast","homepage":"www.hazelcast.com","size":47409,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hazelcast:master","ref":"master","sha":"7c34780b0de4e837c1aeabb10d8c472c6f672130","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=2","gravatar_id":"9bbb2c780bf7972b79c8a54804eb5837","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"repo":{"id":3786237,"name":"hazelcast","full_name":"hazelcast/hazelcast","owner":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=2","gravatar_id":"9bbb2c780bf7972b79c8a54804eb5837","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hazelcast/hazelcast","description":"Open Source In-Memory Data Grid","fork":false,"url":"https://api.github.com/repos/hazelcast/hazelcast","forks_url":"https://api.github.com/repos/hazelcast/hazelcast/forks","keys_url":"https://api.github.com/repos/hazelcast/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hazelcast/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hazelcast/hazelcast/teams","hooks_url":"https://api.github.com/repos/hazelcast/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hazelcast/hazelcast/events","assignees_url":"https://api.github.com/repos/hazelcast/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hazelcast/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hazelcast/hazelcast/tags","blobs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hazelcast/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hazelcast/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hazelcast/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hazelcast/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hazelcast/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hazelcast/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hazelcast/hazelcast/subscription","commits_url":"https://api.github.com/repos/hazelcast/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hazelcast/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/{number}","contents_url":"https://api.github.com/repos/hazelcast/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hazelcast/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hazelcast/hazelcast/merges","archive_url":"https://api.github.com/repos/hazelcast/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hazelcast/hazelcast/downloads","issues_url":"https://api.github.com/repos/hazelcast/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hazelcast/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hazelcast/hazelcast/releases{/id}","created_at":"2012-03-21T12:25:18Z","updated_at":"2014-08-12T11:24:08Z","pushed_at":"2014-08-12T13:08:47Z","git_url":"git://github.com/hazelcast/hazelcast.git","ssh_url":"git@github.com:hazelcast/hazelcast.git","clone_url":"https://github.com/hazelcast/hazelcast.git","svn_url":"https://github.com/hazelcast/hazelcast","homepage":"www.hazelcast.com","size":104134,"stargazers_count":860,"watchers_count":860,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":358,"mirror_url":null,"open_issues_count":289,"forks":358,"open_issues":289,"watchers":860,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/3239"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/3239"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/3239/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/3239/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/de965a64f171261e087ab46a1b838e33750ae29e"}}}}