Search in sources :

Example 1 with GMSJoinLeave

use of org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave in project geode by apache.

the class MembershipJUnitTest method testMulticastDiscoveryNotAllowed.

@Test
public void testMulticastDiscoveryNotAllowed() {
    Properties nonDefault = new Properties();
    nonDefault.put(DISABLE_TCP, "true");
    nonDefault.put(MCAST_PORT, "12345");
    nonDefault.put(LOG_FILE, "");
    nonDefault.put(LOG_LEVEL, "fine");
    nonDefault.put(LOCATORS, "");
    DistributionConfigImpl config = new DistributionConfigImpl(nonDefault);
    RemoteTransportConfig transport = new RemoteTransportConfig(config, DistributionManager.NORMAL_DM_TYPE);
    ServiceConfig serviceConfig = mock(ServiceConfig.class);
    when(serviceConfig.getDistributionConfig()).thenReturn(config);
    when(serviceConfig.getTransport()).thenReturn(transport);
    Services services = mock(Services.class);
    when(services.getConfig()).thenReturn(serviceConfig);
    GMSJoinLeave joinLeave = new GMSJoinLeave();
    try {
        joinLeave.init(services);
        throw new Error("expected a GemFireConfigException to be thrown because no locators are configured");
    } catch (GemFireConfigException e) {
    // expected
    }
}
Also used : Services(org.apache.geode.distributed.internal.membership.gms.Services) ServiceConfig(org.apache.geode.distributed.internal.membership.gms.ServiceConfig) GemFireConfigException(org.apache.geode.GemFireConfigException) GMSJoinLeave(org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave) RemoteTransportConfig(org.apache.geode.internal.admin.remote.RemoteTransportConfig) ConfigurationProperties(org.apache.geode.distributed.ConfigurationProperties) Properties(java.util.Properties) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Aggregations

Properties (java.util.Properties)1 GemFireConfigException (org.apache.geode.GemFireConfigException)1 ConfigurationProperties (org.apache.geode.distributed.ConfigurationProperties)1 ServiceConfig (org.apache.geode.distributed.internal.membership.gms.ServiceConfig)1 Services (org.apache.geode.distributed.internal.membership.gms.Services)1 GMSJoinLeave (org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave)1 RemoteTransportConfig (org.apache.geode.internal.admin.remote.RemoteTransportConfig)1 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)1 Test (org.junit.Test)1