use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class RowGeneratorDefinitionTest method testRuntimeInfo.
/**
* Checks the {@link RuntimeInfo} of the definition.
*/
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = def.getRuntimeInfo(ExecutionEngine.BEAM, null, ConnectorTopology.OUTGOING);
assertThat(runtimeInfo.getRuntimeClassName(), is("org.talend.components.localio.runtime.rowgenerator.RowGeneratorRuntime"));
// The integration module tests things that aren't available in the RuntimeInfo module until after it is
// installed in the local maven repository.
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class SalesforceBulkExecReaderTestIT method executeBulkInsert.
/**
* Test runtime of tSalesforceOutputBulk
*/
private void executeBulkInsert(TSalesforceBulkExecProperties bulkExecProperties, String random, int count) throws Throwable {
TSalesforceBulkExecDefinition definition = (TSalesforceBulkExecDefinition) getComponentService().getComponentDefinition(TSalesforceBulkExecDefinition.COMPONENT_NAME);
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, bulkExecProperties, ConnectorTopology.OUTGOING);
try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, definition.getClass().getClassLoader())) {
SalesforceSource boundedSource = (SalesforceSource) sandboxedInstance.getInstance();
boundedSource.initialize(null, bulkExecProperties);
BoundedReader boundedReader = boundedSource.createReader(null);
try {
boolean hasRecord = boundedReader.start();
List<IndexedRecord> rows = new ArrayList<>();
while (hasRecord) {
rows.add((IndexedRecord) boundedReader.getCurrent());
hasRecord = boundedReader.advance();
}
checkRows(random, rows, count);
} finally {
boundedReader.close();
}
}
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class TSalesforceInputDefinitionTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.OUTGOING);
assertRuntimeInfo(runtimeInfo);
runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.NONE);
assertThat(runtimeInfo, nullValue(RuntimeInfo.class));
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class SalesforceDatasetDefinitionTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(properties);
assertRuntimeInfo(runtimeInfo);
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class TSalesforceBulkExecDefinitionTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.OUTGOING);
assertRuntimeInfo(runtimeInfo, SOURCE_CLASS);
runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.NONE);
assertRuntimeInfo(runtimeInfo, BULK_EXEC_RUNTIME_CLASS);
runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.INCOMING);
assertThat(runtimeInfo, nullValue(RuntimeInfo.class));
}
Aggregations