/** * Fails on the 1001st time. */ @Test public void testMultipleExecutionsWithoutListeners() { checkLoop(1001); }
/** * Now, our test will fail on the first message added after our safety * message listener has been removed. */ @Test public void testSingleExecutionWithoutListeners() { checkLoop(1); }
/** * This is the workaround- as long as we keep a message listener in * the stack, our FIFO bug isn't exposed. Comment above out to see. */ @Test public void testOneListener() { Ignite ignite = G.ignite(getTestIgniteInstanceName()); final AtomicBoolean stop = new AtomicBoolean(); P2<UUID, Object> l = new P2<UUID, Object>() { @Override public boolean apply(UUID uuid, Object o) { return stop.get(); } }; try { ignite.message().localListen(null, l); checkLoop(2000); } finally { stop.set(true); } }