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();
}
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;
}
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());
}
Aggregations