use of org.apache.ignite.cache.CacheEntryEventSerializableFilter in project ignite by apache.
the class GridP2PContinuousDeploymentClientDisconnectTest method testContinuousQueryRemoteFilter.
/**
* Test starts 1 server node and 1 client node. Class-loading request for the {@link #P2P_TEST_OBJ_RSRC_NAME}
* resource blocks on the client node. The client node tries to deploy CQ with remote filter for
* the cache {@link #DEFAULT_CACHE_NAME}.
* Expected that exception with 'Failed to unmarshal deployable object.' error message will be thrown and
* the server node wouldn't be failed.
*
* @throws Exception If failed.
*/
@Test
public void testContinuousQueryRemoteFilter() throws Exception {
final Class<CacheEntryEventSerializableFilter<Integer, Integer>> rmtFilterCls = (Class<CacheEntryEventSerializableFilter<Integer, Integer>>) getExternalClassLoader().loadClass(REMOTE_FILTER_CLS_NAME);
ContinuousQuery<Integer, Integer> qry = new ContinuousQuery<Integer, Integer>().setLocalListener(evts -> {
// No-op.
}).setRemoteFilter(rmtFilterCls.newInstance());
IgniteEx client = grid(1);
LogListener lsnr = LogListener.matches("Failed to unmarshal deployable object.").build();
testLog.registerListener(lsnr);
IgniteCache<Integer, Integer> cache = client.cache(DEFAULT_CACHE_NAME);
assertThrowsWithCause(() -> cache.query(qry), CacheException.class);
assertTrue(lsnr.check());
// Check that the failure handler was not called.
assertFalse(failure.get());
}
Aggregations