Permalink
Browse files

cleanup code and remove unecessary test

  • Loading branch information...
1 parent 726be6c commit 28a9b029c1cac5b237dce9bb9f0fa84aeb448dae @nathanmarz nathanmarz committed Mar 5, 2013
Showing with 1 addition and 25 deletions.
  1. +1 −1 src/clj/backtype/storm/util.clj
  2. +0 −24 test/clj/backtype/storm/util_test.clj
@@ -390,7 +390,7 @@
))]
(.setDaemon thread daemon)
(.setPriority thread priority)
- (when-not (nil? thread-name)
+ (when thread-name
(.setName thread (str (.getName thread) "-" thread-name)))
(when start
(.start thread))
@@ -1,24 +0,0 @@
-(ns backtype.storm.util-test
- (:import [java.util.regex Pattern])
- (:use [clojure test])
- (:use [backtype.storm util]))
-
-(deftest async-loop-test
- (testing "thread name provided"
- (let [thread (async-loop
- (fn []
- (is (= true (.startsWith (.getName (Thread/currentThread)) "Thread-")))
- (is (= true (.endsWith (.getName (Thread/currentThread)) "-mythreadname")))
- 1)
- :thread-name "mythreadname")]
- (sleep-secs 2)
- (.interrupt thread)
- (.join thread)))
- (testing "thread name not provided"
- (let [thread (async-loop
- (fn []
- (is (= true (Pattern/matches "Thread-\\d+" (.getName (Thread/currentThread)))))
- 1))]
- (sleep-secs 2)
- (.interrupt thread)
- (.join thread))))

0 comments on commit 28a9b02

Please sign in to comment.