use of org.talend.components.filedelimited.tfileoutputdelimited.TFileOutputDelimitedDefinition in project components by Talend.
the class FileDelimitedTestBasic method createOutputProperties.
protected TFileOutputDelimitedProperties createOutputProperties(Object file, boolean isCsvMode) {
TFileOutputDelimitedProperties properties = (TFileOutputDelimitedProperties) new TFileOutputDelimitedDefinition().createProperties().init();
properties.fileName.setValue(file);
properties.rowSeparator.setValue("\n");
if (isCsvMode) {
properties.csvOptions.setValue(true);
properties.escapeChar.setValue("\"");
properties.textEnclosure.setValue("\"");
}
properties.main.schema.setValue(BASIC_OUTPUT_SCHEMA);
ComponentTestUtils.checkSerialize(properties, errorCollector);
return properties;
}
use of org.talend.components.filedelimited.tfileoutputdelimited.TFileOutputDelimitedDefinition in project components by Talend.
the class FileDelimitedTestIT method testGetProps.
@Test
public void testGetProps() throws Throwable {
// Input properties
testInputProperties();
// Output delimited
ComponentProperties output = new TFileOutputDelimitedDefinition().createProperties();
Form outputForm = output.getForm(Form.MAIN);
ComponentTestUtils.checkSerialize(output, errorCollector);
LOGGER.debug(outputForm.toString());
LOGGER.debug(output.toString());
assertEquals(Form.MAIN, outputForm.getName());
}
use of org.talend.components.filedelimited.tfileoutputdelimited.TFileOutputDelimitedDefinition in project components by Talend.
the class FileDelimitedWizardTestIT method testWizardSupportComponents.
@Test
public void testWizardSupportComponents() {
// This control the "Property Type" showed in component
TFileInputDelimitedProperties input = (TFileInputDelimitedProperties) new TFileInputDelimitedDefinition().createProperties();
TFileOutputDelimitedProperties output = (TFileOutputDelimitedProperties) new TFileOutputDelimitedDefinition().createProperties();
List<ComponentWizard> wizards = getComponentService().getComponentWizardsForProperties(input, null);
assertTrue(wizards.get(0) instanceof FileDelimitedWizard);
wizards = getComponentService().getComponentWizardsForProperties(output, null);
assertTrue(wizards.get(0) instanceof FileDelimitedWizard);
}
Aggregations