Repository: oozie
Updated Branches:
  refs/heads/branch-4.1 6156c383a -> 2be1f18a4


OOZIE-2032 If using SSL, the port reported by Oozie is incorrect for HA tasks 
(rkanter)


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

Branch: refs/heads/branch-4.1
Commit: 2be1f18a44ea32d91359ebbe59c88e972e54c71d
Parents: 6156c38
Author: Robert Kanter <[email protected]>
Authored: Thu Oct 30 14:51:25 2014 -0700
Committer: Robert Kanter <[email protected]>
Committed: Thu Oct 30 14:51:25 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/oozie/util/ConfigUtils.java |  7 ++-
 .../org/apache/oozie/util/TestConfigUtils.java  | 49 ++++++++++++++++++++
 release-log.txt                                 |  1 +
 3 files changed, 56 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oozie/blob/2be1f18a/core/src/main/java/org/apache/oozie/util/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/oozie/util/ConfigUtils.java 
b/core/src/main/java/org/apache/oozie/util/ConfigUtils.java
index c3ac01a..4db595b 100644
--- a/core/src/main/java/org/apache/oozie/util/ConfigUtils.java
+++ b/core/src/main/java/org/apache/oozie/util/ConfigUtils.java
@@ -86,7 +86,12 @@ public class ConfigUtils {
         }
         sb.append(Services.get().getConf().get("oozie.http.hostname"));
         sb.append(":");
-        sb.append(Services.get().getConf().get("oozie.http.port"));
+        if (secure) {
+            sb.append(Services.get().getConf().get("oozie.https.port"));
+        }
+        else {
+            sb.append(Services.get().getConf().get("oozie.http.port"));
+        }
         sb.append("/oozie");
         return sb.toString();
     }

http://git-wip-us.apache.org/repos/asf/oozie/blob/2be1f18a/core/src/test/java/org/apache/oozie/util/TestConfigUtils.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/oozie/util/TestConfigUtils.java 
b/core/src/test/java/org/apache/oozie/util/TestConfigUtils.java
new file mode 100644
index 0000000..6904881
--- /dev/null
+++ b/core/src/test/java/org/apache/oozie/util/TestConfigUtils.java
@@ -0,0 +1,49 @@
+/**
+ * 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.oozie.util;
+
+import org.apache.oozie.service.Services;
+import org.apache.oozie.test.XTestCase;
+
+public class TestConfigUtils extends XTestCase {
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        new Services().init();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        if (Services.get() != null) {
+            Services.get().destroy();
+        }
+        super.tearDown();
+    }
+
+    public void testGetOozieURL() throws Exception {
+        // Normally these are set by a shell script, but not when run from 
unit tests, so just put some standard values here
+        Services.get().getConf().set("oozie.http.hostname", "localhost");
+        Services.get().getConf().set("oozie.http.port", "11000");
+        Services.get().getConf().set("oozie.https.port", "11443");
+
+        assertEquals("http://localhost:11000/oozie";, 
ConfigUtils.getOozieURL(false));
+        assertEquals("https://localhost:11443/oozie";, 
ConfigUtils.getOozieURL(true));
+    }
+}

http://git-wip-us.apache.org/repos/asf/oozie/blob/2be1f18a/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 9818664..39e54ad 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 4.1.0 release (4.1 - unreleased)
 
+OOZIE-2032 If using SSL, the port reported by Oozie is incorrect for HA tasks 
(rkanter)
 OOZIE-1959 TestZKUtilsWithSecurity fails (rkanter)
 OOZIE-2033 HA and misc improvements to SSL docs (rkanter)
 OOZIE-1789 Support backward compatibility of oozie share lib (shwethags)

Reply via email to