storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [5/7] storm git commit: STORM-1238: port backtype.storm.security.auth.ThriftServer-test to java
Date Thu, 07 Jul 2016 14:26:37 GMT
STORM-1238: port backtype.storm.security.auth.ThriftServer-test to java


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

Branch: refs/heads/master
Commit: e05a916bd2242f5fb31dee5e6a0230dabe043700
Parents: 487c05e
Author: Abhishek Agarwal <abhishek.agarwal@inmobi.com>
Authored: Thu Mar 10 17:48:23 2016 +0530
Committer: Abhishek Agarwal <abhishek.agarwal@inmobi.com>
Committed: Sun Mar 13 18:46:24 2016 +0530

----------------------------------------------------------------------
 .../storm/security/auth/ThriftServer_test.clj   | 32 -----------------
 .../storm/security/auth/ThriftClientTest.java   |  2 +-
 .../storm/security/auth/ThriftServerTest.java   | 38 ++++++++++++++++++++
 3 files changed, 39 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/e05a916b/storm-core/test/clj/org/apache/storm/security/auth/ThriftServer_test.clj
----------------------------------------------------------------------
diff --git a/storm-core/test/clj/org/apache/storm/security/auth/ThriftServer_test.clj b/storm-core/test/clj/org/apache/storm/security/auth/ThriftServer_test.clj
deleted file mode 100644
index e5ad7e8..0000000
--- a/storm-core/test/clj/org/apache/storm/security/auth/ThriftServer_test.clj
+++ /dev/null
@@ -1,32 +0,0 @@
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements.  See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership.  The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License.  You may obtain a copy of the License at
-;;
-;; http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing, software
-;; distributed under the License is distributed on an "AS IS" BASIS,
-;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;; See the License for the specific language governing permissions and
-;; limitations under the License.
-(ns org.apache.storm.security.auth.ThriftServer-test
-  (:use [org.apache.storm util config])
-  (:use [clojure test])
-  (:import [org.apache.storm.security.auth ThriftServer ThriftConnectionType])
-  (:import [org.apache.thrift.transport TTransportException])
-  (:import [org.apache.storm.utils Utils])
-)
-
-(deftest test-stop-checks-for-null
-  (let [server (ThriftServer. (clojurify-structure (Utils/readDefaultConfig)) nil
-                              ThriftConnectionType/DRPC)]
-    (.stop server)))
-
-(deftest test-isServing-checks-for-null
-  (let [server (ThriftServer. (clojurify-structure (Utils/readDefaultConfig)) nil
-                              ThriftConnectionType/DRPC)]
-    (is (not (.isServing server)))))

http://git-wip-us.apache.org/repos/asf/storm/blob/e05a916b/storm-core/test/jvm/org/apache/storm/security/auth/ThriftClientTest.java
----------------------------------------------------------------------
diff --git a/storm-core/test/jvm/org/apache/storm/security/auth/ThriftClientTest.java b/storm-core/test/jvm/org/apache/storm/security/auth/ThriftClientTest.java
index 0e568dd..7e68e62 100644
--- a/storm-core/test/jvm/org/apache/storm/security/auth/ThriftClientTest.java
+++ b/storm-core/test/jvm/org/apache/storm/security/auth/ThriftClientTest.java
@@ -62,7 +62,7 @@ public class ThriftClientTest {
 
     @Test
     public void testConstructorThrowsIfHostEmpty() {
-        expectedException.expectCause(ThrowableNestedCauseMatcher.isCausedBy(TTransportException.class));
+        expectedException.expect(ThrowableNestedCauseMatcher.isCausedBy(TTransportException.class));
         new ThriftClient(conf, ThriftConnectionType.DRPC, "", 4242, NIMBUS_TIMEOUT);
     }
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/e05a916b/storm-core/test/jvm/org/apache/storm/security/auth/ThriftServerTest.java
----------------------------------------------------------------------
diff --git a/storm-core/test/jvm/org/apache/storm/security/auth/ThriftServerTest.java b/storm-core/test/jvm/org/apache/storm/security/auth/ThriftServerTest.java
new file mode 100644
index 0000000..0dc9b54
--- /dev/null
+++ b/storm-core/test/jvm/org/apache/storm/security/auth/ThriftServerTest.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.storm.security.auth;
+
+import org.junit.Assert;
+
+import org.apache.storm.utils.Utils;
+import org.junit.Test;
+
+public class ThriftServerTest {
+
+    @Test
+    public void testStopChecksForNull() {
+        ThriftServer server = new ThriftServer(Utils.readDefaultConfig(), null, ThriftConnectionType.DRPC);
+        server.stop();
+    }
+
+    @Test
+    public void testIsServingChecksForNull() {
+        ThriftServer server = new ThriftServer(Utils.readDefaultConfig(), null, ThriftConnectionType.DRPC);
+        Assert.assertFalse(server.isServing());
+    }
+}


Mime
View raw message