use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class ComponentDefinitionTest method testRuntimeEngine.
@Test
public void testRuntimeEngine() {
TestComponentDefinition cd = new TestComponentDefinition();
assertThat(cd.getSupportedExecutionEngines(), containsInAnyOrder(ExecutionEngine.DI));
assertTrue(cd.isSupportingExecutionEngines(ExecutionEngine.DI));
// Nothing is returned, but there isn't any exception.
RuntimeInfo ri = cd.getRuntimeInfo(ExecutionEngine.DI, null, null);
assertThat(ri, nullValue());
// Requesting a wrong execution engine causes an exception.
thrown.expect(TalendRuntimeException.class);
thrown.expect(hasProperty("code", is(ComponentsErrorCode.WRONG_EXECUTION_ENGINE)));
thrown.expectMessage("WRONG_EXECUTION_ENGINE:{component=TestComponent, requested=BEAM, available=[DI]}");
ri = cd.getRuntimeInfo(ExecutionEngine.BEAM, null, null);
fail("An exception must have been thrown.");
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class NetSuiteInputDefinitionTest method testRuntimeInfo.
@Test
public void testRuntimeInfo() {
NetSuiteInputProperties properties = new NetSuiteInputProperties("test");
properties.initForRuntime();
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.OUTGOING);
assertNotNull(runtimeInfo);
assertThat(runtimeInfo, instanceOf(JarRuntimeInfo.class));
JarRuntimeInfo jarRuntimeInfo = (JarRuntimeInfo) runtimeInfo;
assertThat(jarRuntimeInfo.getRuntimeClassName(), endsWith(".NetSuiteSourceImpl"));
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class NetSuiteRuntimeInfoTest method testRuntimeVersion.
public void testRuntimeVersion(String apiVersion) throws Exception {
NetSuiteConnectionProperties connProps = new NetSuiteConnectionProperties("test");
connProps.setupProperties();
connProps.endpoint.setValue("https://webservices.netsuite.com/services/NetSuitePort_" + apiVersion);
connProps.apiVersion.setValue(NetSuiteVersion.detectVersion(connProps.endpoint.getStringValue()).getMajorAsString("."));
RuntimeInfo runtimeInfo = NetSuiteComponentDefinition.getRuntimeInfo(connProps, NetSuiteComponentDefinition.RUNTIME_CLASS);
assertNotNull(runtimeInfo);
assertThat(runtimeInfo, instanceOf(JarRuntimeInfo.class));
JarRuntimeInfo jarRuntimeInfo = (JarRuntimeInfo) runtimeInfo;
assertNotNull(jarRuntimeInfo.getJarUrl());
assertNotNull(jarRuntimeInfo.getDepTxtPath());
assertEquals(jarRuntimeInfo.getRuntimeClassName(), "org.talend.components.netsuite.v" + apiVersion + ".NetSuiteRuntimeImpl");
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class TSnowflakeRowDefinitionTest method testGetRuntimeInfo.
@Test
public void testGetRuntimeInfo() {
TSnowflakeRowProperties properties = new TSnowflakeRowProperties("rowProperties");
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.INCOMING);
Assert.assertEquals(SnowflakeRowSink.class.getName(), runtimeInfo.getRuntimeClassName());
runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
Assert.assertEquals(SnowflakeRowSink.class.getName(), runtimeInfo.getRuntimeClassName());
runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.NONE);
Assert.assertEquals(SnowflakeRowStandalone.class.getName(), runtimeInfo.getRuntimeClassName());
runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.OUTGOING);
Assert.assertEquals(SnowflakeRowSource.class.getName(), runtimeInfo.getRuntimeClassName());
}
use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.
the class TSnowflakeOutputDefinitionTest method testGetRuntimeInfo.
@Test
public void testGetRuntimeInfo() {
RuntimeInfo runtimeInfoForIncomingTopology;
RuntimeInfo runtimeInfoForIncomingAndOutgoingTopology;
runtimeInfoForIncomingTopology = outputDefinition.getRuntimeInfo(ExecutionEngine.DI, null, ConnectorTopology.INCOMING);
runtimeInfoForIncomingAndOutgoingTopology = outputDefinition.getRuntimeInfo(ExecutionEngine.DI, null, ConnectorTopology.INCOMING_AND_OUTGOING);
assertNotNull(runtimeInfoForIncomingTopology);
assertNotNull(runtimeInfoForIncomingAndOutgoingTopology);
}
Aggregations