use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.
the class AzureStorageQueueCreateReaderTestIT method testDeleteAndRecreateQueue.
@SuppressWarnings("rawtypes")
@Test
public void testDeleteAndRecreateQueue() throws Exception {
TAzureStorageQueueCreateProperties properties = new TAzureStorageQueueCreateProperties("tests");
properties.setupProperties();
properties = (TAzureStorageQueueCreateProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
String fqueue = TEST_QUEUE_NAME_CREATE + "deleteandrecreate";
properties.queueName.setValue(fqueue);
BoundedReader reader = createBoundedReader(properties);
assertTrue(reader.start());
reader.close();
//
queueClient.getQueueReference(fqueue).delete();
//
assertTrue(reader.start());
reader.close();
}
use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.
the class AzureStorageQueueListReaderTestIT method testListQueues.
@SuppressWarnings("rawtypes")
@Test
public void testListQueues() throws Throwable {
TAzureStorageQueueListProperties properties = new TAzureStorageQueueListProperties("tests");
properties.setupProperties();
properties = (TAzureStorageQueueListProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
BoundedReader reader = createBoundedReader(properties);
assertTrue(reader.start());
do {
IndexedRecord current = (IndexedRecord) reader.getCurrent();
assertNotNull(current);
assertTrue(current.get(0) instanceof String);
} while (reader.advance());
assertTrue((int) reader.getReturnValues().get(AzureStorageDefinition.RETURN_TOTAL_RECORD_COUNT) > 0);
reader.close();
}
use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.
the class AzureStorageQueuePurgeReaderTestIT method testPurge.
@SuppressWarnings("rawtypes")
@Test
public void testPurge() throws Throwable {
TAzureStorageQueuePurgeProperties properties = new TAzureStorageQueuePurgeProperties("tests");
properties.setupProperties();
properties = (TAzureStorageQueuePurgeProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
properties.queueName.setValue(TEST_QUEUE_NAME);
BoundedReader reader = createBoundedReader(properties);
assertTrue(reader.start());
assertFalse(reader.advance());
reader.close();
queue.downloadAttributes();
assertEquals(0, queue.getApproximateMessageCount());
}
use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.
the class AzureStorageQueueDeleteReaderTestIT method testDeleteQueue.
@SuppressWarnings("rawtypes")
@Test
public void testDeleteQueue() throws Throwable {
//
TAzureStorageQueueCreateProperties props = new TAzureStorageQueueCreateProperties("tests");
props.setupProperties();
props = (TAzureStorageQueueCreateProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) props);
props.queueName.setValue(TEST_QUEUE_NAME_CREATE);
BoundedReader reader = createBoundedReader(props);
reader.start();
reader.close();
//
TAzureStorageQueueDeleteProperties properties = new TAzureStorageQueueDeleteProperties("tests");
properties.setupProperties();
properties = (TAzureStorageQueueDeleteProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
properties.queueName.setValue(TEST_QUEUE_NAME_CREATE);
reader = createBoundedReader(properties);
assertTrue(reader.start());
assertNotNull(reader.getCurrent());
assertTrue(((IndexedRecord) reader.getCurrent()).get(0) instanceof String);
assertEquals(((IndexedRecord) reader.getCurrent()).get(0), TEST_NAME);
assertTrue((int) reader.getReturnValues().get(AzureStorageDefinition.RETURN_TOTAL_RECORD_COUNT) == 1);
reader.close();
}
use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.
the class AzureStorageQueueInputReaderTestIT method testReadOneMessage.
@SuppressWarnings("rawtypes")
@Test
public void testReadOneMessage() throws Throwable {
inputProps.numberOfMessages.setValue(1);
BoundedReader reader = createBoundedReader(inputProps);
assertTrue(reader.start());
assertFalse(reader.advance());
reader.close();
}
Aggregations