Search in sources :

Example 1 with KinesisDatasetProperties

use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.

the class KinesisTestConstants method getDatasetForAvro.

public static KinesisDatasetProperties getDatasetForAvro(KinesisDatastoreProperties datastore, String streamName, String avroSchema) {
    KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
    dataset.init();
    dataset.setDatastoreProperties(datastore);
    dataset.streamName.setValue(streamName);
    dataset.valueFormat.setValue(KinesisDatasetProperties.ValueFormat.AVRO);
    dataset.avroSchema.setValue(avroSchema);
    return dataset;
}
Also used : KinesisDatasetProperties(org.talend.components.kinesis.KinesisDatasetProperties)

Example 2 with KinesisDatasetProperties

use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.

the class KinesisTestConstants method getDatasetForListStreams.

public static KinesisDatasetProperties getDatasetForListStreams(KinesisDatastoreProperties datastore, KinesisRegion region, String customRegion) {
    KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
    dataset.init();
    dataset.setDatastoreProperties(datastore);
    dataset.region.setValue(region);
    if (KinesisRegion.OTHER.equals(region)) {
        dataset.unknownRegion.setValue(customRegion);
    }
    return dataset;
}
Also used : KinesisDatasetProperties(org.talend.components.kinesis.KinesisDatasetProperties)

Example 3 with KinesisDatasetProperties

use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.

the class KinesisTestConstants method getDatasetForCsv.

public static KinesisDatasetProperties getDatasetForCsv(KinesisDatastoreProperties datastore, String streamName, KinesisDatasetProperties.FieldDelimiterType fieldDelimiter) {
    KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
    dataset.init();
    dataset.setDatastoreProperties(datastore);
    dataset.streamName.setValue(streamName);
    dataset.valueFormat.setValue(KinesisDatasetProperties.ValueFormat.CSV);
    dataset.fieldDelimiter.setValue(fieldDelimiter);
    return dataset;
}
Also used : KinesisDatasetProperties(org.talend.components.kinesis.KinesisDatasetProperties)

Example 4 with KinesisDatasetProperties

use of org.talend.components.kinesis.KinesisDatasetProperties in project components by Talend.

the class KinesisTestConstants method getDatasetForListStreams.

public static KinesisDatasetProperties getDatasetForListStreams(KinesisDatastoreProperties datastore, KinesisRegion region, String customRegion) {
    KinesisDatasetProperties dataset = new KinesisDatasetProperties("kinesisDataset");
    dataset.init();
    dataset.setDatastoreProperties(datastore);
    dataset.region.setValue(region);
    if (KinesisRegion.OTHER.equals(region)) {
        dataset.unknownRegion.setValue(customRegion);
    }
    return dataset;
}
Also used : KinesisDatasetProperties(org.talend.components.kinesis.KinesisDatasetProperties)

Example 5 with KinesisDatasetProperties

use of org.talend.components.kinesis.KinesisDatasetProperties 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);
    }
}
Also used : SandboxedInstance(org.talend.daikon.sandbox.SandboxedInstance) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) KinesisDatasetProperties(org.talend.components.kinesis.KinesisDatasetProperties) IKinesisDatasetRuntime(org.talend.components.kinesis.runtime.IKinesisDatasetRuntime) Test(org.junit.Test)

Aggregations

KinesisDatasetProperties (org.talend.components.kinesis.KinesisDatasetProperties)5 Test (org.junit.Test)1 IKinesisDatasetRuntime (org.talend.components.kinesis.runtime.IKinesisDatasetRuntime)1 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)1 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)1