use of org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties in project components by Talend.
the class AzureStorageQueueDeleteReaderTestIT method testDeleteNonExistingQueue.
@SuppressWarnings("rawtypes")
@Test
public void testDeleteNonExistingQueue() throws Throwable {
TAzureStorageQueueDeleteProperties properties = new TAzureStorageQueueDeleteProperties("tests");
properties.setupProperties();
properties = (TAzureStorageQueueDeleteProperties) setupConnectionProperties((AzureStorageProvideConnectionProperties) properties);
properties.queueName.setValue(TEST_QUEUE_NAME_CREATE + "toto");
BoundedReader reader = createBoundedReader(properties);
assertFalse(reader.start());
reader.close();
}
use of org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties in project components by Talend.
the class AzureStorageQueueDeleteRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult vr = super.initialize(runtimeContainer, properties);
if (!ValidationResult.OK.getStatus().equals(vr.getStatus())) {
return vr;
}
this.dieOnError = ((TAzureStorageQueueDeleteProperties) properties).dieOnError.getValue();
queueService = new AzureStorageQueueService(getAzureConnection(runtimeContainer));
return ValidationResult.OK;
}
use of org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties in project components by Talend.
the class AzureStorageQueueDeleteRuntimeTest method setup.
@Before
public void setup() throws IOException {
properties = new TAzureStorageQueueDeleteProperties(PROP_ + "Delete");
properties.setupProperties();
// valid connection
properties.connection = new TAzureStorageConnectionProperties(PROP_ + "Connection");
properties.connection.protocol.setValue(Protocol.HTTP);
properties.connection.accountName.setValue("fakeAccountName");
properties.connection.accountKey.setValue("fakeAccountKey=ANBHFYRJJFHRIKKJFU");
runtimeContainer = new RuntimeContainerMock();
this.queueDelete = new AzureStorageQueueDeleteRuntime();
}
use of org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties 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