enqueue batch_size + 1 messages . shutdown the runnable . without passing time , assert that the runnable sends all data and isshutdown returns false until all data is sent . concode_field_sep int FLUSH_SIZE concode_elem_sep CWPublisherRunnable<CWMetricKey> runnable concode_elem_sep long time concode_elem_sep int counter concode_elem_sep List<MetricDatumWithKey<CWMetricKey>> data concode_elem_sep TestHarness harness concode_elem_sep ICWMetricsPublisher<CWMetricKey> publisher concode_elem_sep int MAX_QUEUE_SIZE concode_elem_sep long MAX_BUFFER_TIME_MILLIS concode_field_sep void runAndAssertAllData concode_elem_sep void testQueueFullDropData concode_elem_sep void runAndAssert concode_elem_sep void passTime concode_elem_sep void testDrainQueue concode_elem_sep void testWaitForBatchTimeout concode_elem_sep CWPublisherRunnable<CWMetricKey> getRunnable concode_elem_sep void setup concode_elem_sep void enqueueRandom concode_elem_sep void testPublishOnFlushSize concode_elem_sep MetricDatumWithKey<CWMetricKey> constructDatum
void function ( ) { harness . enqueueRandom ( FLUSH_SIZE + 1 ) ; harness . getRunnable ( ) . shutdown ( ) ; harness . runAndAssert ( 0 , FLUSH_SIZE ) ; Assert . assertFalse ( harness . getRunnable ( ) . isShutdown ( ) ) ; harness . runAndAssert ( FLUSH_SIZE , 1 ) ; Assert . assertTrue ( harness . getRunnable ( ) . isShutdown ( ) ) ; }