/** * Gets an <code>URL</code> for the security properties file, if one can be found, that the * connect method will use as its properties file. * <p> * See {@link #SECURITY_PROPERTIES_FILE_PROPERTY} for information on the name of the properties * file and what locations it will be looked for in. * * @return a <code>URL</code> that names the GemFire security properties file. Null is returned if * no properties file was found. * @see #SECURITY_PROPERTIES_FILE_PROPERTY * @see #SECURITY_PROPERTIES_FILE_DEFAULT * @see #getSecurityPropertiesFile() * @since GemFire 6.6.2 */ public static URL getSecurityPropertiesFileURL() { return getFileURL(getSecurityPropertiesFile()); }
@Test public void getSecurityPropertiesFileShouldUseSystemPropertyPath() throws Exception { String propertiesFileName = "/home/testsecurity.properties"; System.setProperty(DistributedSystem.SECURITY_PROPERTIES_FILE_PROPERTY, propertiesFileName); assertThat(DistributedSystem.getSecurityPropertiesFile()).isEqualTo(propertiesFileName); } }
@Test public void getSecurityPropertiesFileShouldUseDefault() throws Exception { assertThat(DistributedSystem.getSecurityPropertiesFile()) .isEqualTo(DistributedSystem.SECURITY_PROPERTIES_FILE_DEFAULT); }
@Test public void getSecurityPropertiesFileShouldUseSystemProperty() throws Exception { String propertiesFileName = "testsecurity.properties"; System.setProperty(DistributedSystem.SECURITY_PROPERTIES_FILE_PROPERTY, propertiesFileName); assertThat(DistributedSystem.getSecurityPropertiesFile()).isEqualTo(propertiesFileName); }