ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-21054. Add ppc as a new OS for User. (aonishuk)
Date Thu, 08 Jun 2017 14:06:09 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 afeb6f3a3 -> d7d0d179d


AMBARI-21054. Add ppc as a new OS for User. (aonishuk)


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

Branch: refs/heads/branch-2.5
Commit: d7d0d179dc3b2a79c7c2e14641a8a61a774a8f76
Parents: afeb6f3
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Thu Jun 8 17:05:40 2017 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Thu Jun 8 17:05:58 2017 +0300

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java          |  2 +-
 .../AmbariManagementControllerImplTest.java      | 19 +++++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7d0d179/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 4cb72c2..1db9bc9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -319,7 +319,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
   @Inject
   private StackDAO stackDAO;
   @Inject
-  private OsFamily osFamily;
+  protected OsFamily osFamily;
 
   /**
    * The KerberosHelper to help setup for enabling for disabling Kerberos

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7d0d179/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index b1c1d27..dbfee41 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -106,6 +106,7 @@ import org.apache.ambari.server.state.StackInfo;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.Capture;
+import org.easymock.EasyMock;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -135,7 +136,6 @@ public class AmbariManagementControllerImplTest {
   private static final AmbariMetaInfo ambariMetaInfo = createMock(AmbariMetaInfo.class);
   private static final Users users = createMock(Users.class);
   private static final AmbariSessionManager sessionManager = createNiceMock(AmbariSessionManager.class);
-  private static final OsFamily osFamily = createNiceMock(OsFamily.class);
 
   @BeforeClass
   public static void setupAuthentication() {
@@ -147,7 +147,7 @@ public class AmbariManagementControllerImplTest {
 
   @Before
   public void before() throws Exception {
-    reset(ldapDataPopulator, clusters, actionDBAccessor, ambariMetaInfo, users, sessionManager,
osFamily);
+    reset(ldapDataPopulator, clusters, actionDBAccessor, ambariMetaInfo, users, sessionManager);
   }
 
   @Test
@@ -1995,7 +1995,7 @@ public class AmbariManagementControllerImplTest {
   @Test
   public void testPopulateServicePackagesInfo() throws Exception {
     Capture<AmbariManagementController> controllerCapture = new Capture<AmbariManagementController>();
-    Injector injector = Guice.createInjector(Modules.override(new InMemoryDefaultTestModule()).with(new
MockModule()));
+    Injector injector = createStrictMock(Injector.class);
     MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class);
 
     ServiceInfo serviceInfo = createNiceMock(ServiceInfo.class);
@@ -2030,15 +2030,18 @@ public class AmbariManagementControllerImplTest {
     expect(injector.getInstance(Gson.class)).andReturn(null);
     expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(maintHelper).anyTimes();
     expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class));
+    
+    OsFamily osFamilyMock = createNiceMock(OsFamily.class);
 
-    replay(maintHelper, injector, clusters, serviceInfo);
+    EasyMock.expect(osFamilyMock.isVersionedOsFamilyExtendedByVersionedFamily("testOSFamily",
"testOSFamily")).andReturn(true).times(3);    
+    replay(maintHelper, injector, clusters, serviceInfo, osFamilyMock);
 
     AmbariManagementControllerImplTest.NestedTestClass nestedTestClass = this.new NestedTestClass(null,
clusters,
-        injector);
+        injector, osFamilyMock);
 
     ServiceOsSpecific serviceOsSpecific = nestedTestClass.populateServicePackagesInfo(serviceInfo,
hostParams, osFamily);
 
-    assertEquals(serviceOsSpecific.getPackages().size(), 3);
+    assertEquals(3, serviceOsSpecific.getPackages().size());
   }
 
   @Test
@@ -2213,14 +2216,14 @@ public class AmbariManagementControllerImplTest {
       binder.bind(AmbariMetaInfo.class).toInstance(ambariMetaInfo);
       binder.bind(Users.class).toInstance(users);
       binder.bind(AmbariSessionManager.class).toInstance(sessionManager);
-      binder.bind(OsFamily.class).toInstance(osFamily);
     }
   }
 
   private class NestedTestClass extends AmbariManagementControllerImpl {
 
-    public NestedTestClass(ActionManager actionManager, Clusters clusters, Injector injector)
throws Exception {
+    public NestedTestClass(ActionManager actionManager, Clusters clusters, Injector injector,
OsFamily osFamilyMock) throws Exception {
       super(actionManager, clusters, injector);
+      this.osFamily = osFamilyMock;
     }
 
     public ServiceOsSpecific testPopulateServicePackagesInfo(ServiceInfo serviceInfo, Map<String,
String> hostParams,


Mime
View raw message