You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by da...@apache.org on 2015/12/17 18:12:10 UTC

[2/6] storm git commit: refers to a common nimbus timeout

refers to a common nimbus timeout


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/e723112a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/e723112a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/e723112a

Branch: refs/heads/master
Commit: e723112acef519bc1d19e8414bd4925fe803cb8f
Parents: 402b8d2
Author: Derek Dagit <de...@yahoo-inc.com>
Authored: Tue Dec 15 09:20:20 2015 -0600
Committer: Derek Dagit <de...@yahoo-inc.com>
Committed: Tue Dec 15 09:20:20 2015 -0600

----------------------------------------------------------------------
 .../storm/security/auth/ThriftClient_test.clj   | 27 +++++++++++++++-----
 .../storm/security/auth/nimbus_auth_test.clj    |  3 +--
 2 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/e723112a/storm-core/test/clj/backtype/storm/security/auth/ThriftClient_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/ThriftClient_test.clj b/storm-core/test/clj/backtype/storm/security/auth/ThriftClient_test.clj
index 73f3c15..cab5730 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/ThriftClient_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/ThriftClient_test.clj
@@ -16,20 +16,27 @@
 (ns backtype.storm.security.auth.ThriftClient-test
   (:use [backtype.storm config util])
   (:use [clojure test])
+  (:require [backtype.storm.security.auth [auth-test :refer [nimbus-timeout]]])
   (:import [backtype.storm.security.auth ThriftClient ThriftConnectionType])
   (:import [org.apache.thrift.transport TTransportException])
 )
 
-(def TIMEOUT (Integer. (* 3 1000)))
-
 (deftest test-ctor-throws-if-port-invalid
   (let [conf (merge
               (read-default-config)
               {STORM-NIMBUS-RETRY-TIMES 0})]
     (is (thrown-cause? java.lang.IllegalArgumentException
-      (ThriftClient. conf ThriftConnectionType/DRPC "bogushost" (int -1) TIMEOUT)))
+      (ThriftClient. conf
+                     ThriftConnectionType/DRPC
+                     "bogushost"
+                     (int -1)
+                     nimbus-timeout)))
     (is (thrown-cause? java.lang.IllegalArgumentException
-        (ThriftClient. conf ThriftConnectionType/DRPC "bogushost" (int 0) TIMEOUT)))
+        (ThriftClient. conf
+                       ThriftConnectionType/DRPC
+                       "bogushost"
+                       (int 0)
+                       nimbus-timeout)))
   )
 )
 
@@ -38,8 +45,16 @@
               (read-default-config)
               {STORM-NIMBUS-RETRY-TIMES 0})]
     (is (thrown-cause? TTransportException
-         (ThriftClient. conf ThriftConnectionType/DRPC "" (int 4242) TIMEOUT)))
+         (ThriftClient. conf
+                        ThriftConnectionType/DRPC
+                        ""
+                        (int 4242)
+                        nimbus-timeout)))
     (is (thrown-cause? IllegalArgumentException
-        (ThriftClient. conf ThriftConnectionType/DRPC nil (int 4242) TIMEOUT)))
+        (ThriftClient. conf
+                       ThriftConnectionType/DRPC
+                       nil
+                       (int 4242)
+                       nimbus-timeout)))
   )
 )

http://git-wip-us.apache.org/repos/asf/storm/blob/e723112a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
index 8d7ac92..db5dcc2 100644
--- a/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
+++ b/storm-core/test/clj/backtype/storm/security/auth/nimbus_auth_test.clj
@@ -18,6 +18,7 @@
   (:require [backtype.storm [testing :as testing]])
   (:require [backtype.storm.daemon [nimbus :as nimbus]])
   (:require [backtype.storm [zookeeper :as zk]])
+  (:require [backtype.storm.security.auth [auth-test :refer [nimbus-timeout]]])
   (:import [java.nio ByteBuffer])
   (:import [backtype.storm Config])
   (:import [backtype.storm.utils NimbusClient])
@@ -31,8 +32,6 @@
   (:require [conjure.core])
   (:use [conjure core]))
 
-(def nimbus-timeout (Integer. (* 3 1000)))
-
 (defn launch-test-cluster [nimbus-port login-cfg aznClass transportPluginClass] 
   (let [conf {NIMBUS-AUTHORIZER aznClass 
               NIMBUS-THRIFT-PORT nimbus-port