ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-8903. KerberosOperationHandlerFactory does not create right handler for AD. (Dilli Arumugam via Jaimin)
Date Mon, 05 Jan 2015 22:59:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 016604db0 -> c9969233b


AMBARI-8903. KerberosOperationHandlerFactory does not  create right handler for AD. (Dilli
Arumugam via Jaimin)


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

Branch: refs/heads/trunk
Commit: c9969233be5703ad4431cc95e180ca75d94d4cd7
Parents: 016604d
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Jan 5 14:59:14 2015 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Jan 5 14:59:14 2015 -0800

----------------------------------------------------------------------
 .../KerberosOperationHandlerFactory.java        |  4 ++
 .../KerberosOperationHandlerFactoryTest.java    | 39 ++++++++++++++++++++
 2 files changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c9969233/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactory.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactory.java
index 61a637b..30e3c35 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactory.java
@@ -45,6 +45,10 @@ public class KerberosOperationHandlerFactory {
       case MIT_KDC:
         handler = new MITKerberosOperationHandler();
         break;
+      case ACTIVE_DIRECTORY:
+        handler = new ADKerberosOperationHandler();
+        break;
+
     }
 
     return handler;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9969233/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
new file mode 100644
index 0000000..4c7e49d
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KerberosOperationHandlerFactoryTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.ambari.server.serveraction.kerberos;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class KerberosOperationHandlerFactoryTest {
+
+
+  @Test
+  public void testForAD() {
+    Assert.assertEquals(MITKerberosOperationHandler.class,
+      KerberosOperationHandlerFactory.getKerberosOperationHandler(KDCType.MIT_KDC).getClass());
+  }
+
+  @Test
+  public void testForMIT() {
+    Assert.assertEquals(ADKerberosOperationHandler.class,
+      KerberosOperationHandlerFactory.getKerberosOperationHandler(KDCType.ACTIVE_DIRECTORY).getClass());
+  }
+
+}


Mime
View raw message