Search in sources :

Example 1 with TAzureStorageQueuePurgeProperties

use of org.talend.components.azurestorage.queue.tazurestoragequeuepurge.TAzureStorageQueuePurgeProperties in project components by Talend.

the class AzureStorageQueuePurgeRuntimeTest method setup.

@Before
public void setup() throws IOException {
    properties = new TAzureStorageQueuePurgeProperties(PROP_ + "Purge");
    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.azureStorageQueuePurge = new AzureStorageQueuePurgeRuntime();
}
Also used : RuntimeContainerMock(org.talend.components.azurestorage.RuntimeContainerMock) TAzureStorageQueuePurgeProperties(org.talend.components.azurestorage.queue.tazurestoragequeuepurge.TAzureStorageQueuePurgeProperties) TAzureStorageConnectionProperties(org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties) Before(org.junit.Before)

Example 2 with TAzureStorageQueuePurgeProperties

use of org.talend.components.azurestorage.queue.tazurestoragequeuepurge.TAzureStorageQueuePurgeProperties in project components by Talend.

the class AzureStorageQueuePurgeRuntime 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 = ((TAzureStorageQueuePurgeProperties) properties).dieOnError.getValue();
    this.queueService = new AzureStorageQueueService(getAzureConnection(runtimeContainer));
    return ValidationResult.OK;
}
Also used : AzureStorageQueueService(org.talend.components.azurestorage.queue.AzureStorageQueueService) ValidationResult(org.talend.daikon.properties.ValidationResult) TAzureStorageQueuePurgeProperties(org.talend.components.azurestorage.queue.tazurestoragequeuepurge.TAzureStorageQueuePurgeProperties)

Example 3 with TAzureStorageQueuePurgeProperties

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

Aggregations

TAzureStorageQueuePurgeProperties (org.talend.components.azurestorage.queue.tazurestoragequeuepurge.TAzureStorageQueuePurgeProperties)3 Before (org.junit.Before)1 Test (org.junit.Test)1 BoundedReader (org.talend.components.api.component.runtime.BoundedReader)1 RuntimeContainerMock (org.talend.components.azurestorage.RuntimeContainerMock)1 AzureStorageQueueService (org.talend.components.azurestorage.queue.AzureStorageQueueService)1 TAzureStorageConnectionProperties (org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1