AbstractLauncher implements Runnable { public String getMemberName() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return distributedSystem != null ? distributedSystem.getConfig().getName() : 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 getMemberNameReturnsValue() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher("memberOne", null); assertThat(launcher.getMemberName()).isEqualTo("memberOne"); }
@Test public void getMemberNameReturnsEmptyIfEmpty() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(StringUtils.EMPTY, null); assertThat(launcher.getMemberName()).isEqualTo(StringUtils.EMPTY); }
@Test public void getMemberNameReturnsBlankIfBlank() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(" ", null); assertThat(launcher.getMemberName()).isEqualTo(" "); }
@Test public void getMemberNameReturnsSameNumberOfBlanks() throws Exception { AbstractLauncher<?> launcher = createAbstractLauncher(" ", null); assertThat(launcher.getMemberName()).isEqualTo(" "); }