use of org.apache.knox.gateway.config.GatewayConfig in project knox by apache.
the class GatewayGlobalConfigTest method testForDefaultDataDir.
@Test
public void testForDefaultDataDir() {
String homeDirName = getHomeDirName("conf-site/conf/gateway-site.xml");
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
System.clearProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR);
GatewayConfig config = new GatewayConfigImpl();
assertTrue((homeDirName + File.separator + "data").equalsIgnoreCase(config.getGatewayDataDir()));
}
use of org.apache.knox.gateway.config.GatewayConfig in project knox by apache.
the class GatewayGlobalConfigTest method testDefaultTopologyName.
@Test(timeout = TestUtils.SHORT_TIMEOUT)
public void testDefaultTopologyName() {
GatewayConfig config = new GatewayConfigImpl();
assertThat(config.getDefaultTopologyName(), is(nullValue()));
((GatewayConfigImpl) config).set("default.app.topology.name", "test-topo-name");
assertThat(config.getDefaultTopologyName(), is("test-topo-name"));
}
use of org.apache.knox.gateway.config.GatewayConfig in project knox by apache.
the class GatewayGlobalConfigTest method testDefaultCompressGzipMimeTypes.
/**
* Test for the default Mime Types for Gzip compression.
*
* @since 0.12
*/
@Test
public void testDefaultCompressGzipMimeTypes() {
final List<String> expected = Arrays.asList("text/javascript", "text/html", "text/plain", "text/xml", "text/css", "application/javascript", "application/x-javascript");
String homeDirName = getHomeDirName("conf-site/conf/gateway-site.xml");
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, homeDirName);
System.setProperty(GatewayConfigImpl.GATEWAY_DATA_HOME_VAR, homeDirName);
GatewayConfig config = new GatewayConfigImpl();
assertTrue("Default MIME Types for Gzip compression failed to match", config.getMimeTypesToCompress().containsAll(expected));
}
use of org.apache.knox.gateway.config.GatewayConfig in project knox by apache.
the class GatewayGlobalConfigTest method testDemoConfig.
@Test
public void testDemoConfig() {
System.setProperty(GatewayConfigImpl.GATEWAY_HOME_VAR, getHomeDirName("conf-demo/conf/gateway-default.xml"));
GatewayConfig config = new GatewayConfigImpl();
assertThat(config.getGatewayPort(), is(8888));
assertTrue(config.getExcludedSSLProtocols().get(0).equals("SSLv3"));
// assertThat( config.getShiroConfigFile(), is( "full-shiro.ini") );
}
use of org.apache.knox.gateway.config.GatewayConfig in project knox by apache.
the class DeploymentFactoryTest method testEmptyTopology.
@Test(timeout = TestUtils.MEDIUM_TIMEOUT)
public void testEmptyTopology() throws IOException, SAXException, ParserConfigurationException, TransformerException {
GatewayConfig config = new GatewayConfigImpl();
Topology topology = new Topology();
topology.setName("test-topology");
EnterpriseArchive archive = DeploymentFactory.createDeployment(config, topology);
Document xml = XmlUtils.readXml(archive.get("/META-INF/topology.xml").getAsset().openStream());
assertThat(xml, hasXPath("/topology/gateway"));
assertThat(xml, hasXPath("/topology/name", equalTo("test-topology")));
}
Aggregations