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
}
}
Aggregations