/** * Creates a Properties object with configuration settings that the launcher has that should take * precedence over anything the user has defined in their gemfire properties file. * * @return a Properties object with GemFire properties that the launcher has defined. * @see #getDistributedSystemProperties(java.util.Properties) * @see java.util.Properties */ protected Properties getDistributedSystemProperties() { return getDistributedSystemProperties(null); }
@Override protected Properties getDistributedSystemProperties() { return super.getDistributedSystemProperties(getProperties()); }
@Test public void getDistributedSystemPropertiesIncludesDefaults() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher("TestMember", "123"); Properties defaults = new Properties(); defaults.setProperty("testKey", "testValue"); Properties properties = launcher.getDistributedSystemProperties(defaults); assertThat(properties.getProperty(NAME)).isEqualTo(launcher.getMemberName()); assertThat(properties.getProperty("testKey")).isEqualTo("testValue"); }
@Test public void getDistributedSystemPropertiesIsEmptyWhenMemberNameIsNull() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, "22"); Properties properties = launcher.getDistributedSystemProperties(); assertThat(properties).isEmpty(); }
@Test public void getDistributedSystemPropertiesIsEmptyWhenMemberNameIsBlank() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(" ", "4444"); Properties properties = launcher.getDistributedSystemProperties(); assertThat(properties).isEmpty(); }
@Test public void getDistributedSystemPropertiesIsEmptyWhenMemberNameIsEmpty() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(StringUtils.EMPTY, "333"); Properties properties = launcher.getDistributedSystemProperties(); assertThat(properties).isEmpty(); }
@Test public void getDistributedSystemPropertiesContainsMemberNameAsName() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher("memberOne", "1"); Properties properties = launcher.getDistributedSystemProperties(); assertThat(properties).containsExactly(entry(NAME, "memberOne")); }