use of org.talend.components.api.service.common.testcomponent.TestComponentDefinition in project components by Talend.
the class ComponentServiceTest method testFamilies.
@Test
public void testFamilies() {
TestComponentDefinition testComponentDefinition = new TestComponentDefinition();
assertEquals(2, testComponentDefinition.getFamilies().length);
}
use of org.talend.components.api.service.common.testcomponent.TestComponentDefinition 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));
}
use of org.talend.components.api.service.common.testcomponent.TestComponentDefinition in project components by Talend.
the class DefintitionRegistryTest method testAddComponentDefinition.
@Test
public void testAddComponentDefinition() {
DefinitionRegistry registry = new DefinitionRegistry();
ComponentDefinition def = new TestComponentDefinition();
registry.registerDefinition(Arrays.asList(def));
assertThat(registry.getIterableDefinitions(), contains((Definition) def));
assertThat(registry.getDefinitionsByType(ComponentDefinition.class), contains(def));
}
Aggregations