use of org.apache.geode.internal.cache.wan.MyGatewayTransportFilter3 in project geode by apache.
the class WanValidationsDUnitTest method testGatewayTransportFilters.
@Test
public void testGatewayTransportFilters() {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
createCacheInVMs(lnPort, vm1, vm2);
ArrayList<GatewayTransportFilter> transportFilters = new ArrayList<GatewayTransportFilter>();
transportFilters.add(new MyGatewayTransportFilter1());
transportFilters.add(new MyGatewayTransportFilter2());
vm1.invoke(() -> WANTestBase.createSenderForValidations("ln", 2, false, 100, false, false, null, transportFilters, true, false));
try {
transportFilters.clear();
transportFilters.add(new MyGatewayTransportFilter3());
transportFilters.add(new MyGatewayTransportFilter4());
vm2.invoke(() -> WANTestBase.createSenderForValidations("ln", 2, false, 100, false, false, null, transportFilters, 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 GatewayTransportFilters"))) {
Assert.fail("Expected IllegalStateException", e);
}
}
}
Aggregations