use of org.apache.knox.gateway.config.impl.GatewayConfigImpl in project knox by apache.
the class GatewayGlobalConfigTest method testStacksServicesDir.
@Test
public void testStacksServicesDir() {
System.clearProperty(GatewayConfigImpl.GATEWAY_HOME_VAR);
GatewayConfig config = new GatewayConfigImpl();
assertThat(config.getGatewayServicesDir(), Matchers.endsWith("data" + File.separator + "services"));
String homeDirName = getHomeDirName("conf-demo/conf/gateway-site.xml");
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
config = new GatewayConfigImpl();
assertEquals("target/test", config.getGatewayServicesDir());
}
use of org.apache.knox.gateway.config.impl.GatewayConfigImpl in project knox by apache.
the class GatewayGlobalConfigTest method testDataDirSetAsBothSystemPropertyAndConfig.
/**
* When data dir is set at both system property and configuration level , then system property
* value should be considered
*/
@Test
public void testDataDirSetAsBothSystemPropertyAndConfig() {
String homeDirName = getHomeDirName("conf-demo/conf/gateway-site.xml");
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
System.setProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR, homeDirName + File.separator + "DataDirSystemProperty");
GatewayConfig config = new GatewayConfigImpl();
assertTrue((homeDirName + File.separator + "DataDirSystemProperty").equalsIgnoreCase(config.getGatewayDataDir()));
}
use of org.apache.knox.gateway.config.impl.GatewayConfigImpl in project knox by apache.
the class GatewayGlobalConfigTest method testForUpdatedSecurityDataDir.
@Test
public void testForUpdatedSecurityDataDir() {
String homeDirName = getHomeDirName("conf-demo/conf/gateway-site.xml");
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
System.setProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR, homeDirName);
GatewayConfig config = new GatewayConfigImpl();
assertTrue(("target/test").equalsIgnoreCase(config.getGatewaySecurityDir()));
}
use of org.apache.knox.gateway.config.impl.GatewayConfigImpl in project knox by apache.
the class GatewayGlobalConfigTest method testEmptyConfig.
@Test
public void testEmptyConfig() {
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, getHomeDirName("conf-empty/conf/empty"));
GatewayConfig config = new GatewayConfigImpl();
assertThat(config.getGatewayPort(), is(8888));
// assertThat( config.getShiroConfigFile(), is( "shiro.ini") );
}
use of org.apache.knox.gateway.config.impl.GatewayConfigImpl in project knox by apache.
the class GatewayGlobalConfigTest method testForDataDirSetAsSystemProperty.
@Test
public void testForDataDirSetAsSystemProperty() {
String homeDirName = getHomeDirName("conf-demo/conf/gateway-site.xml");
System.setProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR, homeDirName + File.separator + "DataDirSystemProperty");
GatewayConfig config = new GatewayConfigImpl();
assertTrue((homeDirName + File.separator + "DataDirSystemProperty").equalsIgnoreCase(config.getGatewayDataDir()));
}
Aggregations