use of org.talend.components.kinesis.runtime.IKinesisDatasetRuntime in project components by Talend.
the class KinesisDatasetRuntimeTestIT method listStreams.
// Can't use localstack to list streams by region
@Test
public void listStreams() {
KinesisDatasetProperties props = getDatasetForListStreams(getDatastore(), KinesisRegion.DEFAULT, null);
RuntimeInfo ri = def.getRuntimeInfo(props);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(ri, getClass().getClassLoader())) {
IKinesisDatasetRuntime runtime = (IKinesisDatasetRuntime) si.getInstance();
runtime.initialize(null, props);
Set<String> streams = runtime.listStreams();
// no exception is ok
assertTrue(true);
}
}
use of org.talend.components.kinesis.runtime.IKinesisDatasetRuntime in project components by Talend.
the class KinesisDatasetProperties method afterRegion.
public void afterRegion() {
refreshLayout(getForm(Form.MAIN));
KinesisDatasetDefinition definition = new KinesisDatasetDefinition();
RuntimeInfo ri = definition.getRuntimeInfo(this);
try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(ri, getClass().getClassLoader())) {
IKinesisDatasetRuntime runtime = (IKinesisDatasetRuntime) si.getInstance();
runtime.initialize(null, this);
this.streamName.setPossibleValues(new ArrayList<String>(runtime.listStreams()));
} catch (Exception e) {
TalendRuntimeException.build(ComponentsErrorCode.IO_EXCEPTION, e).throwIt();
}
}
Aggregations