Search in sources :

Example 1 with TAzureStorageContainerListProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties in project components by Talend.

the class AzureStorageContainerListReaderTest method setUp.

@Before
public void setUp() throws Exception {
    runtimeContainer = new RuntimeContainerMock();
    AzureStorageSource source = new AzureStorageSource();
    TAzureStorageContainerListProperties properties = new TAzureStorageContainerListProperties(PROP_ + "ContainerList");
    properties.connection = new TAzureStorageConnectionProperties(PROP_ + "Connection");
    properties.connection.protocol.setValue(Protocol.HTTP);
    properties.connection.accountName.setValue("fakeAccountName");
    properties.connection.accountKey.setValue("fakeAccountKey=ANBHFYRJJFHRIKKJFU");
    properties.setupProperties();
    source.initialize(runtimeContainer, properties);
    reader = (AzureStorageContainerListReader) source.createReader(runtimeContainer);
    reader.blobService = blobService;
}
Also used : TAzureStorageContainerListProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties) RuntimeContainerMock(org.talend.components.azurestorage.RuntimeContainerMock) TAzureStorageConnectionProperties(org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties) Before(org.junit.Before)

Example 2 with TAzureStorageContainerListProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties in project components by Talend.

the class TAzureStorageConnectionTestIT method testInvalidConnection.

@SuppressWarnings("rawtypes")
@Test(expected = Exception.class)
public void testInvalidConnection() throws Throwable {
    TAzureStorageContainerListProperties properties = new TAzureStorageContainerListProperties("test");
    properties.dieOnError.setValue(true);
    BoundedReader reader = createBoundedReader(properties);
    reader.start();
}
Also used : TAzureStorageContainerListProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties) BoundedReader(org.talend.components.api.component.runtime.BoundedReader) Test(org.junit.Test)

Example 3 with TAzureStorageContainerListProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties in project components by Talend.

the class AzureStorageBaseBlobTestIT method createContainerListReader.

/**
 * createContainerListReader - List containers
 *
 * @return {@link BoundedReader} bounded reader
 * @throws Exception the exception
 */
@SuppressWarnings("rawtypes")
public BoundedReader createContainerListReader() throws Exception {
    TAzureStorageContainerListProperties properties = new TAzureStorageContainerListProperties("tests");
    setupConnectionProperties(properties);
    properties.schema.schema.setValue(schemaForContainerList);
    return createBoundedReader(properties);
}
Also used : TAzureStorageContainerListProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties)

Example 4 with TAzureStorageContainerListProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties in project components by Talend.

the class AzureStorageComponentsTest method testContainerListSchema.

@Test
public void testContainerListSchema() {
    Schema s = // $NON-NLS-3$
    SchemaBuilder.record("Main").fields().name("ContainerName").prop(SchemaConstants.TALEND_COLUMN_DB_LENGTH, "50").prop(SchemaConstants.TALEND_IS_LOCKED, "true").type(AvroUtils._string()).noDefault().endRecord();
    TAzureStorageContainerListProperties props = new TAzureStorageContainerListProperties("tests");
    props.setupProperties();
    Schema ps = props.schema.schema.getValue();
    assertEquals(s, ps);
}
Also used : TAzureStorageContainerListProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties) Schema(org.apache.avro.Schema) Test(org.junit.Test)

Aggregations

TAzureStorageContainerListProperties (org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties)4 Test (org.junit.Test)2 Schema (org.apache.avro.Schema)1 Before (org.junit.Before)1 BoundedReader (org.talend.components.api.component.runtime.BoundedReader)1 RuntimeContainerMock (org.talend.components.azurestorage.RuntimeContainerMock)1 TAzureStorageConnectionProperties (org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties)1