{"action":"created","comment":{"url":"https://api.github.com/repos/carloscurotto/storm-example/pulls/comments/27778421","id":27778421,"diff_hunk":"@@ -0,0 +1,106 @@\n+package ar.com.carloscurotto.storm.complex.topology;\n+\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import org.apache.activemq.broker.BrokerService;\n+import org.junit.After;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.test.context.ContextConfiguration;\n+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\n+\n+import ar.com.carloscurotto.storm.complex.model.Result;\n+import ar.com.carloscurotto.storm.complex.model.Update;\n+import ar.com.carloscurotto.storm.complex.model.UpdateRow;\n+import ar.com.carloscurotto.storm.complex.service.UpdateService;\n+import backtype.storm.Config;\n+import backtype.storm.ILocalCluster;\n+import backtype.storm.Testing;\n+import backtype.storm.generated.AlreadyAliveException;\n+import backtype.storm.generated.InvalidTopologyException;\n+import backtype.storm.testing.MkClusterParam;\n+import backtype.storm.testing.TestJob;\n+import backtype.storm.utils.Utils;\n+\n+@RunWith(SpringJUnit4ClassRunner.class)\n+@ContextConfiguration({ \"/app-config.xml\" })\n+public class LocalStormTopologyIT {\n+\n+    private static final String BROKER_URL = \"tcp://localhost:61616\";\n+\n+    private BrokerService brokerService;\n+\n+    @Autowired\n+    private UpdateService updateService;\n+\n+    @Autowired\n+    private UpdateTopologyConfiguration updateTopologyConfiguration;\n+\n+    @Before\n+    public void before() throws Exception {\n+        brokerService = new BrokerService();\n+        brokerService.setPersistent(false);\n+        brokerService.setUseJmx(false);\n+        brokerService.addConnector(BROKER_URL);\n+        brokerService.start();\n+    }\n+\n+    /**\n+     * Encontre que Nathan hace referencia a testear la topology basandose en los siguientes ejemplos:\n+     * https://github.com/xumingming/storm-lib/blob/master/src/jvm/storm/TestingApiDemo.java\n+     *\n+     */\n+    @Test\n+    public void test() {\n+        MkClusterParam mkClusterParam = new MkClusterParam();\n+        mkClusterParam.setSupervisors(2);\n+        mkClusterParam.setPortsPerSupervisor(5);\n+        final Config daemonConf = new Config();\n+\n+        Testing.withLocalCluster(mkClusterParam, new TestJob() {\n+            @Override\n+            public void run(final ILocalCluster cluster) throws AlreadyAliveException, InvalidTopologyException {\n+                cluster.submitTopology(\"complex-updates\", daemonConf, updateTopologyConfiguration.getStormTopology());\n+                Update firstUpdate = createUpdateFor(\"id-1\", \"SEMS\", \"row-1\");\n+                //El sleep se debe a que hay un race condition entre el submit del mensaje y la topology que no termina de levantar","path":"src/it/java/ar/com/carloscurotto/storm/complex/topology/LocalStormTopologyIT.java","position":70,"original_position":70,"commit_id":"6a2a334f9d2cd8ed0c847b0d5556d6b672a1f310","original_commit_id":"6a2a334f9d2cd8ed0c847b0d5556d6b672a1f310","user":{"login":"carloscurotto","id":1410334,"avatar_url":"https://avatars.githubusercontent.com/u/1410334?v=3","gravatar_id":"","url":"https://api.github.com/users/carloscurotto","html_url":"https://github.com/carloscurotto","followers_url":"https://api.github.com/users/carloscurotto/followers","following_url":"https://api.github.com/users/carloscurotto/following{/other_user}","gists_url":"https://api.github.com/users/carloscurotto/gists{/gist_id}","starred_url":"https://api.github.com/users/carloscurotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carloscurotto/subscriptions","organizations_url":"https://api.github.com/users/carloscurotto/orgs","repos_url":"https://api.github.com/users/carloscurotto/repos","events_url":"https://api.github.com/users/carloscurotto/events{/privacy}","received_events_url":"https://api.github.com/users/carloscurotto/received_events","type":"User","site_admin":false},"body":"ok, habria que ver si se puede chequear si esta levantada como para fallar con un timeout si no levanto en tanto tiempo, aca estariamos asumiendo que levanta en x tiempo, pero podria no haber levantado igual.","created_at":"2015-04-05T16:17:27Z","updated_at":"2015-04-05T16:17:27Z","html_url":"https://github.com/carloscurotto/storm-example/pull/34#discussion_r27778421","pull_request_url":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/carloscurotto/storm-example/pulls/comments/27778421"},"html":{"href":"https://github.com/carloscurotto/storm-example/pull/34#discussion_r27778421"},"pull_request":{"href":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34","id":32619559,"html_url":"https://github.com/carloscurotto/storm-example/pull/34","diff_url":"https://github.com/carloscurotto/storm-example/pull/34.diff","patch_url":"https://github.com/carloscurotto/storm-example/pull/34.patch","issue_url":"https://api.github.com/repos/carloscurotto/storm-example/issues/34","number":34,"state":"open","locked":false,"title":"Gloss refactor","user":{"login":"emacampolo","id":1101540,"avatar_url":"https://avatars.githubusercontent.com/u/1101540?v=3","gravatar_id":"","url":"https://api.github.com/users/emacampolo","html_url":"https://github.com/emacampolo","followers_url":"https://api.github.com/users/emacampolo/followers","following_url":"https://api.github.com/users/emacampolo/following{/other_user}","gists_url":"https://api.github.com/users/emacampolo/gists{/gist_id}","starred_url":"https://api.github.com/users/emacampolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emacampolo/subscriptions","organizations_url":"https://api.github.com/users/emacampolo/orgs","repos_url":"https://api.github.com/users/emacampolo/repos","events_url":"https://api.github.com/users/emacampolo/events{/privacy}","received_events_url":"https://api.github.com/users/emacampolo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-03T21:58:09Z","updated_at":"2015-04-05T16:17:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76016551044e7a4ff36bcd0c3a0517d02758ba2f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34/commits","review_comments_url":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34/comments","review_comment_url":"https://api.github.com/repos/carloscurotto/storm-example/pulls/comments{/number}","comments_url":"https://api.github.com/repos/carloscurotto/storm-example/issues/34/comments","statuses_url":"https://api.github.com/repos/carloscurotto/storm-example/statuses/6a2a334f9d2cd8ed0c847b0d5556d6b672a1f310","head":{"label":"carloscurotto:gloss-refactor","ref":"gloss-refactor","sha":"6a2a334f9d2cd8ed0c847b0d5556d6b672a1f310","user":{"login":"carloscurotto","id":1410334,"avatar_url":"https://avatars.githubusercontent.com/u/1410334?v=3","gravatar_id":"","url":"https://api.github.com/users/carloscurotto","html_url":"https://github.com/carloscurotto","followers_url":"https://api.github.com/users/carloscurotto/followers","following_url":"https://api.github.com/users/carloscurotto/following{/other_user}","gists_url":"https://api.github.com/users/carloscurotto/gists{/gist_id}","starred_url":"https://api.github.com/users/carloscurotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carloscurotto/subscriptions","organizations_url":"https://api.github.com/users/carloscurotto/orgs","repos_url":"https://api.github.com/users/carloscurotto/repos","events_url":"https://api.github.com/users/carloscurotto/events{/privacy}","received_events_url":"https://api.github.com/users/carloscurotto/received_events","type":"User","site_admin":false},"repo":{"id":10831185,"name":"storm-example","full_name":"carloscurotto/storm-example","owner":{"login":"carloscurotto","id":1410334,"avatar_url":"https://avatars.githubusercontent.com/u/1410334?v=3","gravatar_id":"","url":"https://api.github.com/users/carloscurotto","html_url":"https://github.com/carloscurotto","followers_url":"https://api.github.com/users/carloscurotto/followers","following_url":"https://api.github.com/users/carloscurotto/following{/other_user}","gists_url":"https://api.github.com/users/carloscurotto/gists{/gist_id}","starred_url":"https://api.github.com/users/carloscurotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carloscurotto/subscriptions","organizations_url":"https://api.github.com/users/carloscurotto/orgs","repos_url":"https://api.github.com/users/carloscurotto/repos","events_url":"https://api.github.com/users/carloscurotto/events{/privacy}","received_events_url":"https://api.github.com/users/carloscurotto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carloscurotto/storm-example","description":"A simple example of use of the storm framework for online stream processing","fork":false,"url":"https://api.github.com/repos/carloscurotto/storm-example","forks_url":"https://api.github.com/repos/carloscurotto/storm-example/forks","keys_url":"https://api.github.com/repos/carloscurotto/storm-example/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carloscurotto/storm-example/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carloscurotto/storm-example/teams","hooks_url":"https://api.github.com/repos/carloscurotto/storm-example/hooks","issue_events_url":"https://api.github.com/repos/carloscurotto/storm-example/issues/events{/number}","events_url":"https://api.github.com/repos/carloscurotto/storm-example/events","assignees_url":"https://api.github.com/repos/carloscurotto/storm-example/assignees{/user}","branches_url":"https://api.github.com/repos/carloscurotto/storm-example/branches{/branch}","tags_url":"https://api.github.com/repos/carloscurotto/storm-example/tags","blobs_url":"https://api.github.com/repos/carloscurotto/storm-example/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carloscurotto/storm-example/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carloscurotto/storm-example/git/refs{/sha}","trees_url":"https://api.github.com/repos/carloscurotto/storm-example/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carloscurotto/storm-example/statuses/{sha}","languages_url":"https://api.github.com/repos/carloscurotto/storm-example/languages","stargazers_url":"https://api.github.com/repos/carloscurotto/storm-example/stargazers","contributors_url":"https://api.github.com/repos/carloscurotto/storm-example/contributors","subscribers_url":"https://api.github.com/repos/carloscurotto/storm-example/subscribers","subscription_url":"https://api.github.com/repos/carloscurotto/storm-example/subscription","commits_url":"https://api.github.com/repos/carloscurotto/storm-example/commits{/sha}","git_commits_url":"https://api.github.com/repos/carloscurotto/storm-example/git/commits{/sha}","comments_url":"https://api.github.com/repos/carloscurotto/storm-example/comments{/number}","issue_comment_url":"https://api.github.com/repos/carloscurotto/storm-example/issues/comments{/number}","contents_url":"https://api.github.com/repos/carloscurotto/storm-example/contents/{+path}","compare_url":"https://api.github.com/repos/carloscurotto/storm-example/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carloscurotto/storm-example/merges","archive_url":"https://api.github.com/repos/carloscurotto/storm-example/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carloscurotto/storm-example/downloads","issues_url":"https://api.github.com/repos/carloscurotto/storm-example/issues{/number}","pulls_url":"https://api.github.com/repos/carloscurotto/storm-example/pulls{/number}","milestones_url":"https://api.github.com/repos/carloscurotto/storm-example/milestones{/number}","notifications_url":"https://api.github.com/repos/carloscurotto/storm-example/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carloscurotto/storm-example/labels{/name}","releases_url":"https://api.github.com/repos/carloscurotto/storm-example/releases{/id}","created_at":"2013-06-20T22:51:59Z","updated_at":"2015-03-31T20:09:24Z","pushed_at":"2015-04-05T09:46:11Z","git_url":"git://github.com/carloscurotto/storm-example.git","ssh_url":"git@github.com:carloscurotto/storm-example.git","clone_url":"https://github.com/carloscurotto/storm-example.git","svn_url":"https://github.com/carloscurotto/storm-example","homepage":null,"size":1065,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":15,"forks":1,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"carloscurotto:master","ref":"master","sha":"a381db3a08884ced13a12f3e679b8c6b7cbfadfb","user":{"login":"carloscurotto","id":1410334,"avatar_url":"https://avatars.githubusercontent.com/u/1410334?v=3","gravatar_id":"","url":"https://api.github.com/users/carloscurotto","html_url":"https://github.com/carloscurotto","followers_url":"https://api.github.com/users/carloscurotto/followers","following_url":"https://api.github.com/users/carloscurotto/following{/other_user}","gists_url":"https://api.github.com/users/carloscurotto/gists{/gist_id}","starred_url":"https://api.github.com/users/carloscurotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carloscurotto/subscriptions","organizations_url":"https://api.github.com/users/carloscurotto/orgs","repos_url":"https://api.github.com/users/carloscurotto/repos","events_url":"https://api.github.com/users/carloscurotto/events{/privacy}","received_events_url":"https://api.github.com/users/carloscurotto/received_events","type":"User","site_admin":false},"repo":{"id":10831185,"name":"storm-example","full_name":"carloscurotto/storm-example","owner":{"login":"carloscurotto","id":1410334,"avatar_url":"https://avatars.githubusercontent.com/u/1410334?v=3","gravatar_id":"","url":"https://api.github.com/users/carloscurotto","html_url":"https://github.com/carloscurotto","followers_url":"https://api.github.com/users/carloscurotto/followers","following_url":"https://api.github.com/users/carloscurotto/following{/other_user}","gists_url":"https://api.github.com/users/carloscurotto/gists{/gist_id}","starred_url":"https://api.github.com/users/carloscurotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carloscurotto/subscriptions","organizations_url":"https://api.github.com/users/carloscurotto/orgs","repos_url":"https://api.github.com/users/carloscurotto/repos","events_url":"https://api.github.com/users/carloscurotto/events{/privacy}","received_events_url":"https://api.github.com/users/carloscurotto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carloscurotto/storm-example","description":"A simple example of use of the storm framework for online stream processing","fork":false,"url":"https://api.github.com/repos/carloscurotto/storm-example","forks_url":"https://api.github.com/repos/carloscurotto/storm-example/forks","keys_url":"https://api.github.com/repos/carloscurotto/storm-example/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carloscurotto/storm-example/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carloscurotto/storm-example/teams","hooks_url":"https://api.github.com/repos/carloscurotto/storm-example/hooks","issue_events_url":"https://api.github.com/repos/carloscurotto/storm-example/issues/events{/number}","events_url":"https://api.github.com/repos/carloscurotto/storm-example/events","assignees_url":"https://api.github.com/repos/carloscurotto/storm-example/assignees{/user}","branches_url":"https://api.github.com/repos/carloscurotto/storm-example/branches{/branch}","tags_url":"https://api.github.com/repos/carloscurotto/storm-example/tags","blobs_url":"https://api.github.com/repos/carloscurotto/storm-example/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carloscurotto/storm-example/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carloscurotto/storm-example/git/refs{/sha}","trees_url":"https://api.github.com/repos/carloscurotto/storm-example/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carloscurotto/storm-example/statuses/{sha}","languages_url":"https://api.github.com/repos/carloscurotto/storm-example/languages","stargazers_url":"https://api.github.com/repos/carloscurotto/storm-example/stargazers","contributors_url":"https://api.github.com/repos/carloscurotto/storm-example/contributors","subscribers_url":"https://api.github.com/repos/carloscurotto/storm-example/subscribers","subscription_url":"https://api.github.com/repos/carloscurotto/storm-example/subscription","commits_url":"https://api.github.com/repos/carloscurotto/storm-example/commits{/sha}","git_commits_url":"https://api.github.com/repos/carloscurotto/storm-example/git/commits{/sha}","comments_url":"https://api.github.com/repos/carloscurotto/storm-example/comments{/number}","issue_comment_url":"https://api.github.com/repos/carloscurotto/storm-example/issues/comments{/number}","contents_url":"https://api.github.com/repos/carloscurotto/storm-example/contents/{+path}","compare_url":"https://api.github.com/repos/carloscurotto/storm-example/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carloscurotto/storm-example/merges","archive_url":"https://api.github.com/repos/carloscurotto/storm-example/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carloscurotto/storm-example/downloads","issues_url":"https://api.github.com/repos/carloscurotto/storm-example/issues{/number}","pulls_url":"https://api.github.com/repos/carloscurotto/storm-example/pulls{/number}","milestones_url":"https://api.github.com/repos/carloscurotto/storm-example/milestones{/number}","notifications_url":"https://api.github.com/repos/carloscurotto/storm-example/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carloscurotto/storm-example/labels{/name}","releases_url":"https://api.github.com/repos/carloscurotto/storm-example/releases{/id}","created_at":"2013-06-20T22:51:59Z","updated_at":"2015-03-31T20:09:24Z","pushed_at":"2015-04-05T09:46:11Z","git_url":"git://github.com/carloscurotto/storm-example.git","ssh_url":"git@github.com:carloscurotto/storm-example.git","clone_url":"https://github.com/carloscurotto/storm-example.git","svn_url":"https://github.com/carloscurotto/storm-example","homepage":null,"size":1065,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":15,"forks":1,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34"},"html":{"href":"https://github.com/carloscurotto/storm-example/pull/34"},"issue":{"href":"https://api.github.com/repos/carloscurotto/storm-example/issues/34"},"comments":{"href":"https://api.github.com/repos/carloscurotto/storm-example/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/carloscurotto/storm-example/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/carloscurotto/storm-example/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/carloscurotto/storm-example/statuses/6a2a334f9d2cd8ed0c847b0d5556d6b672a1f310"}}}}