use of org.talend.components.api.test.SimpleComponentDefinition in project components by Talend.
the class TestFixedConnectorComponentProperties method getComponentService.
// default implementation for pure java test. Shall be overriden of Spring or OSGI tests
public ComponentService getComponentService() {
DefinitionRegistry testComponentRegistry = new DefinitionRegistry();
SimpleComponentDefinition componentDef = new SimpleComponentDefinition("foo", ExecutionEngine.DI);
componentDef.setPropertyClass(TestProperties.class);
testComponentRegistry.registerDefinition(Arrays.asList(componentDef));
return new ComponentServiceImpl(testComponentRegistry);
}
use of org.talend.components.api.test.SimpleComponentDefinition in project components by Talend.
the class DefintitionRegistryTest method testGetDefinitionForPropertiesType.
@Test
public void testGetDefinitionForPropertiesType() {
// we'll check that 2 derived Properties have thier definition returned.
SimpleComponentDefinition compDef = new SimpleComponentDefinition("def", ExecutionEngine.DI);
compDef.setPropertyClass(NestedComponentProperties.class);
SimpleComponentDefinition inheritedDef = new SimpleComponentDefinition("DefOfinherited", ExecutionEngine.DI);
inheritedDef.setPropertyClass(InheritedComponentProperties.class);
DefinitionRegistry definitionRegistry = new DefinitionRegistry();
definitionRegistry.registerDefinition(Arrays.asList(compDef, inheritedDef, new TestComponentDefinition()));
Iterable<Definition> definitionForPropertiesType = definitionRegistry.getDefinitionForPropertiesType(NestedComponentProperties.class);
assertThat(definitionForPropertiesType, contains((Definition) compDef, inheritedDef));
}
Aggregations