use of org.talend.daikon.properties.property.Property in project components by Talend.
the class SalesforceComponentTestIT method testInputProps.
@Test
public void testInputProps() throws Throwable {
TSalesforceInputProperties props = (TSalesforceInputProperties) new TSalesforceInputDefinition().createProperties();
assertEquals(2, props.queryMode.getPossibleValues().size());
Property[] returns = new TSalesforceInputDefinition().getReturnProperties();
assertEquals(ComponentDefinition.RETURN_TOTAL_RECORD_COUNT, returns[1].getName());
// Default query mode
Form queryAdvancedForm = props.getForm(Form.ADVANCED);
assertTrue(queryAdvancedForm.getChildForm(props.connection.getName()).getWidget(props.connection.bulkConnection.getName()).isHidden());
assertFalse(queryAdvancedForm.getWidget(props.normalizeDelimiter.getName()).isHidden());
assertFalse(queryAdvancedForm.getWidget(props.columnNameDelimiter.getName()).isHidden());
assertFalse(queryAdvancedForm.getChildForm(props.connection.getName()).getWidget(props.connection.httpChunked.getName()).isHidden());
assertTrue(queryAdvancedForm.getChildForm(props.connection.getName()).getWidget(props.connection.httpTraceMessage.getName()).isHidden());
// Change to bulk query mode
props.queryMode.setValue(TSalesforceInputProperties.QueryMode.Bulk);
props.afterQueryMode();
Form bulkQueryAdvancedForm = props.getForm(Form.ADVANCED);
assertTrue(bulkQueryAdvancedForm.getWidget(props.normalizeDelimiter.getName()).isHidden());
assertTrue(bulkQueryAdvancedForm.getWidget(props.columnNameDelimiter.getName()).isHidden());
assertTrue(bulkQueryAdvancedForm.getChildForm(props.connection.getName()).getWidget(props.connection.httpChunked.getName()).isHidden());
assertFalse(bulkQueryAdvancedForm.getChildForm(props.connection.getName()).getWidget(props.connection.httpTraceMessage.getName()).isHidden());
assertTrue(bulkQueryAdvancedForm.getChildForm(props.connection.getName()).getWidget(props.connection.bulkConnection.getName()).isHidden());
}
use of org.talend.daikon.properties.property.Property in project components by Talend.
the class SnowflakeRuntimeIT method checkAndSetupTable.
protected void checkAndSetupTable(SnowflakeConnectionTableProperties props) throws Throwable {
assertEquals(2, props.getForms().size());
Form f = props.table.getForm(Form.REFERENCE);
SnowflakeTableProperties tableProps = (SnowflakeTableProperties) f.getProperties();
assertTrue(f.getWidget(tableProps.tableName.getName()).isCallBeforeActivate());
tableProps = (SnowflakeTableProperties) PropertiesTestUtils.checkAndBeforeActivate(getComponentService(), f, tableProps.tableName.getName(), tableProps);
Property prop = (Property) f.getWidget(tableProps.tableName.getName()).getContent();
LOGGER.debug(prop.getPossibleValues().toString());
LOGGER.debug(tableProps.getValidationResult().toString());
assertEquals(ValidationResult.Result.OK, tableProps.getValidationResult().getStatus());
assertEquals(1, prop.getPossibleValues().size());
tableProps.tableName.setValue(testTable);
tableProps = (SnowflakeTableProperties) PropertiesTestUtils.checkAndAfter(getComponentService(), f, tableProps.tableName.getName(), tableProps);
Form schemaForm = tableProps.main.getForm(Form.REFERENCE);
PropertiesTestUtils.checkAndAfter(getComponentService(), schemaForm, tableProps.main.schema.getName(), tableProps.main);
Schema schema = tableProps.main.schema.getValue();
LOGGER.debug(schema.toString());
for (Schema.Field child : schema.getFields()) {
LOGGER.debug(child.name());
}
assertEquals(NUM_COLUMNS, schema.getFields().size());
}
Aggregations