Search in sources :

Example 1 with AzureStorageQueueSink

use of org.talend.components.azurestorage.queue.runtime.AzureStorageQueueSink in project components by Talend.

the class AzureStorageQueuePurgeReaderTestIT method fillInQueue.

@Before
public void fillInQueue() throws Throwable {
    TAzureStorageQueueOutputProperties properties = new TAzureStorageQueueOutputProperties("tests");
    properties = (TAzureStorageQueueOutputProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
    properties.setupProperties();
    properties.queueName.setValue(TEST_QUEUE_NAME);
    AzureStorageQueueSink sink = new AzureStorageQueueSink();
    sink.initialize(null, properties);
    sink.validate(null);
    Writer<?> writer = sink.createWriteOperation().createWriter(null);
    writer.open("test-uid");
    for (String m : messages) {
        IndexedRecord entity = new GenericData.Record(properties.schema.schema.getValue());
        entity.put(0, m + "SIMPLE");
        writer.write(entity);
    }
    writer.close();
    queue.downloadAttributes();
    assertTrue(queue.getApproximateMessageCount() > 3);
}
Also used : AzureStorageQueueSink(org.talend.components.azurestorage.queue.runtime.AzureStorageQueueSink) IndexedRecord(org.apache.avro.generic.IndexedRecord) TAzureStorageQueueOutputProperties(org.talend.components.azurestorage.queue.tazurestoragequeueoutput.TAzureStorageQueueOutputProperties) IndexedRecord(org.apache.avro.generic.IndexedRecord) Before(org.junit.Before)

Example 2 with AzureStorageQueueSink

use of org.talend.components.azurestorage.queue.runtime.AzureStorageQueueSink in project components by Talend.

the class AzureStorageQueueOutputWriterTestIT method createWriter.

public Writer<?> createWriter(ComponentProperties properties) {
    AzureStorageQueueSink sink = new AzureStorageQueueSink();
    sink.initialize(null, properties);
    sink.validate(null);
    return sink.createWriteOperation().createWriter(null);
}
Also used : AzureStorageQueueSink(org.talend.components.azurestorage.queue.runtime.AzureStorageQueueSink)

Aggregations

AzureStorageQueueSink (org.talend.components.azurestorage.queue.runtime.AzureStorageQueueSink)2 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 Before (org.junit.Before)1 TAzureStorageQueueOutputProperties (org.talend.components.azurestorage.queue.tazurestoragequeueoutput.TAzureStorageQueueOutputProperties)1