use of org.talend.components.api.testcomponent.TestComponentDefinition in project components by Talend.
the class ComponentDefinitionTest method testi18NForComponentDefintion.
@Test
public void testi18NForComponentDefintion() {
TestComponentDefinition tcd = new TestComponentDefinition();
assertEquals("Test Component", tcd.getDisplayName());
assertEquals("Ze Test Component Title", tcd.getTitle());
}
use of org.talend.components.api.testcomponent.TestComponentDefinition in project components by Talend.
the class ComponentDefinitionTest method test.
@Test
public void test() {
TestComponentDefinition cd = new TestComponentDefinition();
TestComponentProperties prop = (TestComponentProperties) cd.createRuntimeProperties();
assertNotNull(prop.initLater);
assertNull(prop.mainForm);
}
use of org.talend.components.api.testcomponent.TestComponentDefinition in project components by Talend.
the class ComponentDefinitionTest method testConnectorTopologyEngine_Error2.
@Test(expected = TalendRuntimeException.class)
public void testConnectorTopologyEngine_Error2() {
TestComponentDefinition cd = new TestComponentDefinition() {
@Override
public Set<ConnectorTopology> getSupportedConnectorTopologies() {
return EnumSet.of(ConnectorTopology.INCOMING, ConnectorTopology.OUTGOING);
}
};
// The assert will throw an exception on this cases
cd.assertConnectorTopologyCompatibility(ConnectorTopology.NONE);
}
use of org.talend.components.api.testcomponent.TestComponentDefinition in project components by Talend.
the class ComponentDefinitionTest method testNoExecutionEngine.
@Test
public void testNoExecutionEngine() {
// A component that supports no execution engines.
TestComponentDefinition cd = new TestComponentDefinition(false);
assertThat(cd.getSupportedExecutionEngines(), hasSize(0));
}
use of org.talend.components.api.testcomponent.TestComponentDefinition in project components by Talend.
the class ComponentDefinitionTest method testReturnProperties.
@Test
public void testReturnProperties() {
TestComponentDefinition tcd = new TestComponentDefinition();
Property[] props = tcd.getReturnProperties();
assertEquals("return1", props[0].getName());
assertEquals(5, props.length);
// Make sure i18N works
assertEquals("Error Message", props[1].getDisplayName());
assertEquals("Number of line", props[2].getDisplayName());
assertEquals("Number of success", props[3].getDisplayName());
assertEquals("Number of reject", props[4].getDisplayName());
}
Aggregations