use of org.talend.components.jdbc.runtime.JDBCSource in project components by Talend.
the class JDBCInputTestIT method testGetSchemaFromQueryWithException2.
@Test(expected = ComponentException.class)
public void testGetSchemaFromQueryWithException2() throws Exception {
TJDBCInputDefinition definition = new TJDBCInputDefinition();
TJDBCInputProperties properties = DBTestUtils.createCommonJDBCInputProperties(allSetting, definition);
properties.connection.driverClass.setValue("notexist");
JDBCSource source = DBTestUtils.createCommonJDBCSource(properties);
try {
source.getSchemaFromQuery(null, "select * from " + tablename);
} catch (ComponentException e) {
String message = CommonUtils.getClearExceptionInfo(e);
assertTrue(message.contains("notexist"));
throw e;
}
}
use of org.talend.components.jdbc.runtime.JDBCSource in project components by Talend.
the class JDBCInputTestIT method testGetSchemaWithException.
@Test(expected = ComponentException.class)
public void testGetSchemaWithException() throws Exception {
TJDBCInputDefinition definition = new TJDBCInputDefinition();
TJDBCInputProperties properties = DBTestUtils.createCommonJDBCInputProperties(allSetting, definition);
properties.connection.driverClass.setValue("notexist");
JDBCSource source = DBTestUtils.createCommonJDBCSource(properties);
try {
source.getEndpointSchema(null, tablename);
} catch (ComponentException e) {
String message = CommonUtils.getClearExceptionInfo(e);
assertTrue(message.contains("notexist"));
throw e;
}
}
Aggregations