Search in sources :

Example 1 with TAzureStorageQueueDeleteProperties

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();
}
Also used : TAzureStorageQueueDeleteProperties(org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties) BoundedReader(org.talend.components.api.component.runtime.BoundedReader) Test(org.junit.Test)

Example 2 with TAzureStorageQueueDeleteProperties

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;
}
Also used : AzureStorageQueueService(org.talend.components.azurestorage.queue.AzureStorageQueueService) TAzureStorageQueueDeleteProperties(org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties) ValidationResult(org.talend.daikon.properties.ValidationResult)

Example 3 with TAzureStorageQueueDeleteProperties

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();
}
Also used : TAzureStorageQueueDeleteProperties(org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties) RuntimeContainerMock(org.talend.components.azurestorage.RuntimeContainerMock) TAzureStorageConnectionProperties(org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties) Before(org.junit.Before)

Example 4 with TAzureStorageQueueDeleteProperties

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();
}
Also used : TAzureStorageQueueCreateProperties(org.talend.components.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties) TAzureStorageQueueDeleteProperties(org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties) IndexedRecord(org.apache.avro.generic.IndexedRecord) BoundedReader(org.talend.components.api.component.runtime.BoundedReader) Test(org.junit.Test)

Aggregations

TAzureStorageQueueDeleteProperties (org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties)4 Test (org.junit.Test)2 BoundedReader (org.talend.components.api.component.runtime.BoundedReader)2 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 Before (org.junit.Before)1 RuntimeContainerMock (org.talend.components.azurestorage.RuntimeContainerMock)1 AzureStorageQueueService (org.talend.components.azurestorage.queue.AzureStorageQueueService)1 TAzureStorageQueueCreateProperties (org.talend.components.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties)1 TAzureStorageConnectionProperties (org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1