Search in sources :

Example 6 with ExecutionEngine

use of org.talend.components.api.component.runtime.ExecutionEngine in project components by Talend.

the class TJDBCCloseDefinitionTest 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");
    TJDBCCloseProperties properties = Mockito.mock(TJDBCCloseProperties.class);
    Mockito.when(properties.getRuntimeSetting()).thenReturn(allSetting);
    TJDBCCloseDefinition fixture = new TJDBCCloseDefinition();
    ExecutionEngine engine = ExecutionEngine.DI;
    RuntimeInfo result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.NONE);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING);
    assertNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.OUTGOING);
    assertNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
    assertNull(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 7 with ExecutionEngine

use of org.talend.components.api.component.runtime.ExecutionEngine in project components by Talend.

the class TJDBCCommitDefinitionTest 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");
    TJDBCCommitProperties properties = Mockito.mock(TJDBCCommitProperties.class);
    Mockito.when(properties.getRuntimeSetting()).thenReturn(allSetting);
    TJDBCCommitDefinition fixture = new TJDBCCommitDefinition();
    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 8 with ExecutionEngine

use of org.talend.components.api.component.runtime.ExecutionEngine in project components by Talend.

the class TJDBCConnectionDefinitionTest method testGetRuntimeInfo.

/**
 * Run the RuntimeInfo getRuntimeInfo(ExecutionEngine,ComponentProperties,ConnectorTopology) method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 17-6-20 PM3:16
 */
@Test
public void testGetRuntimeInfo() throws Exception {
    AllSetting allSetting = Mockito.mock(AllSetting.class);
    Mockito.when(allSetting.getDriverClass()).thenReturn("anyDriverClass");
    TJDBCConnectionProperties properties = Mockito.mock(TJDBCConnectionProperties.class);
    Mockito.when(properties.getRuntimeSetting()).thenReturn(allSetting);
    TJDBCConnectionDefinition fixture = new TJDBCConnectionDefinition();
    ExecutionEngine engine = ExecutionEngine.DI;
    RuntimeInfo result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.NONE);
    assertNotNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING);
    assertNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.OUTGOING);
    assertNull(result);
    result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
    assertNull(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 9 with ExecutionEngine

use of org.talend.components.api.component.runtime.ExecutionEngine 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 10 with ExecutionEngine

use of org.talend.components.api.component.runtime.ExecutionEngine 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)

Aggregations

ExecutionEngine (org.talend.components.api.component.runtime.ExecutionEngine)10 Test (org.junit.Test)9 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)8 AllSetting (org.talend.components.jdbc.runtime.setting.AllSetting)7 ComponentDefinition (org.talend.components.api.component.ComponentDefinition)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 RestAssured.when (com.jayway.restassured.RestAssured.when)1 Response (com.jayway.restassured.response.Response)1 IOException (java.io.IOException)1 Arrays.asList (java.util.Arrays.asList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Function (java.util.function.Function)1 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 Matchers.hasSize (org.hamcrest.Matchers.hasSize)1 Assert.assertEquals (org.junit.Assert.assertEquals)1