use of org.talend.components.jdbc.dataprep.JDBCInputDefinition in project components by Talend.
the class JdbcInputOutputRuntimeTest method testBasic.
@Test
public void testBasic() {
JDBCInputProperties inputProperties = new JDBCInputProperties("input");
inputProperties.init();
inputProperties.setDatasetProperties(JdbcDatasetRuntimeTest.createDatasetProperties());
JDBCInputDefinition inputDefinition = new JDBCInputDefinition();
RuntimeInfo inputRI = inputDefinition.getRuntimeInfo(ExecutionEngine.BEAM, inputProperties, ConnectorTopology.OUTGOING);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(inputRI, getClass().getClassLoader())) {
assertThat(si.getInstance().getClass().getCanonicalName(), is(JDBCInputDefinition.BEAM_RUNTIME));
}
inputRI = inputDefinition.getRuntimeInfo(ExecutionEngine.DI, inputProperties, ConnectorTopology.OUTGOING);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(inputRI, getClass().getClassLoader())) {
assertThat(si.getInstance().getClass().getCanonicalName(), is(JDBCInputDefinition.DI_RUNTIME));
}
JDBCOutputProperties outputProperties = new JDBCOutputProperties("output");
outputProperties.init();
outputProperties.setDatasetProperties(JdbcDatasetRuntimeTest.createDatasetProperties());
JDBCOutputDefinition outputDefinition = new JDBCOutputDefinition();
RuntimeInfo outputRI = outputDefinition.getRuntimeInfo(ExecutionEngine.BEAM, outputProperties, ConnectorTopology.INCOMING);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(outputRI, getClass().getClassLoader())) {
assertThat(si.getInstance().getClass().getCanonicalName(), is(JDBCOutputDefinition.BEAM_RUNTIME));
}
}
Aggregations