use of org.apache.storm.flux.model.TopologyDef in project storm by apache.
the class TCKTest method testVariableSubstitution.
@Test
public void testVariableSubstitution() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/substitution-test.yaml", false, true, "src/test/resources/configs/test.properties", true);
assertTrue(topologyDef.validate());
Config conf = FluxBuilder.buildConfig(topologyDef);
ExecutionContext context = new ExecutionContext(topologyDef, conf);
StormTopology topology = FluxBuilder.buildTopology(context);
assertNotNull(topology);
topology.validate();
// test basic substitution
assertEquals("Property not replaced.", "substitution-topology", context.getTopologyDef().getName());
// test environment variable substitution
// $PATH should be defined on most systems
String envPath = System.getenv().get("PATH");
assertEquals("ENV variable not replaced.", envPath, context.getTopologyDef().getConfig().get("test.env.value"));
}
use of org.apache.storm.flux.model.TopologyDef in project storm by apache.
the class TCKTest method testKafkaSpoutConfig.
@Test
public void testKafkaSpoutConfig() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/kafka_test.yaml", false, true, null, false);
Config conf = FluxBuilder.buildConfig(topologyDef);
ExecutionContext context = new ExecutionContext(topologyDef, conf);
StormTopology topology = FluxBuilder.buildTopology(context);
assertNotNull(topology);
topology.validate();
}
use of org.apache.storm.flux.model.TopologyDef in project storm by apache.
the class TCKTest method testShellComponents.
@Test
public void testShellComponents() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/shell_test.yaml", false, true, null, false);
Config conf = FluxBuilder.buildConfig(topologyDef);
ExecutionContext context = new ExecutionContext(topologyDef, conf);
StormTopology topology = FluxBuilder.buildTopology(context);
assertNotNull(topology);
topology.validate();
}
use of org.apache.storm.flux.model.TopologyDef in project storm by apache.
the class TCKTest method testHdfs.
@Test
public void testHdfs() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/hdfs_test.yaml", false, true, null, false);
Config conf = FluxBuilder.buildConfig(topologyDef);
ExecutionContext context = new ExecutionContext(topologyDef, conf);
StormTopology topology = FluxBuilder.buildTopology(context);
assertNotNull(topology);
topology.validate();
}
use of org.apache.storm.flux.model.TopologyDef in project storm by apache.
the class TCKTest method testBadHbase.
@Test(expected = IllegalArgumentException.class)
public void testBadHbase() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/bad_hbase.yaml", false, true, null, false);
Config conf = FluxBuilder.buildConfig(topologyDef);
ExecutionContext context = new ExecutionContext(topologyDef, conf);
StormTopology topology = FluxBuilder.buildTopology(context);
assertNotNull(topology);
topology.validate();
}
Aggregations