use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class TSalesforceOutputBulkDefinitionTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.INCOMING);
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 TSalesforceOutputBulkExecDefinitionTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
assertThat(runtimeInfo, nullValue(RuntimeInfo.class));
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class ComponentServiceTest method testGetRuntimeInfo.
@Test
public void testGetRuntimeInfo() throws MalformedURLException {
// check the comp def return the proper stream for the pom
RuntimeInfo runtimeInfo = getComponentService().getRuntimeInfo(TestComponentDefinition.COMPONENT_NAME, ExecutionEngine.DI, null, null);
assertEquals(5, runtimeInfo.getMavenUrlDependencies().size());
assertThat(runtimeInfo.getMavenUrlDependencies(), containsInAnyOrder(//
new URL("mvn:org.apache.maven/maven-core/3.3.3/jar"), //
new URL("mvn:org.eclipse.sisu/org.eclipse.sisu.plexus/0.0.0.M2a/jar"), //
new URL("mvn:org.apache.maven/maven-artifact/3.3.3/jar"), //
new URL("mvn:org.eclipse.aether/aether-transport-file/1.0.0.v20140518/jar"), //
new URL("mvn:org.talend.components/file-input/0.1.0.SNAPSHOT/jar")));
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class SandboxedFixedInputRuntimeTest method testDatasetGetSample.
@Test
public void testDatasetGetSample() throws Exception {
// The two records to use as values.
GenericRecord r1 = new GenericData.Record(SampleSchemas.recordSimple());
r1.put("id", 1);
r1.put("name", "one");
GenericRecord r2 = new GenericData.Record(SampleSchemas.recordSimple());
r2.put("id", 2);
r2.put("name", "two");
final FixedDatasetProperties props = createComponentProperties().getDatasetProperties();
props.format.setValue(FixedDatasetProperties.RecordFormat.AVRO);
props.schema.setValue(SampleSchemas.recordSimple().toString());
props.values.setValue(r1.toString() + r2.toString());
final List<IndexedRecord> consumed = new ArrayList<>();
RuntimeInfo ri = new FixedDatasetDefinition().getRuntimeInfo(props);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(ri, getClass().getClassLoader())) {
DatasetRuntime<FixedDatasetProperties> runtime = (DatasetRuntime<FixedDatasetProperties>) si.getInstance();
runtime.initialize(null, props);
// The functionality of the runtime is tested in its own module.
runtime.getSample(100, new Consumer<IndexedRecord>() {
@Override
public void accept(IndexedRecord ir) {
consumed.add(ir);
}
});
}
assertThat(consumed, hasSize(2));
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class SandboxedFixedInputRuntimeTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
RuntimeInfo ri = def.getRuntimeInfo(ExecutionEngine.BEAM, createComponentProperties(), ConnectorTopology.OUTGOING);
List<URL> dependencies = ri.getMavenUrlDependencies();
// The important part of the test is that no exceptions are thrown while creating the RuntimeInfo.
assertThat(dependencies, hasSize(greaterThan(40)));
}
Aggregations