()
| 129 | } |
| 130 | |
| 131 | @Test |
| 132 | public void exceptionCaughtChNotOpen() throws Exception { |
| 133 | PowerMockito.mockStatic(Channels.class); |
| 134 | final RegionClient rclient = PowerMockito.spy(new RegionClient(hbase_client)); |
| 135 | PowerMockito.field(RegionClient.class, "chan").set(rclient, chan); |
| 136 | final ExceptionEvent event = new DefaultExceptionEvent(chan, |
| 137 | new RuntimeException("Boo!")); |
| 138 | |
| 139 | rclient.exceptionCaught(null, event); |
| 140 | |
| 141 | verifyPrivate(rclient, times(1)).invoke("cleanup", chan); |
| 142 | PowerMockito.verifyStatic(never()); |
| 143 | Channels.close(chan); |
| 144 | } |
| 145 | |
| 146 | @Test (expected = NullPointerException.class) |
| 147 | public void exceptionCaughtNullEvent() throws Exception { |
nothing calls this directly
no test coverage detected