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-16292. AMS Builds borken with new Phoenix version 4.7. (swagle)
Date Fri, 06 May 2016 21:31:39 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk fb5f9b304 -> 65834423f


AMBARI-16292. AMS Builds borken with new Phoenix version 4.7. (swagle)


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

Branch: refs/heads/trunk
Commit: 65834423f3033cf63c2df48e917f162cc5f740eb
Parents: fb5f9b3
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Fri May 6 14:25:00 2016 -0700
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Fri May 6 14:25:09 2016 -0700

----------------------------------------------------------------------
 .../TestApplicationHistoryServer.java             | 18 +++++++++++++++++-
 .../timeline/AbstractMiniHBaseClusterTest.java    |  5 -----
 2 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/65834423/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryServer.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryServer.java
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryServer.java
index 48b505b..462213d 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryServer.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryServer.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.service.Service.STATE;
 import org.apache.hadoop.util.ExitUtil;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixHBaseAccessor;
+import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultPhoenixDataSource;
 import org.apache.zookeeper.ClientCnxn;
 import org.easymock.EasyMock;
@@ -36,6 +37,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
 import org.powermock.core.classloader.annotations.PowerMockIgnore;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
@@ -61,6 +63,7 @@ import static org.easymock.EasyMock.expectLastCall;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
+import static org.powermock.api.easymock.PowerMock.expectNew;
 import static org.powermock.api.easymock.PowerMock.mockStatic;
 import static org.powermock.api.easymock.PowerMock.replayAll;
 import static org.powermock.api.easymock.PowerMock.verifyAll;
@@ -69,7 +72,8 @@ import static org.powermock.api.support.membermodification.MemberModifier.suppre
 
 @RunWith(PowerMockRunner.class)
 @PrepareForTest({ PhoenixHBaseAccessor.class, UserGroupInformation.class,
-  ClientCnxn.class, DefaultPhoenixDataSource.class, ConnectionFactory.class})
+  ClientCnxn.class, DefaultPhoenixDataSource.class, ConnectionFactory.class,
+  TimelineMetricConfiguration.class, ApplicationHistoryServer.class })
 @PowerMockIgnore( {"javax.management.*"})
 public class TestApplicationHistoryServer {
 
@@ -163,6 +167,18 @@ public class TestApplicationHistoryServer {
     expect(UserGroupInformation.isSecurityEnabled()).andReturn(false).anyTimes();
     config.set(YarnConfiguration.APPLICATION_HISTORY_STORE,
       "org.apache.hadoop.yarn.server.applicationhistoryservice.NullApplicationHistoryStore");
+    Configuration hbaseConf = new Configuration();
+    hbaseConf.set("hbase.zookeeper.quorum", "localhost");
+
+    TimelineMetricConfiguration metricConfiguration = PowerMock.createNiceMock(TimelineMetricConfiguration.class);
+    expectNew(TimelineMetricConfiguration.class).andReturn(metricConfiguration);
+    expect(metricConfiguration.getHbaseConf()).andReturn(hbaseConf);
+    Configuration metricsConf = new Configuration();
+    expect(metricConfiguration.getMetricsConf()).andReturn(metricsConf).anyTimes();
+    expect(metricConfiguration.isTimelineMetricsServiceWatcherDisabled()).andReturn(true);
+    expect(metricConfiguration.getTimelineMetricsServiceHandlerThreadCount()).andReturn(20).anyTimes();
+    expect(metricConfiguration.getWebappAddress()).andReturn("localhost:9990").anyTimes();
+    expect(metricConfiguration.getTimelineServiceRpcAddress()).andReturn("localhost:10299").anyTimes();
 
     Connection connection = createNiceMock(Connection.class);
     Statement stmt = createNiceMock(Statement.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/65834423/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractMiniHBaseClusterTest.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractMiniHBaseClusterTest.java
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractMiniHBaseClusterTest.java
index b0dba17..611d82e 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractMiniHBaseClusterTest.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/AbstractMiniHBaseClusterTest.java
@@ -146,11 +146,6 @@ public abstract class AbstractMiniHBaseClusterTest extends BaseTest {
         }
       }
     }
-    try {
-      deletePriorTables(HConstants.LATEST_TIMESTAMP, getUrl());
-    } catch (Exception e) {
-      LOG.warn("Failed in delete prior tables.", e);
-    }
   }
 
   public static Map<String, String> getDefaultProps() {


Mime
View raw message