use of io.cdap.cdap.etl.proto.v2.ETLConfig in project cdap by caskdata.
the class PipelineSpecGeneratorTest method testConflictingInputSchemas.
@Test(expected = IllegalArgumentException.class)
public void testConflictingInputSchemas() throws ValidationException {
/*
* ---- transformA ----
* | |
* source --- |--- sink
* | |
* ---- transformB ----
*
* sink gets schema A and schema B as input, should fail
*/
ETLBatchConfig etlConfig = ETLBatchConfig.builder().setTimeSchedule("* * * * *").addStage(new ETLStage("source", MOCK_SOURCE)).addStage(new ETLStage("sink", MOCK_SINK)).addStage(new ETLStage("tA", MOCK_TRANSFORM_A)).addStage(new ETLStage("tB", MOCK_TRANSFORM_B)).addConnection("source", "tA").addConnection("source", "tB").addConnection("tA", "sink").addConnection("tB", "sink").build();
specGenerator.generateSpec(etlConfig);
}
use of io.cdap.cdap.etl.proto.v2.ETLConfig in project cdap by caskdata.
the class PipelineSpecGeneratorTest method testDeadEndStage.
@Test(expected = IllegalArgumentException.class)
public void testDeadEndStage() throws ValidationException {
ETLBatchConfig etlConfig = ETLBatchConfig.builder().setTimeSchedule("* * * * *").addStage(new ETLStage("source", MOCK_SOURCE)).addStage(new ETLStage("sink", MOCK_SINK)).addStage(new ETLStage("transform", MOCK_TRANSFORM_A)).addConnection("source", "sink").addConnection("source", "transform").build();
specGenerator.generateSpec(etlConfig);
}
use of io.cdap.cdap.etl.proto.v2.ETLConfig in project cdap by caskdata.
the class PipelineSpecGeneratorTest method testNestedConditionWithCrossConnection.
@Test(expected = IllegalArgumentException.class)
public void testNestedConditionWithCrossConnection() throws ValidationException {
//
// anothersource-------------
// |
// source--condition1-----t1-----condition2------t11------sink1
// | | |
// | |-----------t12--------
// t2---------sink2
ETLBatchConfig etlConfig = ETLBatchConfig.builder().setTimeSchedule("* * * * *").addStage(new ETLStage("source", MOCK_SOURCE)).addStage(new ETLStage("anothersource", MOCK_SOURCE)).addStage(new ETLStage("condition1", MOCK_CONDITION)).addStage(new ETLStage("condition2", MOCK_CONDITION)).addStage(new ETLStage("t1", MOCK_TRANSFORM_A)).addStage(new ETLStage("t11", MOCK_TRANSFORM_A)).addStage(new ETLStage("t12", MOCK_TRANSFORM_A)).addStage(new ETLStage("t2", MOCK_TRANSFORM_B)).addStage(new ETLStage("sink1", MOCK_SINK)).addStage(new ETLStage("sink2", MOCK_SINK)).addConnection("source", "condition1").addConnection("condition1", "t1", true).addConnection("t1", "condition2").addConnection("condition2", "t11", false).addConnection("condition2", "t12", true).addConnection("condition1", "t2", false).addConnection("t11", "sink1").addConnection("t12", "sink1").addConnection("anothersource", "sink1").addConnection("t2", "sink2").build();
specGenerator.generateSpec(etlConfig);
}
use of io.cdap.cdap.etl.proto.v2.ETLConfig in project cdap by caskdata.
the class PipelineSpecGeneratorTest method testConnectionWithMissingStage.
@Test(expected = IllegalArgumentException.class)
public void testConnectionWithMissingStage() throws ValidationException {
ETLBatchConfig etlConfig = ETLBatchConfig.builder().setTimeSchedule("* * * * *").addStage(new ETLStage("source", MOCK_SOURCE)).addStage(new ETLStage("sink", MOCK_SINK)).addConnection("source", "sink").addConnection("source", "stage2").build();
specGenerator.generateSpec(etlConfig);
}
use of io.cdap.cdap.etl.proto.v2.ETLConfig in project cdap by caskdata.
the class PipelineSpecGeneratorTest method testConflictingInputErrorSchemas.
@Test(expected = IllegalArgumentException.class)
public void testConflictingInputErrorSchemas() throws ValidationException {
/*
* ---- transformA
* | |
* source ---| |------- error -- sink
* | |
* ---- transformB
*
* error gets schema B from transformA and schema A from transformB, should fail
*/
ETLBatchConfig etlConfig = ETLBatchConfig.builder().setTimeSchedule("* * * * *").addStage(new ETLStage("source", MOCK_SOURCE)).addStage(new ETLStage("sink", MOCK_SINK)).addStage(new ETLStage("tA", MOCK_TRANSFORM_A)).addStage(new ETLStage("tB", MOCK_TRANSFORM_B)).addStage(new ETLStage("error", MOCK_ERROR)).addConnection("source", "tA").addConnection("source", "tB").addConnection("tA", "error").addConnection("tB", "error").addConnection("error", "sink").build();
specGenerator.generateSpec(etlConfig);
}
Aggregations