use of org.apache.storm.generated.StormTopology in project storm by apache.
the class TCKTest method testTopologySourceWithMethodName.
@Test
public void testTopologySourceWithMethodName() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/existing-topology-method-override.yaml", false, true, null, false);
assertTrue(topologyDef.validate());
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.generated.StormTopology in project storm by apache.
the class TCKTest method testTopologySourceWithReflection.
@Test
public void testTopologySourceWithReflection() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/existing-topology-reflection.yaml", false, true, null, false);
assertTrue(topologyDef.validate());
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.generated.StormTopology in project storm by apache.
the class TCKTest method testTCK.
@Test
public void testTCK() throws Exception {
TopologyDef topologyDef = FluxParser.parseResource("/configs/tck.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.generated.StormTopology 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.generated.StormTopology 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();
}
Aggregations