Search in sources :

Example 91 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class TJDBCInputDefinitionTest method testGetRuntimeInfo.

/**
 * Run the RuntimeInfo getRuntimeInfo(ExecutionEngine,ComponentProperties,ConnectorTopology) method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 17-6-20 PM3:13
 */
@Test
public void testGetRuntimeInfo() throws Exception {
    AllSetting allSetting = Mockito.mock(AllSetting.class);
    Mockito.when(allSetting.getDriverClass()).thenReturn("anyDriverClass");
    TJDBCInputProperties properties = Mockito.mock(TJDBCInputProperties.class);
    Mockito.when(properties.getRuntimeSetting()).thenReturn(allSetting);
    TJDBCInputDefinition fixture = new TJDBCInputDefinition();
    ExecutionEngine engine = ExecutionEngine.DI;
    RuntimeInfo result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.OUTGOING);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.NONE);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
    assertNotNull(result);
}
Also used : ExecutionEngine(org.talend.components.api.component.runtime.ExecutionEngine) AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Example 92 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class TJDBCRollbackDefinitionTest method testGetRuntimeInfo.

/**
 * Run the RuntimeInfo getRuntimeInfo(ExecutionEngine,ComponentProperties,ConnectorTopology) method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 17-6-20 PM3:14
 */
@Test
public void testGetRuntimeInfo() throws Exception {
    AllSetting allSetting = Mockito.mock(AllSetting.class);
    Mockito.when(allSetting.getDriverClass()).thenReturn("anyDriverClass");
    TJDBCRollbackProperties properties = Mockito.mock(TJDBCRollbackProperties.class);
    Mockito.when(properties.getRuntimeSetting()).thenReturn(allSetting);
    TJDBCRollbackDefinition fixture = new TJDBCRollbackDefinition();
    ExecutionEngine engine = ExecutionEngine.DI;
    RuntimeInfo result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.NONE);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.OUTGOING);
    assertNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
    assertNotNull(result);
}
Also used : ExecutionEngine(org.talend.components.api.component.runtime.ExecutionEngine) AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Example 93 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class TJiraInputDefinitionTest method testGetRuntime.

/**
 * Check {@link TJiraInputDefinition#getRuntime()} returns instance of {@link JiraSource}
 */
@Test
public void testGetRuntime() {
    TJiraInputDefinition definition = new TJiraInputDefinition();
    RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, null, ConnectorTopology.OUTGOING);
    SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, definition.getClass().getClassLoader());
    Source source = (Source) sandboxedInstance.getInstance();
    assertThat(source, is(instanceOf(JiraSource.class)));
}
Also used : SandboxedInstance(org.talend.daikon.sandbox.SandboxedInstance) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) JiraSource(org.talend.components.jira.runtime.JiraSource) Source(org.talend.components.api.component.runtime.Source) Test(org.junit.Test)

Example 94 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class KafkaDatasetDefinitionTest method getRuntimeInfo.

@Test
public void getRuntimeInfo() throws Exception {
    RuntimeInfo runtimeInfo = definition.getRuntimeInfo(null);
    assertNotNull(runtimeInfo);
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Example 95 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class KafkaDatastoreDefinitionTest method getRuntimeInfo.

@Test
public void getRuntimeInfo() throws Exception {
    RuntimeInfo runtimeInfo = definition.getRuntimeInfo(null);
    assertNotNull(runtimeInfo);
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Aggregations

RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)131 Test (org.junit.Test)120 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)27 Ignore (org.junit.Ignore)21 JarRuntimeInfo (org.talend.components.api.component.runtime.JarRuntimeInfo)17 ArrayList (java.util.ArrayList)13 AllSetting (org.talend.components.jdbc.runtime.setting.AllSetting)11 IndexedRecord (org.apache.avro.generic.IndexedRecord)8 ExecutionEngine (org.talend.components.api.component.runtime.ExecutionEngine)8 DatasetRuntime (org.talend.components.common.dataset.runtime.DatasetRuntime)7 URL (java.net.URL)6 Schema (org.apache.avro.Schema)6 ComponentException (org.talend.components.api.exception.ComponentException)5 ValidationResult (org.talend.daikon.properties.ValidationResult)5 File (java.io.File)3 NamedThing (org.talend.daikon.NamedThing)3 SimpleNamedThing (org.talend.daikon.SimpleNamedThing)3 TalendRuntimeException (org.talend.daikon.exception.TalendRuntimeException)3 FileWriter (java.io.FileWriter)2 GenericRecord (org.apache.avro.generic.GenericRecord)2