()
| 201 | } |
| 202 | |
| 203 | @SuppressWarnings("rawtypes") |
| 204 | @Test |
| 205 | public void channelDisconnected() throws Exception { |
| 206 | RegionClient rclient = PowerMockito.spy(new RegionClient(hbase_client)); |
| 207 | PowerMockito.field(RegionClient.class, "chan").set(rclient, chan); |
| 208 | |
| 209 | when(cse.getChannel()).thenReturn(chan); |
| 210 | // Prevent/stub logic in super.method() |
| 211 | PowerMockito.doNothing().when((ReplayingDecoder)rclient) |
| 212 | .channelDisconnected(ctx, cse); |
| 213 | PowerMockito.doNothing().when(rclient, "cleanup", chan); |
| 214 | PowerMockito.when(rclient, "channelDisconnected", ctx, cse) |
| 215 | .thenCallRealMethod(); |
| 216 | |
| 217 | assertNotNull(Whitebox.getInternalState(rclient, "chan")); |
| 218 | rclient.channelDisconnected(ctx, cse); |
| 219 | assertNull(Whitebox.getInternalState(rclient, "chan")); |
| 220 | } |
| 221 | |
| 222 | @Test |
| 223 | public void channelClosed() throws Exception { |
nothing calls this directly
no test coverage detected