use of org.talend.components.api.properties.ComponentProperties in project components by Talend.
the class TSplunkEventCollectorTestIT method testGetProps.
@Test
public void testGetProps() {
ComponentProperties props = new TSplunkEventCollectorDefinition().createProperties();
Form f = props.getForm(Form.MAIN);
ComponentTestUtils.checkSerialize(props, errorCollector);
Form advancedF = props.getForm(Form.ADVANCED);
System.out.println(f);
System.out.println(advancedF);
System.out.println(props);
assertEquals(Form.MAIN, f.getName());
assertEquals(Form.ADVANCED, advancedF.getName());
}
use of org.talend.components.api.properties.ComponentProperties 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.api.properties.ComponentProperties in project components by Talend.
the class AbstractComponentDefinition method createRuntimeProperties.
@Override
public ComponentProperties createRuntimeProperties() {
ComponentProperties compProp = PropertiesImpl.createNewInstance(getPropertiesClass(), "root");
compProp.initForRuntime();
return compProp;
}
use of org.talend.components.api.properties.ComponentProperties in project components by Talend.
the class ComponentTestUtils method testAlli18n.
/**
* check all properties of a component for i18n, check form i18n, check ComponentProperties title is i18n
*
* @param componentService where to get all the components
* @param errorCollector used to collect all errors at once. @see
* <a href="http://junit.org/apidocs/org/junit/rules/ErrorCollector.html">ErrorCollector</a>
* @deprecated use {@link PropertiesTestUtils#assertAlli18nAreSetup(DefinitionRegistryService, ErrorCollector)} and
* {@link #assertReturnProperties18nAreSet(DefinitionRegistryService, ErrorCollector)}
*/
@Deprecated
public static void testAlli18n(ComponentService componentService, ErrorCollector errorCollector) {
Set<ComponentDefinition> allComponents = componentService.getAllComponents();
for (ComponentDefinition cd : allComponents) {
ComponentProperties props = (ComponentProperties) PropertiesImpl.createNewInstance(cd.getPropertiesClass(), "root").init();
// check all properties
if (props != null) {
checkAllI18N(props, errorCollector);
} else {
System.out.println("No properties to check fo I18n for :" + cd.getName());
}
// check component definition title
errorCollector.checkThat("missing I18n property [" + cd.getTitle() + "] for definition [" + cd.getClass().getName() + "]", cd.getTitle().contains("component."), is(false));
// check return properties i18n
checkAllPropertyI18n(cd.getReturnProperties(), cd, errorCollector);
}
}
use of org.talend.components.api.properties.ComponentProperties in project components by Talend.
the class TestFixedConnectorComponentProperties method testSetSchema.
@Test
public void testSetSchema() {
// $NON-NLS-1$
ComponentProperties properties = getComponentService().getComponentProperties("foo");
// $NON-NLS-1$
Schema aSchema = SchemaBuilder.builder().record("foo").fields().endRecord();
Schema schema = properties.getSchema(TestProperties.MAIN_CONNECTOR, true);
assertNotEquals(aSchema, schema);
properties.setConnectedSchema(TestProperties.MAIN_CONNECTOR, aSchema, true);
schema = properties.getSchema(TestProperties.MAIN_CONNECTOR, true);
assertEquals(aSchema, schema);
}
Aggregations