{"action":"created","comment":{"url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/comments/90357171","pull_request_review_id":10876254,"id":90357171,"diff_hunk":"@@ -0,0 +1,97 @@\n+package rbr;\n+\n+import java.util.*;\n+import org.junit.*;\n+import util.*;\n+\n+public class MakeRegionsTest {\n+\n+    private Set<Character> inputPorts = new HashSet<>();\n+    private Set<Character> outputPorts = new HashSet<>();\n+    private Set<Vertex> destinations = new HashSet<>();\n+    private RBR rbr;\n+\n+    @Before\n+    public void setUp() {\n+        Graph graph = RegularGraphBuilder.generateGraph(4,4);\n+        rbr = new RBR(graph);\n+        inputPorts.add('I');\n+        inputPorts.add('N');\n+        inputPorts.add('E');\n+        outputPorts.add('N');\n+        outputPorts.add('S');\n+        outputPorts.add('W');\n+        destinations.add(new Vertex(\"0.1\"));\n+        destinations.add(new Vertex(\"0.2\"));\n+        destinations.add(new Vertex(\"0.3\"));\n+        destinations.add(new Vertex(\"1.0\"));\n+        destinations.add(new Vertex(\"1.2\"));\n+        destinations.add(new Vertex(\"1.3\"));\n+        destinations.add(new Vertex(\"2.0\"));\n+        destinations.add(new Vertex(\"2.3\"));\n+        destinations.add(new Vertex(\"3.0\"));\n+        destinations.add(new Vertex(\"3.1\"));\n+        destinations.add(new Vertex(\"3.2\"));\n+        destinations.add(new Vertex(\"3.3\"));\n+    }\n+\n+    @Test\n+    public void emptyDestinationsCreatesNoRegion() throws Exception {\n+        List<Region> createdRegionsWithoutDestinations = rbr.makeRegions(new HashSet<>(), inputPorts, outputPorts);\n+        Assert.assertTrue(createdRegionsWithoutDestinations.isEmpty());\n+    }\n+\n+    @Test\n+    public void createdRegionsHaveSameInputPortsOriginals() throws Exception {\n+        for(Region createdRegion : rbr.makeRegions(destinations, inputPorts, outputPorts)) {\n+            Assert.assertEquals(createdRegion.inputPorts(), inputPorts);\n+        }\n+    }\n+\n+    @Test\n+    public void createdRegionsHaveSameOutputPortsOriginals() throws Exception {\n+        for(Region createdRegion : rbr.makeRegions(destinations, inputPorts, outputPorts)) {\n+            Assert.assertEquals(createdRegion.outputPorts(), outputPorts);\n+        }\n+    }\n+\n+    @Test\n+    public void createdRegionHasNoOutsider() throws Exception {\n+        for(Region createdRegion : rbr.makeRegions(destinations, inputPorts, outputPorts)){\n+            Assert.assertTrue(createdRegion.outsiders().isEmpty());\n+        }\n+    }\n+\n+    @Test\n+    public void createdRegionsHaveSameDestinationsOriginals() throws Exception {\n+        Set<Vertex> destinationsCreatedRegions = new HashSet<>();\n+        Set<Vertex> originalsDst = new HashSet<>(destinations);\n+        List<Region> createdRegions = rbr.makeRegions(destinations, inputPorts, outputPorts);\n+        for(Region createdRegion : createdRegions) {\n+            destinationsCreatedRegions.addAll(createdRegion.destinations());\n+        }\n+        Assert.assertEquals(destinationsCreatedRegions, originalsDst);\n+        Assert.assertEquals(createdRegions.size(), 5);\n+    }\n+\n+    @Test\n+    public void createdRegionsAreDisjoint() throws Exception {","path":"tests/rbr/MakeRegionsTest.java","position":78,"original_position":78,"commit_id":"9434e2c34f6f410457a3a77b6009dee1e9943a43","original_commit_id":"9434e2c34f6f410457a3a77b6009dee1e9943a43","user":{"login":"jmarcelof","id":9330402,"avatar_url":"https://avatars.githubusercontent.com/u/9330402?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarcelof","html_url":"https://github.com/jmarcelof","followers_url":"https://api.github.com/users/jmarcelof/followers","following_url":"https://api.github.com/users/jmarcelof/following{/other_user}","gists_url":"https://api.github.com/users/jmarcelof/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarcelof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarcelof/subscriptions","organizations_url":"https://api.github.com/users/jmarcelof/orgs","repos_url":"https://api.github.com/users/jmarcelof/repos","events_url":"https://api.github.com/users/jmarcelof/events{/privacy}","received_events_url":"https://api.github.com/users/jmarcelof/received_events","type":"User","site_admin":false},"body":"They do not need to be disjoint. Then, you can drop it.","created_at":"2016-11-30T23:59:33Z","updated_at":"2016-12-01T00:01:09Z","html_url":"https://github.com/LaNoC-UFC/rsbr/pull/96#discussion_r90357171","pull_request_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96","_links":{"self":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/comments/90357171"},"html":{"href":"https://github.com/LaNoC-UFC/rsbr/pull/96#discussion_r90357171"},"pull_request":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96","id":94941419,"html_url":"https://github.com/LaNoC-UFC/rsbr/pull/96","diff_url":"https://github.com/LaNoC-UFC/rsbr/pull/96.diff","patch_url":"https://github.com/LaNoC-UFC/rsbr/pull/96.patch","issue_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues/96","number":96,"state":"open","locked":false,"title":"Unit test make regions","user":{"login":"matheus220","id":19396079,"avatar_url":"https://avatars.githubusercontent.com/u/19396079?v=3","gravatar_id":"","url":"https://api.github.com/users/matheus220","html_url":"https://github.com/matheus220","followers_url":"https://api.github.com/users/matheus220/followers","following_url":"https://api.github.com/users/matheus220/following{/other_user}","gists_url":"https://api.github.com/users/matheus220/gists{/gist_id}","starred_url":"https://api.github.com/users/matheus220/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheus220/subscriptions","organizations_url":"https://api.github.com/users/matheus220/orgs","repos_url":"https://api.github.com/users/matheus220/repos","events_url":"https://api.github.com/users/matheus220/events{/privacy}","received_events_url":"https://api.github.com/users/matheus220/received_events","type":"User","site_admin":false},"body":"Turn RBR.makeRegions() package private and add unit tests to it.\r\n\r\nCommit:Add\r\n\r\nTaskNumber:#72","created_at":"2016-11-23T03:46:39Z","updated_at":"2016-12-01T00:01:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"584e9c6fa1e2d044ef14a3a5a2c167a89c36376b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96/commits","review_comments_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96/comments","review_comment_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues/96/comments","statuses_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/statuses/9434e2c34f6f410457a3a77b6009dee1e9943a43","head":{"label":"matheus220:unitTestMakeRegions","ref":"unitTestMakeRegions","sha":"9434e2c34f6f410457a3a77b6009dee1e9943a43","user":{"login":"matheus220","id":19396079,"avatar_url":"https://avatars.githubusercontent.com/u/19396079?v=3","gravatar_id":"","url":"https://api.github.com/users/matheus220","html_url":"https://github.com/matheus220","followers_url":"https://api.github.com/users/matheus220/followers","following_url":"https://api.github.com/users/matheus220/following{/other_user}","gists_url":"https://api.github.com/users/matheus220/gists{/gist_id}","starred_url":"https://api.github.com/users/matheus220/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheus220/subscriptions","organizations_url":"https://api.github.com/users/matheus220/orgs","repos_url":"https://api.github.com/users/matheus220/repos","events_url":"https://api.github.com/users/matheus220/events{/privacy}","received_events_url":"https://api.github.com/users/matheus220/received_events","type":"User","site_admin":false},"repo":{"id":68852300,"name":"rsbr","full_name":"matheus220/rsbr","owner":{"login":"matheus220","id":19396079,"avatar_url":"https://avatars.githubusercontent.com/u/19396079?v=3","gravatar_id":"","url":"https://api.github.com/users/matheus220","html_url":"https://github.com/matheus220","followers_url":"https://api.github.com/users/matheus220/followers","following_url":"https://api.github.com/users/matheus220/following{/other_user}","gists_url":"https://api.github.com/users/matheus220/gists{/gist_id}","starred_url":"https://api.github.com/users/matheus220/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheus220/subscriptions","organizations_url":"https://api.github.com/users/matheus220/orgs","repos_url":"https://api.github.com/users/matheus220/repos","events_url":"https://api.github.com/users/matheus220/events{/privacy}","received_events_url":"https://api.github.com/users/matheus220/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matheus220/rsbr","description":"Segmentation plus Region-based routing algorithms","fork":true,"url":"https://api.github.com/repos/matheus220/rsbr","forks_url":"https://api.github.com/repos/matheus220/rsbr/forks","keys_url":"https://api.github.com/repos/matheus220/rsbr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matheus220/rsbr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matheus220/rsbr/teams","hooks_url":"https://api.github.com/repos/matheus220/rsbr/hooks","issue_events_url":"https://api.github.com/repos/matheus220/rsbr/issues/events{/number}","events_url":"https://api.github.com/repos/matheus220/rsbr/events","assignees_url":"https://api.github.com/repos/matheus220/rsbr/assignees{/user}","branches_url":"https://api.github.com/repos/matheus220/rsbr/branches{/branch}","tags_url":"https://api.github.com/repos/matheus220/rsbr/tags","blobs_url":"https://api.github.com/repos/matheus220/rsbr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matheus220/rsbr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matheus220/rsbr/git/refs{/sha}","trees_url":"https://api.github.com/repos/matheus220/rsbr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matheus220/rsbr/statuses/{sha}","languages_url":"https://api.github.com/repos/matheus220/rsbr/languages","stargazers_url":"https://api.github.com/repos/matheus220/rsbr/stargazers","contributors_url":"https://api.github.com/repos/matheus220/rsbr/contributors","subscribers_url":"https://api.github.com/repos/matheus220/rsbr/subscribers","subscription_url":"https://api.github.com/repos/matheus220/rsbr/subscription","commits_url":"https://api.github.com/repos/matheus220/rsbr/commits{/sha}","git_commits_url":"https://api.github.com/repos/matheus220/rsbr/git/commits{/sha}","comments_url":"https://api.github.com/repos/matheus220/rsbr/comments{/number}","issue_comment_url":"https://api.github.com/repos/matheus220/rsbr/issues/comments{/number}","contents_url":"https://api.github.com/repos/matheus220/rsbr/contents/{+path}","compare_url":"https://api.github.com/repos/matheus220/rsbr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matheus220/rsbr/merges","archive_url":"https://api.github.com/repos/matheus220/rsbr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matheus220/rsbr/downloads","issues_url":"https://api.github.com/repos/matheus220/rsbr/issues{/number}","pulls_url":"https://api.github.com/repos/matheus220/rsbr/pulls{/number}","milestones_url":"https://api.github.com/repos/matheus220/rsbr/milestones{/number}","notifications_url":"https://api.github.com/repos/matheus220/rsbr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matheus220/rsbr/labels{/name}","releases_url":"https://api.github.com/repos/matheus220/rsbr/releases{/id}","deployments_url":"https://api.github.com/repos/matheus220/rsbr/deployments","created_at":"2016-09-21T19:50:43Z","updated_at":"2016-09-21T19:50:45Z","pushed_at":"2016-11-29T16:57:35Z","git_url":"git://github.com/matheus220/rsbr.git","ssh_url":"git@github.com:matheus220/rsbr.git","clone_url":"https://github.com/matheus220/rsbr.git","svn_url":"https://github.com/matheus220/rsbr","homepage":null,"size":318,"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":"develop"}},"base":{"label":"LaNoC-UFC:develop","ref":"develop","sha":"d66c3345337f98d98cedd4a630e2256c4f51974d","user":{"login":"LaNoC-UFC","id":22204233,"avatar_url":"https://avatars.githubusercontent.com/u/22204233?v=3","gravatar_id":"","url":"https://api.github.com/users/LaNoC-UFC","html_url":"https://github.com/LaNoC-UFC","followers_url":"https://api.github.com/users/LaNoC-UFC/followers","following_url":"https://api.github.com/users/LaNoC-UFC/following{/other_user}","gists_url":"https://api.github.com/users/LaNoC-UFC/gists{/gist_id}","starred_url":"https://api.github.com/users/LaNoC-UFC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaNoC-UFC/subscriptions","organizations_url":"https://api.github.com/users/LaNoC-UFC/orgs","repos_url":"https://api.github.com/users/LaNoC-UFC/repos","events_url":"https://api.github.com/users/LaNoC-UFC/events{/privacy}","received_events_url":"https://api.github.com/users/LaNoC-UFC/received_events","type":"Organization","site_admin":false},"repo":{"id":27871786,"name":"rsbr","full_name":"LaNoC-UFC/rsbr","owner":{"login":"LaNoC-UFC","id":22204233,"avatar_url":"https://avatars.githubusercontent.com/u/22204233?v=3","gravatar_id":"","url":"https://api.github.com/users/LaNoC-UFC","html_url":"https://github.com/LaNoC-UFC","followers_url":"https://api.github.com/users/LaNoC-UFC/followers","following_url":"https://api.github.com/users/LaNoC-UFC/following{/other_user}","gists_url":"https://api.github.com/users/LaNoC-UFC/gists{/gist_id}","starred_url":"https://api.github.com/users/LaNoC-UFC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaNoC-UFC/subscriptions","organizations_url":"https://api.github.com/users/LaNoC-UFC/orgs","repos_url":"https://api.github.com/users/LaNoC-UFC/repos","events_url":"https://api.github.com/users/LaNoC-UFC/events{/privacy}","received_events_url":"https://api.github.com/users/LaNoC-UFC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LaNoC-UFC/rsbr","description":"Segmentation plus Region-based routing algorithms","fork":false,"url":"https://api.github.com/repos/LaNoC-UFC/rsbr","forks_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/forks","keys_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/teams","hooks_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/hooks","issue_events_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues/events{/number}","events_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/events","assignees_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/assignees{/user}","branches_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/branches{/branch}","tags_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/tags","blobs_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/statuses/{sha}","languages_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/languages","stargazers_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/stargazers","contributors_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/contributors","subscribers_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/subscribers","subscription_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/subscription","commits_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues/comments{/number}","contents_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/contents/{+path}","compare_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/merges","archive_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/downloads","issues_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues{/number}","pulls_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls{/number}","milestones_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/milestones{/number}","notifications_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/labels{/name}","releases_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/releases{/id}","deployments_url":"https://api.github.com/repos/LaNoC-UFC/rsbr/deployments","created_at":"2014-12-11T13:04:00Z","updated_at":"2016-10-24T13:50:38Z","pushed_at":"2016-11-30T22:12:32Z","git_url":"git://github.com/LaNoC-UFC/rsbr.git","ssh_url":"git@github.com:LaNoC-UFC/rsbr.git","clone_url":"https://github.com/LaNoC-UFC/rsbr.git","svn_url":"https://github.com/LaNoC-UFC/rsbr","homepage":null,"size":322,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":10,"forks":8,"open_issues":10,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96"},"html":{"href":"https://github.com/LaNoC-UFC/rsbr/pull/96"},"issue":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues/96"},"comments":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/LaNoC-UFC/rsbr/statuses/9434e2c34f6f410457a3a77b6009dee1e9943a43"}}}}
{"actor":{"display_login":"jmarcelof"}}