1. Merge remote-tracking branch 'upstream/master'

Conflicts:
        storm-core/src/clj/org/apache/storm/daemon/drpc.clj

2. Remove CommonInstaller.java


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

Branch: refs/heads/master
Commit: cdbe744875b6583638166e4ece1563552f272274
Parents: 1ef010d 81fb727
Author: basti.lj <[email protected]>
Authored: Thu Mar 10 11:07:47 2016 +0800
Committer: basti.lj <[email protected]>
Committed: Thu Mar 10 11:07:47 2016 +0800

----------------------------------------------------------------------
 CHANGELOG.md                                    |   2 +
 conf/log4j2.xml                                 |   2 +-
 .../org/apache/storm/starter/ManualDRPC.java    |  53 ++-
 .../src/clj/org/apache/storm/LocalDRPC.clj      |  56 ---
 .../src/clj/org/apache/storm/daemon/drpc.clj    | 215 +----------
 .../clj/org/apache/storm/trident/testing.clj    |   2 -
 .../src/jvm/org/apache/storm/LocalDRPC.java     |  72 ++++
 .../jvm/org/apache/storm/daemon/DrpcServer.java | 357 +++++++++++++++++++
 .../test/clj/org/apache/storm/drpc_test.clj     |  27 +-
 .../test/clj/org/apache/storm/nimbus_test.clj   |   8 +-
 .../storm/security/auth/drpc_auth_test.clj      |   5 +-
 .../utils/staticmocking/CommonInstaller.java    |  38 --
 12 files changed, 489 insertions(+), 348 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/cdbe7448/storm-core/test/clj/org/apache/storm/nimbus_test.clj
----------------------------------------------------------------------
diff --cc storm-core/test/clj/org/apache/storm/nimbus_test.clj
index c32480f,fb000da..fa475e7
--- a/storm-core/test/clj/org/apache/storm/nimbus_test.clj
+++ b/storm-core/test/clj/org/apache/storm/nimbus_test.clj
@@@ -35,15 -35,15 +35,15 @@@
              LogConfig LogLevel LogLevelAction])
    (:import [java.util HashMap])
    (:import [java.io File])
--  (:import [org.apache.storm.utils Time Utils Utils$UptimeComputer 
ConfigUtils IPredicate]
-            [org.apache.storm.utils.staticmocking ConfigUtilsInstaller 
UtilsInstaller CommonInstaller])
++  (:import [org.apache.storm.utils Time Utils Utils$UptimeComputer 
ConfigUtils IPredicate StormCommonInstaller]
+            [org.apache.storm.utils.staticmocking ConfigUtilsInstaller 
UtilsInstaller])
    (:import [org.apache.storm.zookeeper Zookeeper])
 -  (:import [org.apache.commons.io FileUtils]
 -           [org.json.simple JSONValue])
 +  (:import [org.apache.commons.io FileUtils])
 +  (:import [org.json.simple JSONValue])
 +  (:import [org.apache.storm.daemon StormCommon])
    (:import [org.apache.storm.cluster StormClusterStateImpl 
ClusterStateContext ClusterUtils])
    (:use [org.apache.storm testing util config log converter])
 -  (:use [org.apache.storm.daemon common])
 -  (:require [conjure.core])
 +    (:require [conjure.core] [org.apache.storm.daemon.worker :as worker])
  
    (:use [conjure core]))
  
@@@ -1350,25 -1346,20 +1350,25 @@@
                        [1 2 3] expected-name expected-conf 
expected-operation))))))
  
          (testing "getTopology calls check-authorization! with the correct 
parameters."
 -          (let [expected-operation "getTopology"]
 -            (stubbing [nimbus/check-authorization! nil
 +          (let [expected-operation "getTopology"
 +                common-spy (->>
 +                             (proxy [StormCommon] []
 +                                    (systemTopologyImpl [conf topology] nil))
 +                           Mockito/spy)]
-             (with-open [- (CommonInstaller. common-spy)]
++            (with-open [- (StormCommonInstaller. common-spy)]
 +              (stubbing [nimbus/check-authorization! nil
                         nimbus/try-read-storm-conf expected-conf
 -                       nimbus/try-read-storm-topology nil
 -                       system-topology! nil]
 -              (try
 -                (.getTopology nimbus "fake-id")
 -                (catch NotAliveException e)
 -                (finally
 -                  (verify-first-call-args-for-indices
 -                    nimbus/check-authorization!
 -                      [1 2 3] expected-name expected-conf expected-operation)
 -                  (verify-first-call-args-for-indices
 -                    system-topology! [0] expected-conf))))))
 +                       nimbus/try-read-storm-topology nil]
 +                (try
 +                  (.getTopology nimbus "fake-id")
 +                  (catch NotAliveException e)
 +                  (finally
 +                    (verify-first-call-args-for-indices
 +                      nimbus/check-authorization!
 +                        [1 2 3] expected-name expected-conf 
expected-operation)
 +                    (. (Mockito/verify common-spy)
 +                      (systemTopologyImpl (Matchers/eq expected-conf)
 +                                          (Matchers/any)))))))))
  
          (testing "getUserTopology calls check-authorization with the correct 
parameters."
            (let [expected-operation "getUserTopology"]
@@@ -1487,12 -1478,9 +1487,12 @@@
                         (newInstanceImpl [_])
                         (makeUptimeComputer [] (proxy [Utils$UptimeComputer] []
                                                  (upTime [] 0))))
 -          cluster-utils (Mockito/mock ClusterUtils)]
 +          cluster-utils (Mockito/mock ClusterUtils)
 +        fake-common (proxy [StormCommon] []
 +                             (mkAuthorizationHandler [_] nil))]
        (with-open [_ (ConfigUtilsInstaller. fake-cu)
                    _ (UtilsInstaller. fake-utils)
-                   - (CommonInstaller. fake-common)
++                  - (StormCommonInstaller. fake-common)
                    zk-le (MockedZookeeper. (proxy [Zookeeper] []
                            (zkLeaderElectorImpl [conf] nil)))
                    mocked-cluster (MockedCluster. cluster-utils)]

Reply via email to