hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject hbase git commit: HBASE-14976 fix tests
Date Mon, 21 Dec 2015 19:39:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/master a7ba3110b -> f56abf730


HBASE-14976 fix tests

Signed-off-by: Mikhail Antonov <antonov@apache.org>


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

Branch: refs/heads/master
Commit: f56abf730f45823b2b6dd6d2daa5e33c69f3c86b
Parents: a7ba311
Author: Pallavi Adusumilli <padusumilli@fb.com>
Authored: Mon Dec 21 10:57:25 2015 -0800
Committer: Mikhail Antonov <antonov@apache.org>
Committed: Mon Dec 21 11:35:59 2015 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/TestRSStatusServlet.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f56abf73/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
index 732df4b..a9115f3 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
@@ -49,6 +49,9 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
+import org.apache.hadoop.hbase.ipc.MetricsHBaseServer;
+import org.apache.hadoop.hbase.ipc.MetricsHBaseServerWrapperStub;
+import org.apache.hadoop.hbase.ipc.RpcServerInterface;
 
 /**
  * Tests for the region server status page and its template.
@@ -58,6 +61,7 @@ public class TestRSStatusServlet {
   private static final Log LOG = LogFactory.getLog(TestRSStatusServlet.class);
   private HRegionServer rs;
   private RSRpcServices rpcServices;
+  private RpcServerInterface rpcServer;
 
   static final int FAKE_IPC_PORT = 1585;
   static final int FAKE_WEB_PORT = 1586;
@@ -74,9 +78,11 @@ public class TestRSStatusServlet {
   public void setupBasicMocks() throws IOException, ServiceException {
     rs = Mockito.mock(HRegionServer.class);
     rpcServices = Mockito.mock(RSRpcServices.class);
+    rpcServer = Mockito.mock(RpcServerInterface.class);
     Mockito.doReturn(HBaseConfiguration.create())
       .when(rs).getConfiguration();
     Mockito.doReturn(rpcServices).when(rs).getRSRpcServices();
+    Mockito.doReturn(rpcServer).when(rs).getRpcServer();
     Mockito.doReturn(fakeResponse).when(rpcServices).getServerInfo(
       (RpcController)Mockito.any(), (GetServerInfoRequest)Mockito.any());
     // Fake ZKW
@@ -98,6 +104,10 @@ public class TestRSStatusServlet {
     MetricsRegionServer rms = Mockito.mock(MetricsRegionServer.class);
     Mockito.doReturn(new MetricsRegionServerWrapperStub()).when(rms).getRegionServerWrapper();
     Mockito.doReturn(rms).when(rs).getRegionServerMetrics();
+
+    MetricsHBaseServer ms = Mockito.mock(MetricsHBaseServer.class);
+    Mockito.doReturn(new MetricsHBaseServerWrapperStub()).when(ms).getHBaseServerWrapper();
+    Mockito.doReturn(ms).when(rpcServer).getMetrics();
   }
   
   @Test


Mime
View raw message