ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-13477 Unit tests failures after merging express upgrade (dsen)
Date Tue, 20 Oct 2015 10:52:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 28c059f08 -> c9d75dd5d


AMBARI-13477 Unit tests failures after merging express upgrade (dsen)


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

Branch: refs/heads/trunk
Commit: c9d75dd5d5e14c5b971c86795d49a8d27bf0a454
Parents: 28c059f
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Oct 20 13:51:45 2015 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Oct 20 13:51:45 2015 +0300

----------------------------------------------------------------------
 .../ambari/server/checks/HostsMasterMaintenanceCheck.java       | 4 ++++
 .../ambari/server/checks/HostsRepositoryVersionCheck.java       | 4 ++++
 .../ambari/server/checks/HostsMasterMaintenanceCheckTest.java   | 4 ++++
 .../ambari/server/checks/HostsRepositoryVersionCheckTest.java   | 5 +++++
 4 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c9d75dd5/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
index 39ab39f..cdb7c61 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
@@ -53,6 +53,10 @@ public class HostsMasterMaintenanceCheck extends AbstractCheckDescriptor
{
     super(CheckDescription.HOSTS_MASTER_MAINTENANCE);
   }
 
+  public boolean isApplicable(PrereqCheckRequest request) throws AmbariException {
+      return super.isApplicable(request) && request.getRepositoryVersion() != null;
+  }
+
   @Override
   public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws
AmbariException {
     final String clusterName = request.getClusterName();

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9d75dd5/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
index 00862ac..30250ef 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
@@ -53,6 +53,10 @@ public class HostsRepositoryVersionCheck extends AbstractCheckDescriptor
{
     super(CheckDescription.HOSTS_REPOSITORY_VERSION);
   }
 
+  public boolean isApplicable(PrereqCheckRequest request) throws AmbariException {
+    return super.isApplicable(request) && request.getRepositoryVersion() != null;
+  }
+
   @Override
   public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request)
       throws AmbariException {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9d75dd5/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
index 18a1d45..3f79767 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheckTest.java
@@ -65,6 +65,10 @@ public class HostsMasterMaintenanceCheckTest {
     HostsMasterMaintenanceCheck hmmc2 = new HostsMasterMaintenanceCheck();
     hmmc2.config = config;
     Assert.assertTrue(hmmc2.isApplicable(request));
+    request.setRepositoryVersion(null);
+
+    hmmc2.config = config;
+    Assert.assertFalse(hmmc2.isApplicable(request));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/c9d75dd5/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
index 0c2c92a..42a3bb4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheckTest.java
@@ -65,6 +65,11 @@ public class HostsRepositoryVersionCheckTest {
     HostsRepositoryVersionCheck hrvc2 = new HostsRepositoryVersionCheck();
     hrvc2.config = config;
     Assert.assertTrue(hrvc2.isApplicable(request));
+    request.setRepositoryVersion(null);
+
+    HostsMasterMaintenanceCheck hmmc2 = new HostsMasterMaintenanceCheck();
+    hmmc2.config = config;
+    Assert.assertFalse(hmmc2.isApplicable(request));
   }
 
   @Test


Mime
View raw message