Search in sources :

Example 1 with AsyncEventQueueTestBase

use of org.apache.geode.internal.cache.wan.AsyncEventQueueTestBase in project geode by apache.

the class AsyncEventListenerDUnitTest method testCreateAsyncEventQueueWithNullListener.

/**
   * Test to verify that AsyncEventQueue can not be created when null listener is passed.
   */
@Test
public void testCreateAsyncEventQueueWithNullListener() {
    AsyncEventQueueTestBase test = new AsyncEventQueueTestBase();
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    InternalDistributedSystem ds = test.getSystem(props);
    cache = CacheFactory.create(ds);
    AsyncEventQueueFactory asyncQueueFactory = cache.createAsyncEventQueueFactory();
    try {
        asyncQueueFactory.create("testId", null);
        fail("AsyncQueueFactory should not allow to create AsyncEventQueue with null listener");
    } catch (IllegalArgumentException e) {
    // expected
    }
}
Also used : AsyncEventQueueFactory(org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory) AsyncEventQueueTestBase(org.apache.geode.internal.cache.wan.AsyncEventQueueTestBase) InternalDistributedSystem(org.apache.geode.distributed.internal.InternalDistributedSystem) ConfigurationProperties(org.apache.geode.distributed.ConfigurationProperties) Properties(java.util.Properties) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Aggregations

Properties (java.util.Properties)1 AsyncEventQueueFactory (org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory)1 ConfigurationProperties (org.apache.geode.distributed.ConfigurationProperties)1 InternalDistributedSystem (org.apache.geode.distributed.internal.InternalDistributedSystem)1 AsyncEventQueueTestBase (org.apache.geode.internal.cache.wan.AsyncEventQueueTestBase)1 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)1 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)1 Test (org.junit.Test)1