{"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/43570828","id":43570828,"diff_hunk":"@@ -0,0 +1,100 @@\n+package com.hazelcast.jclouds;\n+\n+import com.hazelcast.core.HazelcastException;\n+import com.hazelcast.nio.Address;\n+import com.hazelcast.spi.discovery.DiscoveryNode;\n+import com.hazelcast.test.HazelcastParallelClassRunner;\n+import com.hazelcast.test.HazelcastTestSupport;\n+import com.hazelcast.test.annotation.QuickTest;\n+import org.jclouds.compute.domain.NodeMetadata;\n+import org.jclouds.compute.domain.internal.NodeMetadataImpl;\n+import org.junit.BeforeClass;\n+import org.junit.Test;\n+import org.junit.experimental.categories.Category;\n+import org.junit.runner.RunWith;\n+\n+import java.net.UnknownHostException;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.Set;\n+\n+import static org.junit.Assert.assertTrue;\n+import static org.mockito.Mockito.doReturn;\n+import static org.mockito.Mockito.mock;\n+import static org.mockito.Mockito.verify;\n+\n+@RunWith(HazelcastParallelClassRunner.class)\n+@Category(QuickTest.class)\n+public class JCloudsDiscoveryStrategyTest extends HazelcastTestSupport {\n+    private static final Set<NodeMetadata> nodes = new HashSet<NodeMetadata>();\n+    private static final Set<Address> addressesOfRunningInstances = new HashSet<Address>();\n+\n+    private static final int STARTING_PORT = 5701;\n+    private static final int NUMBER_OF_NODES = 10;\n+    private static final int NUMBER_OF_RUNNING_NODES = 7;\n+\n+    @BeforeClass\n+    public static void start()\n+            throws UnknownHostException {\n+        for (int i = 0; i < NUMBER_OF_NODES; i++) {\n+            HashSet<String> privateAdressses = new HashSet<String>();\n+            privateAdressses.add(\"127.0.0.\" + (i+1));\n+            NodeMetadata.Status status = NodeMetadata.Status.PENDING;\n+            if (i < NUMBER_OF_RUNNING_NODES) {\n+                status = NodeMetadata.Status.RUNNING;\n+                addressesOfRunningInstances.add(new Address(privateAdressses.iterator().next(),0));","path":"hazelcast-jclouds/src/test/java/com/hazelcast/jclouds/JCloudsDiscoveryStrategyTest.java","position":45,"original_position":45,"commit_id":"49f0e73799d762aed7ba3139a895259a801a3286","original_commit_id":"f0fff6b3b4f2a39f63e83ed20d20a2540178eeb1","user":{"login":"mustafaiman","id":6582349,"avatar_url":"https://avatars.githubusercontent.com/u/6582349?v=3","gravatar_id":"","url":"https://api.github.com/users/mustafaiman","html_url":"https://github.com/mustafaiman","followers_url":"https://api.github.com/users/mustafaiman/followers","following_url":"https://api.github.com/users/mustafaiman/following{/other_user}","gists_url":"https://api.github.com/users/mustafaiman/gists{/gist_id}","starred_url":"https://api.github.com/users/mustafaiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustafaiman/subscriptions","organizations_url":"https://api.github.com/users/mustafaiman/orgs","repos_url":"https://api.github.com/users/mustafaiman/repos","events_url":"https://api.github.com/users/mustafaiman/events{/privacy}","received_events_url":"https://api.github.com/users/mustafaiman/received_events","type":"User","site_admin":false},"body":"This is how JClouds API works. `NodeMetadata` takes a list of IP addresses for both private and public IPs. It supports multiple IP addresses but this test uses only 1 public and private address.","created_at":"2015-10-31T11:08:36Z","updated_at":"2015-10-31T11:08:36Z","html_url":"https://github.com/hazelcast/hazelcast/pull/6609#discussion_r43570828","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/43570828"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6609#discussion_r43570828"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609","id":49261842,"html_url":"https://github.com/hazelcast/hazelcast/pull/6609","diff_url":"https://github.com/hazelcast/hazelcast/pull/6609.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/6609.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6609","number":6609,"state":"open","locked":false,"title":"jclouds discoverystrategy tests","user":{"login":"mustafaiman","id":6582349,"avatar_url":"https://avatars.githubusercontent.com/u/6582349?v=3","gravatar_id":"","url":"https://api.github.com/users/mustafaiman","html_url":"https://github.com/mustafaiman","followers_url":"https://api.github.com/users/mustafaiman/followers","following_url":"https://api.github.com/users/mustafaiman/following{/other_user}","gists_url":"https://api.github.com/users/mustafaiman/gists{/gist_id}","starred_url":"https://api.github.com/users/mustafaiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustafaiman/subscriptions","organizations_url":"https://api.github.com/users/mustafaiman/orgs","repos_url":"https://api.github.com/users/mustafaiman/repos","events_url":"https://api.github.com/users/mustafaiman/events{/privacy}","received_events_url":"https://api.github.com/users/mustafaiman/received_events","type":"User","site_admin":false},"body":"adds tests for jclouds dicovery strategy builder finding running nodes","created_at":"2015-10-30T12:10:00Z","updated_at":"2015-10-31T11:08:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e501bfbff01768f6c6df0feb36e0687cfd0fd5b","assignee":null,"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.6","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61/labels","id":982584,"number":61,"title":"3.6","description":"","creator":{"login":"enesakar","id":234086,"avatar_url":"https://avatars.githubusercontent.com/u/234086?v=3","gravatar_id":"","url":"https://api.github.com/users/enesakar","html_url":"https://github.com/enesakar","followers_url":"https://api.github.com/users/enesakar/followers","following_url":"https://api.github.com/users/enesakar/following{/other_user}","gists_url":"https://api.github.com/users/enesakar/gists{/gist_id}","starred_url":"https://api.github.com/users/enesakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enesakar/subscriptions","organizations_url":"https://api.github.com/users/enesakar/orgs","repos_url":"https://api.github.com/users/enesakar/repos","events_url":"https://api.github.com/users/enesakar/events{/privacy}","received_events_url":"https://api.github.com/users/enesakar/received_events","type":"User","site_admin":false},"open_issues":137,"closed_issues":707,"state":"open","created_at":"2015-02-17T09:27:09Z","updated_at":"2015-10-31T09:08:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6609/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/49f0e73799d762aed7ba3139a895259a801a3286","head":{"label":"mustafaiman:jclouds-test","ref":"jclouds-test","sha":"49f0e73799d762aed7ba3139a895259a801a3286","user":{"login":"mustafaiman","id":6582349,"avatar_url":"https://avatars.githubusercontent.com/u/6582349?v=3","gravatar_id":"","url":"https://api.github.com/users/mustafaiman","html_url":"https://github.com/mustafaiman","followers_url":"https://api.github.com/users/mustafaiman/followers","following_url":"https://api.github.com/users/mustafaiman/following{/other_user}","gists_url":"https://api.github.com/users/mustafaiman/gists{/gist_id}","starred_url":"https://api.github.com/users/mustafaiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustafaiman/subscriptions","organizations_url":"https://api.github.com/users/mustafaiman/orgs","repos_url":"https://api.github.com/users/mustafaiman/repos","events_url":"https://api.github.com/users/mustafaiman/events{/privacy}","received_events_url":"https://api.github.com/users/mustafaiman/received_events","type":"User","site_admin":false},"repo":{"id":37841658,"name":"hazelcast","full_name":"mustafaiman/hazelcast","owner":{"login":"mustafaiman","id":6582349,"avatar_url":"https://avatars.githubusercontent.com/u/6582349?v=3","gravatar_id":"","url":"https://api.github.com/users/mustafaiman","html_url":"https://github.com/mustafaiman","followers_url":"https://api.github.com/users/mustafaiman/followers","following_url":"https://api.github.com/users/mustafaiman/following{/other_user}","gists_url":"https://api.github.com/users/mustafaiman/gists{/gist_id}","starred_url":"https://api.github.com/users/mustafaiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustafaiman/subscriptions","organizations_url":"https://api.github.com/users/mustafaiman/orgs","repos_url":"https://api.github.com/users/mustafaiman/repos","events_url":"https://api.github.com/users/mustafaiman/events{/privacy}","received_events_url":"https://api.github.com/users/mustafaiman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mustafaiman/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/mustafaiman/hazelcast","forks_url":"https://api.github.com/repos/mustafaiman/hazelcast/forks","keys_url":"https://api.github.com/repos/mustafaiman/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mustafaiman/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mustafaiman/hazelcast/teams","hooks_url":"https://api.github.com/repos/mustafaiman/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/mustafaiman/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/mustafaiman/hazelcast/events","assignees_url":"https://api.github.com/repos/mustafaiman/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/mustafaiman/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/mustafaiman/hazelcast/tags","blobs_url":"https://api.github.com/repos/mustafaiman/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mustafaiman/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mustafaiman/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/mustafaiman/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mustafaiman/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/mustafaiman/hazelcast/languages","stargazers_url":"https://api.github.com/repos/mustafaiman/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/mustafaiman/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/mustafaiman/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/mustafaiman/hazelcast/subscription","commits_url":"https://api.github.com/repos/mustafaiman/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/mustafaiman/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/mustafaiman/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/mustafaiman/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/mustafaiman/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/mustafaiman/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mustafaiman/hazelcast/merges","archive_url":"https://api.github.com/repos/mustafaiman/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mustafaiman/hazelcast/downloads","issues_url":"https://api.github.com/repos/mustafaiman/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/mustafaiman/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/mustafaiman/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/mustafaiman/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mustafaiman/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/mustafaiman/hazelcast/releases{/id}","created_at":"2015-06-22T07:02:33Z","updated_at":"2015-06-22T07:02:44Z","pushed_at":"2015-10-30T13:09:16Z","git_url":"git://github.com/mustafaiman/hazelcast.git","ssh_url":"git@github.com:mustafaiman/hazelcast.git","clone_url":"https://github.com/mustafaiman/hazelcast.git","svn_url":"https://github.com/mustafaiman/hazelcast","homepage":"www.hazelcast.com","size":79055,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"hazelcast:master","ref":"master","sha":"5b5e44eb83eb1e69a06a036756823db1c9d0ce1a","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","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=3","gravatar_id":"","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":"2015-10-30T17:53:22Z","pushed_at":"2015-10-30T17:47:33Z","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":160263,"stargazers_count":1290,"watchers_count":1290,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":624,"mirror_url":null,"open_issues_count":529,"forks":624,"open_issues":529,"watchers":1290,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6609"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6609"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6609/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6609/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/49f0e73799d762aed7ba3139a895259a801a3286"}}}}