hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [2/2] hbase git commit: Amend HBASE-14976 fix tests
Date Tue, 05 Jan 2016 00:25:58 GMT
Amend HBASE-14976 fix tests

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

Conflicts:
	hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java


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

Branch: refs/heads/0.98
Commit: ec1285cfb5b884b09c2f0d8e38cf89a1f146208e
Parents: 22edb52
Author: Pallavi Adusumilli <padusumilli@fb.com>
Authored: Mon Dec 21 10:57:25 2015 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Mon Jan 4 16:09:07 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/ec1285cf/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 5a12eb2..c878209 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
@@ -48,6 +48,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.
@@ -56,7 +59,8 @@ import org.apache.hadoop.hbase.io.hfile.CacheConfig;
 public class TestRSStatusServlet {
   private static final Log LOG = LogFactory.getLog(TestRSStatusServlet.class);
   private HRegionServer rs;
-  
+  private RpcServerInterface rpcServer;
+
   static final int FAKE_IPC_PORT = 1585;
   static final int FAKE_WEB_PORT = 1586;
   
@@ -71,8 +75,10 @@ public class TestRSStatusServlet {
   @Before
   public void setupBasicMocks() throws IOException, ServiceException {
     rs = Mockito.mock(HRegionServer.class);
+    rpcServer = Mockito.mock(RpcServerInterface.class);
     Mockito.doReturn(HBaseConfiguration.create())
       .when(rs).getConfiguration();
+    Mockito.doReturn(rpcServer).when(rs).getRpcServer();
     Mockito.doReturn(fakeResponse).when(rs).getServerInfo(
       (RpcController)Mockito.any(), (GetServerInfoRequest)Mockito.any());
     // Fake ZKW
@@ -94,6 +100,10 @@ public class TestRSStatusServlet {
     MetricsRegionServer rms = Mockito.mock(MetricsRegionServer.class);
     Mockito.doReturn(new MetricsRegionServerWrapperStub()).when(rms).getRegionServerWrapper();
     Mockito.doReturn(rms).when(rs).getMetrics();
+
+    MetricsHBaseServer ms = Mockito.mock(MetricsHBaseServer.class);
+    Mockito.doReturn(new MetricsHBaseServerWrapperStub()).when(ms).getHBaseServerWrapper();
+    Mockito.doReturn(ms).when(rpcServer).getMetrics();
   }
   
   @Test


Mime
View raw message