use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class TJDBCCommitProperties method getRuntimeSetting.
@Override
public AllSetting getRuntimeSetting() {
AllSetting setting = new AllSetting();
CommonUtils.setReferenceInfo(setting, referencedComponent);
setting.setCloseConnection(this.closeConnection.getValue());
return setting;
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class JdbcRuntimeInfoTest method createPropsWithDriverName.
/**
* Creates instance of {@link RuntimeSettingProvider} with specified driver class name
*
* @param driverName driver class name
* @return new instance of {@link RuntimeSettingProvider}
*/
private static RuntimeSettingProvider createPropsWithDriverName(String driverName) {
AllSetting allSetting = Mockito.mock(AllSetting.class);
Mockito.when(allSetting.getDriverClass()).thenReturn(driverName);
RuntimeSettingProvider runtimeSettingProvider = Mockito.mock(RuntimeSettingProvider.class);
Mockito.when(runtimeSettingProvider.getRuntimeSetting()).thenReturn(allSetting);
return runtimeSettingProvider;
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class TJDBCOutputDefinitionTest 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");
TJDBCOutputProperties properties = Mockito.mock(TJDBCOutputProperties.class);
Mockito.when(properties.getRuntimeSetting()).thenReturn(allSetting);
TJDBCOutputDefinition fixture = new TJDBCOutputDefinition();
ExecutionEngine engine = ExecutionEngine.DI;
RuntimeInfo result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING);
assertNotNull(result);
result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.INCOMING_AND_OUTGOING);
assertNotNull(result);
result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.NONE);
assertNull(result);
result = fixture.getRuntimeInfo(engine, properties, ConnectorTopology.OUTGOING);
assertNull(result);
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class TJDBCCloseProperties method getRuntimeSetting.
@Override
public AllSetting getRuntimeSetting() {
AllSetting setting = new AllSetting();
CommonUtils.setReferenceInfo(setting, referencedComponent);
return setting;
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class CommonUtilsTest method testSetCommonConnectionInfo.
@Test
public void testSetCommonConnectionInfo() {
JDBCConnectionModule module = new JDBCConnectionModule("module");
module.jdbcUrl.setValue("url");
AllSetting setting = new AllSetting();
CommonUtils.setCommonConnectionInfo(setting, module);
Assert.assertEquals("url", setting.getJdbcUrl());
}
Aggregations