Search in sources :

Example 1 with TestComponentDefinition

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);
}
Also used : TestComponentDefinition(org.talend.components.api.service.common.testcomponent.TestComponentDefinition) Test(org.junit.Test) AbstractComponentTest(org.talend.components.api.test.AbstractComponentTest)

Example 2 with TestComponentDefinition

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));
}
Also used : SimpleComponentDefinition(org.talend.components.api.test.SimpleComponentDefinition) ComponentFamilyDefinition(org.talend.components.api.ComponentFamilyDefinition) TestComponentDefinition(org.talend.components.api.service.common.testcomponent.TestComponentDefinition) TestComponentFamilyDefinition(org.talend.components.api.service.common.testcomponent.TestComponentFamilyDefinition) Definition(org.talend.daikon.definition.Definition) ComponentDefinition(org.talend.components.api.component.ComponentDefinition) TestInjectComponentDefinition(org.talend.components.api.service.common.testcomponent.inject.TestInjectComponentDefinition) SimpleComponentDefinition(org.talend.components.api.test.SimpleComponentDefinition) TestComponentWizardDefinition(org.talend.components.api.service.common.testcomponent.TestComponentWizardDefinition) TestNestedInjectComponentDefinition(org.talend.components.api.service.common.testcomponent.inject.TestNestedInjectComponentDefinition) ComponentWizardDefinition(org.talend.components.api.wizard.ComponentWizardDefinition) TestComponentDefinition(org.talend.components.api.service.common.testcomponent.TestComponentDefinition) Test(org.junit.Test)

Example 3 with TestComponentDefinition

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));
}
Also used : ComponentFamilyDefinition(org.talend.components.api.ComponentFamilyDefinition) TestComponentDefinition(org.talend.components.api.service.common.testcomponent.TestComponentDefinition) TestComponentFamilyDefinition(org.talend.components.api.service.common.testcomponent.TestComponentFamilyDefinition) Definition(org.talend.daikon.definition.Definition) ComponentDefinition(org.talend.components.api.component.ComponentDefinition) TestInjectComponentDefinition(org.talend.components.api.service.common.testcomponent.inject.TestInjectComponentDefinition) SimpleComponentDefinition(org.talend.components.api.test.SimpleComponentDefinition) TestComponentWizardDefinition(org.talend.components.api.service.common.testcomponent.TestComponentWizardDefinition) TestNestedInjectComponentDefinition(org.talend.components.api.service.common.testcomponent.inject.TestNestedInjectComponentDefinition) ComponentWizardDefinition(org.talend.components.api.wizard.ComponentWizardDefinition) TestComponentDefinition(org.talend.components.api.service.common.testcomponent.TestComponentDefinition) TestComponentDefinition(org.talend.components.api.service.common.testcomponent.TestComponentDefinition) ComponentDefinition(org.talend.components.api.component.ComponentDefinition) TestInjectComponentDefinition(org.talend.components.api.service.common.testcomponent.inject.TestInjectComponentDefinition) SimpleComponentDefinition(org.talend.components.api.test.SimpleComponentDefinition) TestNestedInjectComponentDefinition(org.talend.components.api.service.common.testcomponent.inject.TestNestedInjectComponentDefinition) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 TestComponentDefinition (org.talend.components.api.service.common.testcomponent.TestComponentDefinition)3 ComponentFamilyDefinition (org.talend.components.api.ComponentFamilyDefinition)2 ComponentDefinition (org.talend.components.api.component.ComponentDefinition)2 TestComponentFamilyDefinition (org.talend.components.api.service.common.testcomponent.TestComponentFamilyDefinition)2 TestComponentWizardDefinition (org.talend.components.api.service.common.testcomponent.TestComponentWizardDefinition)2 TestInjectComponentDefinition (org.talend.components.api.service.common.testcomponent.inject.TestInjectComponentDefinition)2 TestNestedInjectComponentDefinition (org.talend.components.api.service.common.testcomponent.inject.TestNestedInjectComponentDefinition)2 SimpleComponentDefinition (org.talend.components.api.test.SimpleComponentDefinition)2 ComponentWizardDefinition (org.talend.components.api.wizard.ComponentWizardDefinition)2 Definition (org.talend.daikon.definition.Definition)2 AbstractComponentTest (org.talend.components.api.test.AbstractComponentTest)1