use of org.talend.components.api.wizard.WizardNameComparator in project components by Talend.
the class SalesforceComponentTestIT method testModuleWizard.
@Test
public void testModuleWizard() throws Throwable {
ComponentWizard connectionWizard = getComponentService().getComponentWizard(SalesforceConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeSalesforce");
List<Form> forms = connectionWizard.getForms();
Form connectionWizardForm = forms.get(0);
SalesforceConnectionProperties connProps = (SalesforceConnectionProperties) connectionWizardForm.getProperties();
ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location").toArray(new ComponentWizard[3]);
Arrays.sort(subWizards, new WizardNameComparator());
assertEquals(3, subWizards.length);
assertTrue(subWizards[0].getDefinition().isTopLevel());
assertEquals("Salesforce Connection", subWizards[0].getDefinition().getMenuItemName());
assertFalse(subWizards[1].getDefinition().isTopLevel());
assertEquals("Edit Salesforce", subWizards[1].getDefinition().getMenuItemName());
assertFalse(subWizards[2].getDefinition().isTopLevel());
assertEquals("Retrieve Salesforce Modules", subWizards[2].getDefinition().getMenuItemName());
}
use of org.talend.components.api.wizard.WizardNameComparator 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.api.wizard.WizardNameComparator in project components by Talend.
the class SpringSnowflakeTestIT method testModuleWizard.
@Test
public void testModuleWizard() throws Throwable {
ComponentWizard connectionWizard = getComponentService().getComponentWizard(SnowflakeConnectionWizardDefinition.COMPONENT_WIZARD_NAME, "nodeSnowflake");
List<Form> forms = connectionWizard.getForms();
Form connFormWizard = forms.get(0);
SnowflakeConnectionProperties connProps = (SnowflakeConnectionProperties) connFormWizard.getProperties();
ComponentWizard[] subWizards = getComponentService().getComponentWizardsForProperties(connProps, "location").toArray(new ComponentWizard[2]);
Arrays.sort(subWizards, new WizardNameComparator());
assertEquals(2, subWizards.length);
assertTrue(subWizards[0].getDefinition().isTopLevel());
assertEquals("Snowflake Connection", subWizards[0].getDefinition().getMenuItemName());
// 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());
// will remove the edit wizard in future, no need to test more about it
// Add module wizard - we refer to the existing connection properties as we don't present the UI
// for them.
// assertTrue(connProps == ((SnowflakeTableListProperties) subWizards[2].getForms().get(0).getProperties())
// .getConnectionProperties());
// assertFalse(subWizards[2].getDefinition().isTopLevel());
// assertEquals("Snowflake Tables", subWizards[2].getDefinition().getMenuItemName());
}
Aggregations