()
| 157 | } |
| 158 | |
| 159 | @Test |
| 160 | public void enqueueTimeoutTimerShuttingDown() throws Exception { |
| 161 | timer = mock(FakeTimer.class); |
| 162 | when(timer.newTimeout(any(TimerTask.class), anyLong(), any(TimeUnit.class))) |
| 163 | .thenThrow(new IllegalStateException("Shutdown!")); |
| 164 | Whitebox.setInternalState(client, "rpc_timeout_timer", timer); |
| 165 | final GetRequest rpc = new GetRequest(TABLE, KEY, FAMILY); |
| 166 | final Deferred<Object> deferred = rpc.getDeferred(); |
| 167 | assertNull(rpc.timeout_handle); |
| 168 | assertFalse(rpc.hasTimedOut()); |
| 169 | |
| 170 | rpc.enqueueTimeout(regionclient); |
| 171 | |
| 172 | assertNull(rpc.timeout_handle); |
| 173 | assertEquals(default_timeout, rpc.getTimeout()); |
| 174 | assertFalse(rpc.hasTimedOut()); |
| 175 | verify(regionclient, never()).removeRpc(any(HBaseRpc.class), anyBoolean()); |
| 176 | verify(timer).newTimeout(any(TimerTask.class), anyLong(), any(TimeUnit.class)); |
| 177 | try { |
| 178 | deferred.join(1); |
| 179 | fail("Expected a TimeoutException"); |
| 180 | } catch (TimeoutException e) { } |
| 181 | } |
| 182 | |
| 183 | @Test |
| 184 | public void callback() throws Exception { |
nothing calls this directly
no test coverage detected