use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class TypeConverterDefinitionTest method testRuntimeInfo.
/**
* Checks the {@link RuntimeInfo} of the definition.
*/
@Test
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = def.getRuntimeInfo(ExecutionEngine.BEAM, null, ConnectorTopology.INCOMING_AND_OUTGOING);
Assert.assertThat(runtimeInfo.getRuntimeClassName(), is("org.talend.components.processing.runtime.typeconverter.TypeConverterFunction"));
// 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 PubSubDatasetProperties method beforeSubscription.
public ValidationResult beforeSubscription() {
PubSubDatasetDefinition definition = new PubSubDatasetDefinition();
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(this);
try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, getClass().getClassLoader())) {
IPubSubDatasetRuntime runtime = (IPubSubDatasetRuntime) sandboxedInstance.getInstance();
runtime.initialize(null, this);
List<NamedThing> topics = new ArrayList<>();
for (String topicName : runtime.listSubscriptions()) {
topics.add(new SimpleNamedThing(topicName, topicName));
}
subscription.setPossibleValues(topics);
return ValidationResult.OK;
} catch (Exception e) {
return new ValidationResult(new ComponentException(e));
}
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class PubSubDatasetDefinitionTest method testRuntimeInfo.
/**
* Check {@link PubSubDatasetDefinition#getRuntimeInfo(PubSubDatasetProperties)} returns RuntimeInfo,
* which runtime class name is "org.talend.components.pubsub.runtime.PubSubDatasetRuntime"
*/
@Test
@Ignore("This can't work unless the runtime jar is already installed in maven!")
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = datasetDefinition.getRuntimeInfo(null);
assertEquals("org.talend.components.pubsub.runtime.PubSubDatasetRuntime", runtimeInfo.getRuntimeClassName());
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class S3DatasetProperties method afterRegion.
public void afterRegion() {
refreshLayout(getForm(Form.MAIN));
S3DatasetDefinition definition = new S3DatasetDefinition();
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(this);
try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, getClass().getClassLoader())) {
IS3DatasetRuntime runtime = (IS3DatasetRuntime) sandboxedInstance.getInstance();
runtime.initialize(null, this);
this.bucket.setPossibleValues(new ArrayList<String>(runtime.listBuckets()));
} catch (Exception e) {
TalendRuntimeException.build(ComponentsErrorCode.IO_EXCEPTION, e).throwIt();
}
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class ElasticsearchDatasetDefinitionTest method testRuntimeInfo.
/**
* Check {@link ElasticsearchDatasetDefinition#getRuntimeInfo(ElasticsearchDatasetProperties)} returns RuntimeInfo,
* which runtime class name is "org.talend.components.elasticsearch.runtime_2_4.ElasticsearchDatasetRuntime"
*/
@Test
@Ignore("This can't work unless the runtime jar is already installed in maven!")
public void testRuntimeInfo() {
RuntimeInfo runtimeInfo = datasetDefinition.getRuntimeInfo(null);
assertEquals("org.talend.components.elasticsearch.runtime_2_4.ElasticsearchDatasetRuntime", runtimeInfo.getRuntimeClassName());
}
Aggregations