use of org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties in project components by Talend.
the class AzureStorageConnectionWizardTest method testWizard.
@Test
public void testWizard() throws Throwable {
final List<RepoProps> repoProps = new ArrayList<>();
Repository repo = new TestRepository(repoProps);
getComponentService().setRepository(repo);
Set<ComponentWizardDefinition> wizards = getComponentService().getTopLevelComponentWizards();
int count = 0;
ComponentWizardDefinition wizardDef = null;
for (ComponentWizardDefinition wizardDefinition : wizards) {
if (wizardDefinition instanceof AzureStorageConnectionWizardDefinition) {
wizardDef = wizardDefinition;
count++;
}
}
assertEquals(1, count);
assertEquals("Create an Azure Storage Connection", wizardDef.getMenuItemName());
ComponentWizard wiz = getComponentService().getComponentWizard(AzureStorageConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeAzureStorage");
assertNotNull(wiz);
assertEquals("nodeAzureStorage", wiz.getRepositoryLocation());
List<Form> forms = wiz.getForms();
Form connFormWizard = forms.get(0);
assertEquals("Wizard", connFormWizard.getName());
assertFalse(connFormWizard.isAllowBack());
assertFalse(connFormWizard.isAllowForward());
assertFalse(connFormWizard.isAllowFinish());
// Main from SalesforceModuleListProperties
assertEquals("Container", forms.get(1).getName());
assertEquals("Queue", forms.get(2).getName());
assertEquals("Table", forms.get(3).getName());
assertEquals("Azure Storage Connection Settings", connFormWizard.getTitle());
assertEquals("Fill in fields to configure connection.", connFormWizard.getSubtitle());
TAzureStorageConnectionProperties connProps = (TAzureStorageConnectionProperties) connFormWizard.getProperties();
connProps.setupProperties();
Object image = getComponentService().getWizardPngImage(AzureStorageConnectionWizardDefinition.COMPONENT_WIZARD_NAME, WizardImageType.TREE_ICON_16X16);
assertNotNull(image);
image = getComponentService().getWizardPngImage(AzureStorageConnectionWizardDefinition.COMPONENT_WIZARD_NAME, WizardImageType.WIZARD_BANNER_75X66);
assertNotNull(image);
// Check the non-top-level wizard
// check password i18n
assertEquals("Name", connProps.getProperty("name").getDisplayName());
connProps.name.setValue("connName");
connProps.accountName.setValue("demo");
connProps.accountKey.setValue("demo");
// check name i18n
// $NON-NLS-1$
NamedThing nameProp = connFormWizard.getWidget("name").getContent();
assertEquals("Name", nameProp.getDisplayName());
connProps = (TAzureStorageConnectionProperties) PropertiesTestUtils.checkAndValidate(getComponentService(), connFormWizard, "testConnection", connProps);
assertFalse(connFormWizard.isAllowForward());
Form modForm = forms.get(1);
}
use of org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties in project components by Talend.
the class AzureStorageConnectionWizardTest method testModuleWizard.
@Test
public void testModuleWizard() throws Throwable {
ComponentWizard wiz = getComponentService().getComponentWizard(AzureStorageConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeAzureStorage");
List<Form> forms = wiz.getForms();
Form connFormWizard = forms.get(0);
TAzureStorageConnectionProperties connProps = (TAzureStorageConnectionProperties) connFormWizard.getProperties();
ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location").toArray(new ComponentWizard[1]);
Arrays.sort(subWizards, new WizardNameComparator());
assertEquals(2, subWizards.length);
// Edit connection wizard - we copy the connection properties, as we present the UI, so we use the
// connection properties object created by the new wizard
assertFalse(connProps == subWizards[1].getForms().get(0).getProperties());
// Add module wizard - we refer to the existing connection properties as we don't present the UI
// for them.
}
use of org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties in project components by Talend.
the class AzureStorageQueueRuntimeTest method setup.
@Before
public void setup() throws IOException {
properties = new TAzureStorageQueueCreateProperties(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");
runtimeContainer = new RuntimeContainerMock();
this.azureStorageQueue = new AzureStorageQueueRuntime() {
};
}
use of org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties in project components by Talend.
the class AzureStorageTableReaderTest method setUp.
@Before
public void setUp() throws Exception {
container = new RuntimeContainerMock();
properties = new TAzureStorageInputTableProperties(PROP_ + "InputTable");
properties.setupProperties();
// valid fake 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.tableName.setValue("testTable");
properties.filterExpression.column.setValue(new ArrayList<String>());
properties.filterExpression.fieldType.setValue(new ArrayList<String>());
properties.filterExpression.function.setValue(new ArrayList<String>());
properties.filterExpression.operand.setValue(new ArrayList<String>());
properties.filterExpression.predicate.setValue(new ArrayList<String>());
properties.filterExpression.column.getValue().add("PartitionKey");
properties.filterExpression.fieldType.getValue().add(SupportedFieldType.STRING.name());
properties.filterExpression.function.getValue().add(Comparison.EQUAL.name());
properties.filterExpression.operand.getValue().add("Departement");
properties.filterExpression.predicate.getValue().add(Predicate.AND.name());
source = new AzureStorageTableSource();
}
use of org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties 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;
}
Aggregations