use of org.talend.components.azurestorage.blob.tazurestoragelist.TAzureStorageListProperties in project components by Talend.
the class AzureStorageBaseBlobTestIT method listAllBlobs.
@SuppressWarnings("rawtypes")
public List<String> listAllBlobs(String container) throws Exception {
List<String> blobs = new ArrayList<>();
TAzureStorageListProperties props = new TAzureStorageListProperties("tests");
props.container.setValue(container);
setupConnectionProperties(props);
RemoteBlobsTable rmt = new RemoteBlobsTable("tests");
List<String> pfx = new ArrayList<>();
List<Boolean> inc = new ArrayList<>();
pfx.add("");
inc.add(true);
rmt.prefix.setValue(pfx);
rmt.include.setValue(inc);
props.remoteBlobs = rmt;
props.schema.schema.setValue(schemaForBlobList);
BoundedReader reader = createBoundedReader(props);
Boolean rows = reader.start();
Object row;
while (rows) {
row = ((IndexedRecord) reader.getCurrent()).get(0);
assertNotNull(row);
assertTrue(row instanceof String);
blobs.add(row.toString());
rows = reader.advance();
}
reader.close();
return blobs;
}
use of org.talend.components.azurestorage.blob.tazurestoragelist.TAzureStorageListProperties in project components by Talend.
the class AzureStorageListReaderTest method setUp.
@Before
public void setUp() throws Exception {
runtimeContainer = new RuntimeContainerMock();
AzureStorageSource source = new AzureStorageSource();
properties = new TAzureStorageListProperties(PROP_ + "List");
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 = (AzureStorageListReader) source.createReader(runtimeContainer);
reader.azureStorageBlobService = blobService;
}
use of org.talend.components.azurestorage.blob.tazurestoragelist.TAzureStorageListProperties in project components by Talend.
the class AzureStorageComponentsTest method testBlobListSchema.
@Test
public void testBlobListSchema() {
Schema s = // $NON-NLS-3$
SchemaBuilder.record("Main").fields().name("BlobName").prop(SchemaConstants.TALEND_COLUMN_DB_LENGTH, "300").prop(SchemaConstants.TALEND_IS_LOCKED, "true").type(AvroUtils._string()).noDefault().endRecord();
TAzureStorageListProperties props = new TAzureStorageListProperties("tests");
props.setupProperties();
Schema ps = props.schema.schema.getValue();
assertEquals(s, ps);
}
use of org.talend.components.azurestorage.blob.tazurestoragelist.TAzureStorageListProperties in project components by Talend.
the class AzureStorageSourceTest method setUp.
@Before
public void setUp() throws Exception {
source = new AzureStorageSource();
AzureStorageBlobProperties props = new TAzureStorageListProperties("test");
}
Aggregations