Repository: oozie
Updated Branches:
  refs/heads/master 75da42b73 -> ce3976e47


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/ce3976e4
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/ce3976e4
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/ce3976e4

Branch: refs/heads/master
Commit: ce3976e473ab258da3cd3b3828acc6403389390f
Parents: 75da42b
Author: Robert Kanter <[email protected]>
Authored: Thu Oct 30 14:51:51 2014 -0700
Committer: Robert Kanter <[email protected]>
Committed: Thu Oct 30 14:51:51 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/ce3976e4/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 b08ab64..ca0ce24 100644
--- a/core/src/main/java/org/apache/oozie/util/ConfigUtils.java
+++ b/core/src/main/java/org/apache/oozie/util/ConfigUtils.java
@@ -87,7 +87,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/ce3976e4/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/ce3976e4/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index e8b9aff..086707c 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -40,6 +40,7 @@ OOZIE-1943 Bump up trunk to 4.2.0-SNAPSHOT (bzhang)
 
 -- 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