ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject ambari git commit: AMBARI-12654. Unit test fix for JMXHostProviderTest. (swagle)
Date Tue, 18 Aug 2015 21:30:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 5f5ebd43f -> 4045aa5aa


AMBARI-12654. Unit test fix for JMXHostProviderTest. (swagle)


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

Branch: refs/heads/branch-2.1
Commit: 4045aa5aab87e2c596cbc01de7708d25d2fe898e
Parents: 5f5ebd4
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Tue Aug 18 14:24:13 2015 -0700
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Tue Aug 18 14:28:31 2015 -0700

----------------------------------------------------------------------
 .../server/controller/internal/AbstractProviderModule.java   | 3 +--
 .../server/controller/internal/JMXHostProviderTest.java      | 8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4045aa5a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 6e3dcd5..5d33e22 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -34,7 +34,6 @@ import org.apache.ambari.server.controller.metrics.MetricHostProvider;
 import org.apache.ambari.server.controller.metrics.MetricsPropertyProvider;
 import org.apache.ambari.server.controller.metrics.MetricsReportPropertyProvider;
 import org.apache.ambari.server.controller.metrics.MetricsServiceProvider;
-import org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheEntryFactory;
 import org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheProvider;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
@@ -205,7 +204,7 @@ public abstract class AbstractProviderModule implements ProviderModule,
     if (managementController == null) {
       managementController = AmbariServer.getController();
     }
-    if (metricCacheProvider == null) {
+    if (metricCacheProvider == null && managementController != null) {
       metricCacheProvider = managementController.getTimelineMetricCacheProvider();
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4045aa5a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
index 74f19e0..2c6905d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
@@ -429,11 +429,11 @@ public class JMXHostProviderTest {
     Assert.assertEquals(null, providerModule.getPort("c1", "JOBTRACKER"));
   }
 
-  private static class JMXHostProviderModule extends
-    AbstractProviderModule {
+  private static class JMXHostProviderModule extends AbstractProviderModule {
 
-    ResourceProvider clusterResourceProvider = new
-      ClusterResourceProvider(controller);
+
+
+    ResourceProvider clusterResourceProvider = new ClusterResourceProvider(controller);
 
     Injector injector = createNiceMock(Injector.class);
     MaintenanceStateHelper maintenanceStateHelper = createNiceMock(MaintenanceStateHelper.class);


Mime
View raw message