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:11:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 89797ea2c -> aa6b3308c


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

Branch: refs/heads/trunk
Commit: aa6b3308c44b1e0e74edc41e96e078e3597bed75
Parents: 89797ea
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Thu Jun 8 17:11:42 2017 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Thu Jun 8 17:11:42 2017 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/aa6b3308/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 1eeb82b..2a9d6c9 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
@@ -315,7 +315,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/aa6b3308/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 0312579..c0e3ef1 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
@@ -134,7 +134,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() {
@@ -146,7 +145,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
@@ -1990,7 +1989,7 @@ public class AmbariManagementControllerImplTest {
   @Test
   public void testPopulateServicePackagesInfo() throws Exception {
     Capture<AmbariManagementController> controllerCapture = EasyMock.newCapture();
-    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);
@@ -2025,15 +2024,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
@@ -2200,14 +2202,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