use of org.talend.components.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties in project components by Talend.
the class AzureStorageQueueCreateReaderTestIT method testCreateNewQueue.
@SuppressWarnings("rawtypes")
@Test
public void testCreateNewQueue() throws Throwable {
TAzureStorageQueueCreateProperties properties = new TAzureStorageQueueCreateProperties("tests");
properties.setupProperties();
properties = (TAzureStorageQueueCreateProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
String fqueue = TEST_QUEUE_NAME_CREATE + getRandomTestUID() + "a";
properties.queueName.setValue(fqueue);
BoundedReader reader = createBoundedReader(properties);
assertTrue(reader.start());
assertNotNull(reader.getCurrent());
assertTrue(((IndexedRecord) reader.getCurrent()).get(0) instanceof String);
assertEquals(((IndexedRecord) reader.getCurrent()).get(0), fqueue);
assertTrue((int) reader.getReturnValues().get(AzureStorageDefinition.RETURN_TOTAL_RECORD_COUNT) > 0);
reader.close();
}
use of org.talend.components.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties 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.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties in project components by Talend.
the class AzureStorageBaseQueueTestIT method createTestQueue.
@BeforeClass
public static void createTestQueue() throws Throwable {
TAzureStorageQueueCreateProperties properties = new TAzureStorageQueueCreateProperties("tests");
properties = (TAzureStorageQueueCreateProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
properties.setupProperties();
properties.queueName.setValue(TEST_QUEUE_NAME);
AzureStorageQueueSource source = new AzureStorageQueueSource();
source.initialize(null, properties);
queueClient = source.getStorageQueueClient(null);
queue = source.getCloudQueue(null, TEST_QUEUE_NAME);
queue.createIfNotExists();
}
use of org.talend.components.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties 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();
}
Aggregations