AbstractLauncher implements Runnable { protected static Properties loadGemFireProperties(final URL url) { if (url == null) { return new Properties(); } Properties properties = new Properties(); try { properties.load(new FileReader(new File(url.toURI()))); } catch (IOException | URISyntaxException handled) { loadGemFirePropertiesFromClassPath(properties); } return properties; } 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 loadGemFirePropertiesWithNullURLReturnsEmptyProperties() throws Exception { URL nullUrl = null; Properties properties = AbstractLauncher.loadGemFireProperties(nullUrl); assertThat(properties).isNotNull().isEmpty(); }
@Test public void loadGemFirePropertiesWithNonExistingURLReturnsEmptyProperties() throws Exception { URL nonExistingUrl = new URL("file: Properties properties = AbstractLauncher.loadGemFireProperties(nonExistingUrl); assertThat(properties).isNotNull().isEmpty(); }