AbstractLauncher implements Runnable { protected static boolean isSet(final Properties properties, final String propertyName) { return isNotBlank(properties.getProperty(propertyName)); } 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 isSetReturnsFalseIfPropertyDoesNotExist() throws Exception { assertThat(AbstractLauncher.isSet(new Properties(), NAME)).isFalse(); }
@Test public void isSetReturnsFalseIfPropertyHasEmptyValue() throws Exception { Properties properties = new Properties(); properties.setProperty(NAME, ""); assertThat(AbstractLauncher.isSet(properties, NAME)).isFalse(); }
@Test public void isSetReturnsFalseIfPropertyHasBlankValue() throws Exception { Properties properties = new Properties(); properties.setProperty(NAME, " "); assertThat(AbstractLauncher.isSet(properties, NAME)).isFalse(); }
@Test public void isSetReturnsTrueIfPropertyHasRealValue() throws Exception { Properties properties = new Properties(); properties.setProperty(NAME, "memberOne"); assertThat(AbstractLauncher.isSet(properties, NAME)).isTrue(); }
@Test public void isSetKeyIsCaseSensitive() throws Exception { Properties properties = new Properties(); properties.setProperty(NAME, "memberOne"); assertThat(AbstractLauncher.isSet(properties, "NaMe")).isFalse(); }