use of org.apache.geode.internal.cache.wan.Filter70 in project geode by apache.
the class WanValidationsDUnitTest method testGatewayEventFilters.
@Test
public void testGatewayEventFilters() {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
createCacheInVMs(lnPort, vm1, vm2);
ArrayList<GatewayEventFilter> eventFilters = new ArrayList<GatewayEventFilter>();
eventFilters.add(new MyGatewayEventFilter());
vm1.invoke(() -> WANTestBase.createSenderForValidations("ln", 2, false, 100, false, false, eventFilters, null, true, false));
try {
eventFilters.clear();
eventFilters.add(new Filter70());
vm2.invoke(() -> WANTestBase.createSenderForValidations("ln", 2, false, 100, false, false, eventFilters, null, true, false));
fail("Expected IllegalStateException : GatewayEventFilters Should match");
} catch (Exception e) {
if (!(e.getCause() instanceof IllegalStateException) || !(e.getCause().getMessage().contains("because another cache has the same Gateway Sender defined with GatewayEventFilters"))) {
Assert.fail("Expected IllegalStateException", e);
}
}
}
use of org.apache.geode.internal.cache.wan.Filter70 in project geode by apache.
the class WanValidationsDUnitTest method testGatewayEventFilters2.
@Test
public void testGatewayEventFilters2() {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
createCacheInVMs(lnPort, vm1, vm2);
ArrayList<GatewayEventFilter> eventFilters = new ArrayList<GatewayEventFilter>();
eventFilters.add(new MyGatewayEventFilter());
vm1.invoke(() -> WANTestBase.createSenderForValidations("ln", 2, false, 100, false, false, eventFilters, null, true, false));
try {
eventFilters.clear();
eventFilters.add(new MyGatewayEventFilter());
eventFilters.add(new Filter70());
vm2.invoke(() -> WANTestBase.createSenderForValidations("ln", 2, false, 100, false, false, eventFilters, null, true, false));
fail("Expected IllegalStateException : GatewayEventFilters Should match");
} catch (Exception e) {
if (!(e.getCause() instanceof IllegalStateException) || !(e.getCause().getMessage().contains("because another cache has the same Gateway Sender defined with GatewayEventFilters"))) {
Assert.fail("Expected IllegalStateException", e);
}
}
}
Aggregations