use of org.talend.components.azurestorage.blob.tazurestorageget.TAzureStorageGetProperties in project components by Talend.
the class AzureStorageGetRuntimeTest method setup.
@Before
public void setup() throws IOException {
properties = new TAzureStorageGetProperties(PROP_ + "Get");
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");
properties.container.setValue("goog-container-name-1");
runtimeContainer = new RuntimeContainerMock();
this.storageGet = new AzureStorageGetRuntime();
localFolder = FileUtils.createTempDirectory();
}
use of org.talend.components.azurestorage.blob.tazurestorageget.TAzureStorageGetProperties in project components by Talend.
the class AzureStorageGetRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult validationResult = super.initialize(runtimeContainer, properties);
if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
return validationResult;
}
TAzureStorageGetProperties componentProperties = (TAzureStorageGetProperties) properties;
localFolder = componentProperties.localFolder.getValue();
remoteBlobsGet = componentProperties.remoteBlobsGet;
this.dieOnError = componentProperties.dieOnError.getValue();
azureStorageBlobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
String errorMessage = "";
if (remoteBlobsGet.prefix.getValue() == null || remoteBlobsGet.prefix.getValue().isEmpty()) {
// $NON-NLS-1$
errorMessage = messages.getMessage("error.EmptyBlobs");
}
if (errorMessage.isEmpty()) {
// everything is OK.
return ValidationResult.OK;
} else {
return new ValidationResult(ValidationResult.Result.ERROR, errorMessage);
}
}
use of org.talend.components.azurestorage.blob.tazurestorageget.TAzureStorageGetProperties in project components by Talend.
the class AzureStorageSourceTest method testGetRemoteBlobs.
/**
* Test method for {@link org.talend.components.azurestorage.blob.runtime.AzureStorageSource#getRemoteBlobs()}.
*/
@Test
public final void testGetRemoteBlobs() {
TAzureStorageGetProperties props = new TAzureStorageGetProperties("test");
props.setupProperties();
List<String> prefixes = Arrays.asList("test1", "test2");
List<Boolean> includes = Arrays.asList(true, false);
props.remoteBlobs.prefix.setValue(prefixes);
props.remoteBlobs.include.setValue(includes);
source.initialize(null, props);
assertNotNull(source.getRemoteBlobs());
}
Aggregations