AbstractLauncher implements Runnable { protected Properties getDistributedSystemProperties() { return getDistributedSystemProperties(null); } AbstractLauncher(); boolean isDebugging(); void setDebug(final boolean debug); boolean isRunning(); abstract String getLogFileName(); String getMember(); String getMemberId(); String getMemberName(); abstract Integer getPid(); abstract String getServiceName(); String getWorkingDirectory(); String version(); static final String MEMBER_NAME_ERROR_MESSAGE; static final String WORKING_DIRECTORY_OPTION_NOT_VALID_ERROR_MESSAGE; static final String WORKING_DIRECTORY_NOT_FOUND_ERROR_MESSAGE; static final String DEFAULT_WORKING_DIRECTORY; static final String SIGNAL_HANDLER_REGISTRATION_SYSTEM_PROPERTY; }
@Test public void getDistributedSystemPropertiesContainsMemberNameAsName() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher("memberOne", "1"); Properties properties = launcher.getDistributedSystemProperties(); assertThat(properties).containsExactly(entry(NAME, "memberOne")); }
@Test public void getDistributedSystemPropertiesIsEmptyWhenMemberNameIsNull() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, "22"); 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 getDistributedSystemPropertiesIsEmptyWhenMemberNameIsBlank() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(" ", "4444"); Properties properties = launcher.getDistributedSystemProperties(); assertThat(properties).isEmpty(); }