You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/09/22 22:28:59 UTC
[11/23] git commit: Refactor multilang tests
Refactor multilang tests
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/346335c8
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/346335c8
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/346335c8
Branch: refs/heads/master
Commit: 346335c8cbc894c8d7a9168fef85fd145886920c
Parents: 7d8b201
Author: Anya Tchernishov <an...@forter.com>
Authored: Tue Aug 5 16:28:11 2014 +0300
Committer: Itai Frenkel <it...@ryzyco.com>
Committed: Thu Aug 7 15:35:48 2014 +0300
----------------------------------------------------------------------
.../test/clj/backtype/storm/multilang_test.clj | 51 +++++++++-----------
1 file changed, 23 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/346335c8/storm-core/test/clj/backtype/storm/multilang_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/multilang_test.clj b/storm-core/test/clj/backtype/storm/multilang_test.clj
index c1cf51d..5e7b9f3 100644
--- a/storm-core/test/clj/backtype/storm/multilang_test.clj
+++ b/storm-core/test/clj/backtype/storm/multilang_test.clj
@@ -37,33 +37,28 @@
;; (Thread/sleep 10000)
;; )))
-(deftest test-multilang-rb
- (with-local-cluster [cluster :supervisors 4]
- (let [nimbus (:nimbus cluster)
- topology (thrift/mk-topology
- {"1" (thrift/mk-shell-spout-spec ["ruby" "tester_spout.rb"] ["word"])}
- {"2" (thrift/mk-shell-bolt-spec {"1" :shuffle} "ruby" "tester_bolt.rb" ["word"] :parallelism-hint 1)})]
- (submit-local-topology nimbus
- "test"
- {TOPOLOGY-WORKERS 20 TOPOLOGY-MESSAGE-TIMEOUT-SECS 3 TOPOLOGY-DEBUG true}
- topology)
- (Thread/sleep 10000)
- (.killTopology nimbus "test")
- (Thread/sleep 10000))))
+ (defn test-multilang
+ [executor file-extension]
+ (with-local-cluster [cluster :supervisors 4]
+ (let [nimbus (:nimbus cluster)
+ topology (thrift/mk-topology
+ {"1" (thrift/mk-shell-spout-spec [executor (str "tester_spout." file-extension)] ["word"])}
+ {"2" (thrift/mk-shell-bolt-spec {"1" :shuffle} [executor (str "tester_bolt." file-extension)] ["word"] :parallelism-hint 1)})]
+ (submit-local-topology nimbus
+ "test"
+ {TOPOLOGY-WORKERS 20 TOPOLOGY-MESSAGE-TIMEOUT-SECS 3 TOPOLOGY-DEBUG true}
+ topology)
+ (Thread/sleep 10000)
+ (.killTopology nimbus "test")
+ (Thread/sleep 10000)
+ )))
-(deftest test-multilang-py
- (with-local-cluster [cluster :supervisors 4]
- (let [nimbus (:nimbus cluster)
- topology (thrift/mk-topology
- {"1" (thrift/mk-shell-spout-spec ["python" "tester_spout.py"] ["word"])}
- {"2" (thrift/mk-shell-bolt-spec {"1" :shuffle} ["python" "tester_bolt.py"] ["word"] :parallelism-hint 1)}
- )]
- (submit-local-topology nimbus
- "test"
- {TOPOLOGY-WORKERS 20 TOPOLOGY-MESSAGE-TIMEOUT-SECS 3 TOPOLOGY-DEBUG true}
- topology)
- (Thread/sleep 10000)
- (.killTopology nimbus "test")
- (Thread/sleep 10000)
- )))
+
+(deftest test-python
+(test-multilang "python" "py")
+)
+
+(deftest test-ruby
+(test-multilang "ruby" "rb")
+)