use of com.datatorrent.stram.engine.TestNonOptionalOutportInputOperator in project apex-core by apache.
the class LogicalPlanTest method testPortConnectionValidation.
@Test
public void testPortConnectionValidation() {
TestNonOptionalOutportInputOperator input = dag.addOperator("input1", TestNonOptionalOutportInputOperator.class);
try {
dag.validate();
Assert.fail("should raise port not connected for input1.outputPort1");
} catch (ValidationException e) {
Assert.assertEquals("", "Output port connection required: input1.outport1", e.getMessage());
}
GenericTestOperator o1 = dag.addOperator("o1", GenericTestOperator.class);
dag.addStream("stream1", input.outport1, o1.inport1);
dag.validate();
// required input
dag.addOperator("counter", CounterOperator.class);
try {
dag.validate();
} catch (ValidationException e) {
Assert.assertEquals("", "Input port connection required: counter.countInputPort", e.getMessage());
}
}
Aggregations