Search in sources :

Example 1 with BoundedReader

use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.

the class AzureStorageGetReaderTestIT method testBlobGetSub1.

@SuppressWarnings("rawtypes")
@Test
public void testBlobGetSub1() throws Exception {
    cleanupLists();
    prefixes.add("sub1/");
    includes.add(true);
    creates.add(true);
    BoundedReader reader = createGetReader(false);
    assertTrue(reader.start());
    reader.close();
    for (String file : TEST_SUB1_BLOBS) assertTrue(fileExistsAndHasTheGoodSize(file));
}
Also used : BoundedReader(org.talend.components.api.component.runtime.BoundedReader) Test(org.junit.Test)

Example 2 with BoundedReader

use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.

the class AzureStoragePutReaderTestIT method testBlobPutFolder.

@SuppressWarnings({ "unused", "rawtypes" })
@Test
public void testBlobPutFolder() throws Exception {
    properties.useFileList.setValue(false);
    BoundedReader reader = createBoundedReader(properties);
    assertTrue(reader.start());
    List<String> blobs = listAllBlobs(CONTAINER);
}
Also used : BoundedReader(org.talend.components.api.component.runtime.BoundedReader) Test(org.junit.Test)

Example 3 with BoundedReader

use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.

the class AzureStorageListReaderTestIT method listBlobs.

@SuppressWarnings("rawtypes")
public void listBlobs() throws Exception {
    blobs.clear();
    properties.remoteBlobs = remoteBlobs;
    properties.schema.schema.setValue(schemaForBlobList);
    BoundedReader reader = createBoundedReader(properties);
    Object row;
    Boolean rows = reader.start();
    while (rows) {
        row = ((IndexedRecord) reader.getCurrent()).get(0);
        assertNotNull(row);
        assertTrue(row instanceof String);
        blobs.add(row.toString());
        rows = reader.advance();
    }
    reader.close();
}
Also used : BoundedReader(org.talend.components.api.component.runtime.BoundedReader)

Example 4 with BoundedReader

use of org.talend.components.api.component.runtime.BoundedReader 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 5 with BoundedReader

use of org.talend.components.api.component.runtime.BoundedReader in project components by Talend.

the class AzureStorageBaseBlobTestIT method doContainerCreate.

/**
 * doContainerCreate.
 *
 * @param container {@link String} container
 * @param access {@link AccessControl} access
 * @return <code>Boolean</code> {@link Boolean} boolean
 * @throws Exception the exception
 */
@SuppressWarnings("rawtypes")
public Boolean doContainerCreate(String container, TAzureStorageContainerCreateProperties.AccessControl access) throws Exception {
    TAzureStorageContainerCreateProperties properties = new TAzureStorageContainerCreateProperties("tests");
    setupConnectionProperties(properties);
    properties.container.setValue(container);
    properties.accessControl.setValue(access);
    BoundedReader reader = createBoundedReader(properties);
    return reader.start();
}
Also used : TAzureStorageContainerCreateProperties(org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties) BoundedReader(org.talend.components.api.component.runtime.BoundedReader)

Aggregations

BoundedReader (org.talend.components.api.component.runtime.BoundedReader)45 Test (org.junit.Test)37 IndexedRecord (org.apache.avro.generic.IndexedRecord)24 Matchers.anyString (org.mockito.Matchers.anyString)6 ArrayList (java.util.ArrayList)5 TAzureStorageQueueCreateProperties (org.talend.components.azurestorage.queue.tazurestoragequeuecreate.TAzureStorageQueueCreateProperties)4 GenericData (org.apache.avro.generic.GenericData)3 RemoteBlobsTable (org.talend.components.azurestorage.blob.helpers.RemoteBlobsTable)2 TAzureStorageQueueDeleteProperties (org.talend.components.azurestorage.queue.tazurestoragequeuedelete.TAzureStorageQueueDeleteProperties)2 Drive (com.google.api.services.drive.Drive)1 File (com.google.api.services.drive.model.File)1 FileList (com.google.api.services.drive.model.FileList)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 Map (java.util.Map)1 Before (org.junit.Before)1 TAzureStorageContainerCreateProperties (org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties)1 TAzureStorageContainerDeleteProperties (org.talend.components.azurestorage.blob.tazurestoragecontainerdelete.TAzureStorageContainerDeleteProperties)1 TAzureStorageContainerExistProperties (org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties)1 TAzureStorageContainerListProperties (org.talend.components.azurestorage.blob.tazurestoragecontainerlist.TAzureStorageContainerListProperties)1