MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / executePleaseThrottleNotWriteable

Method executePleaseThrottleNotWriteable

test/tsd/TestPutRpc.java:205–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203 }
204
205 @Test
206 public void executePleaseThrottleNotWriteable() throws Exception {
207 when(client.put(any(PutRequest.class)))
208 .thenReturn(Deferred.fromError(mock(PleaseThrottleException.class)));
209 final PutDataPointRpc put = new PutDataPointRpc(tsdb.getConfig());
210 final Channel chan = NettyMocks.fakeChannel();
211 when(chan.isWritable()).thenReturn(false);
212 put.execute(tsdb, chan, new String[] { "put", METRIC_STRING,
213 "1365465600", "42", TAGK_STRING + "=" + TAGV_STRING })
214 .joinUninterruptibly();
215 validateCounters(1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
216 verify(chan, never()).write(any());
217 verify(chan, times(1)).isConnected();
218 validateSEH(true);
219 }
220
221 @Test
222 public void executePleaseThrottleHandler() throws Exception {

Callers

nothing calls this directly

Calls 7

fakeChannelMethod · 0.95
executeMethod · 0.95
putMethod · 0.80
getConfigMethod · 0.45
validateCountersMethod · 0.45
writeMethod · 0.45
validateSEHMethod · 0.45

Tested by

no test coverage detected