HBASE-7669 Addendum fixes TestPriorityRpc

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1438853 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2013-01-26 05:28:14 +00:00
parent 4d7b2824be
commit e9f14f1073
1 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ public class TestPriorityRpc {
HRegionInfo mockRegionInfo = Mockito.mock(HRegionInfo.class); HRegionInfo mockRegionInfo = Mockito.mock(HRegionInfo.class);
Mockito.when(mockRS.getRegion((RegionSpecifier)Mockito.any())).thenReturn(mockRegion); Mockito.when(mockRS.getRegion((RegionSpecifier)Mockito.any())).thenReturn(mockRegion);
Mockito.when(mockRegion.getRegionInfo()).thenReturn(mockRegionInfo); Mockito.when(mockRegion.getRegionInfo()).thenReturn(mockRegionInfo);
Mockito.when(mockRegionInfo.isMetaRegion()).thenReturn(true); Mockito.when(mockRegionInfo.isMetaTable()).thenReturn(true);
qosFunction.setRegionServer(mockRS); qosFunction.setRegionServer(mockRS);
assertTrue (qosFunction.apply(rpcRequest) == HConstants.HIGH_QOS); assertTrue (qosFunction.apply(rpcRequest) == HConstants.HIGH_QOS);
} }
@ -132,14 +132,14 @@ public class TestPriorityRpc {
Mockito.when(mockRegionScanner.getRegionInfo()).thenReturn(mockRegionInfo); Mockito.when(mockRegionScanner.getRegionInfo()).thenReturn(mockRegionInfo);
Mockito.when(mockRS.getRegion((RegionSpecifier)Mockito.any())).thenReturn(mockRegion); Mockito.when(mockRS.getRegion((RegionSpecifier)Mockito.any())).thenReturn(mockRegion);
Mockito.when(mockRegion.getRegionInfo()).thenReturn(mockRegionInfo); Mockito.when(mockRegion.getRegionInfo()).thenReturn(mockRegionInfo);
Mockito.when(mockRegionInfo.isMetaRegion()).thenReturn(true); Mockito.when(mockRegionInfo.isMetaTable()).thenReturn(true);
qosFunction.setRegionServer(mockRS); qosFunction.setRegionServer(mockRS);
assertTrue (qosFunction.apply(rpcRequest) == HConstants.HIGH_QOS); assertTrue (qosFunction.apply(rpcRequest) == HConstants.HIGH_QOS);
//the same as above but with non-meta region //the same as above but with non-meta region
Mockito.when(mockRegionInfo.isMetaRegion()).thenReturn(false); Mockito.when(mockRegionInfo.isMetaTable()).thenReturn(false);
assertTrue (qosFunction.apply(rpcRequest) == HConstants.NORMAL_QOS); assertTrue (qosFunction.apply(rpcRequest) == HConstants.NORMAL_QOS);
} }