AbstractLauncher implements Runnable { public String getMemberId() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return distributedSystem != null ? distributedSystem.getMemberId() : 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 getMemberIdReturnsValue() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, "123"); assertThat(launcher.getMemberId()).isEqualTo("123"); }
@Test public void getMemberIdReturnsNullIfNull() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, null); assertThat(launcher.getMemberId()).isNull(); }
@Test public void getMemberIdReturnsEmptyIfEmpty() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, StringUtils.EMPTY); assertThat(launcher.getMemberId()).isEqualTo(StringUtils.EMPTY); }
@Test public void getMemberIdReturnsBlankIfBlank() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, " "); assertThat(launcher.getMemberId()).isEqualTo(" "); }
@Test public void getMemberIdReturnsSameNumberOfBlanks() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(null, " "); assertThat(launcher.getMemberId()).isEqualTo(" "); }