use of org.apache.ignite.IgniteDataStreamerTimeoutException in project ignite by apache.
the class DataStreamerTimeoutTest method testTimeoutOnCloseMethod.
/**
* Test timeout on {@code DataStreamer.addData()} method
* @throws Exception If fail.
*/
@Test
public void testTimeoutOnCloseMethod() throws Exception {
failOn = 1;
Ignite ignite = startGrid(1);
boolean thrown = false;
try (IgniteDataStreamer ldr = ignite.dataStreamer(CACHE_NAME)) {
ldr.timeout(TIMEOUT);
ldr.receiver(new TestDataReceiver());
ldr.perNodeBufferSize(ENTRY_AMOUNT);
for (int i = 0; i < ENTRY_AMOUNT; i++) ldr.addData(i, i);
} catch (CacheException | IgniteDataStreamerTimeoutException ignored) {
thrown = true;
} finally {
stopAllGrids();
}
assertTrue(thrown);
}
Aggregations