Search in sources :

Example 1 with MyGatewayTransportFilter3

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);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) GatewayTransportFilter(org.apache.geode.cache.wan.GatewayTransportFilter) MyGatewayTransportFilter1(org.apache.geode.cache30.MyGatewayTransportFilter1) MyGatewayTransportFilter2(org.apache.geode.cache30.MyGatewayTransportFilter2) MyGatewayTransportFilter3(org.apache.geode.internal.cache.wan.MyGatewayTransportFilter3) GatewaySenderConfigurationException(org.apache.geode.internal.cache.wan.GatewaySenderConfigurationException) GatewaySenderException(org.apache.geode.internal.cache.wan.GatewaySenderException) IgnoredException(org.apache.geode.test.dunit.IgnoredException) MyGatewayTransportFilter4(org.apache.geode.internal.cache.wan.MyGatewayTransportFilter4) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest)

Aggregations

ArrayList (java.util.ArrayList)1 GatewayTransportFilter (org.apache.geode.cache.wan.GatewayTransportFilter)1 MyGatewayTransportFilter1 (org.apache.geode.cache30.MyGatewayTransportFilter1)1 MyGatewayTransportFilter2 (org.apache.geode.cache30.MyGatewayTransportFilter2)1 GatewaySenderConfigurationException (org.apache.geode.internal.cache.wan.GatewaySenderConfigurationException)1 GatewaySenderException (org.apache.geode.internal.cache.wan.GatewaySenderException)1 MyGatewayTransportFilter3 (org.apache.geode.internal.cache.wan.MyGatewayTransportFilter3)1 MyGatewayTransportFilter4 (org.apache.geode.internal.cache.wan.MyGatewayTransportFilter4)1 IgnoredException (org.apache.geode.test.dunit.IgnoredException)1 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)1 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)1 Test (org.junit.Test)1