use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.
the class JDBCDatasetTestIT method testGetSampleWithValidDesignSchema.
@Test
public void testGetSampleWithValidDesignSchema() {
JDBCDatasetProperties dataset = createDatasetProperties(true);
getSampleAction(dataset);
}
use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.
the class JDBCDatasetTestIT method createDatasetProperties.
private JDBCDatasetProperties createDatasetProperties(boolean updateSchema) {
JDBCDatastoreDefinition def = new JDBCDatastoreDefinition();
JDBCDatastoreProperties datastore = new JDBCDatastoreProperties("datastore");
datastore.dbTypes.setValue("DERBY");
datastore.afterDbTypes();
datastore.jdbcUrl.setValue(allSetting.getJdbcUrl());
datastore.userId.setValue(allSetting.getUsername());
datastore.password.setValue(allSetting.getPassword());
JDBCDatasetProperties dataset = (JDBCDatasetProperties) def.createDatasetProperties(datastore);
dataset.sql.setValue(DBTestUtils.getSQL(tablename));
if (updateSchema) {
updateSchema(dataset);
}
return dataset;
}
use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.
the class JDBCDatasetTestIT method testGetSchema.
@Test
public void testGetSchema() {
JDBCDatasetProperties dataset = createDatasetProperties(false);
JDBCDatasetRuntime runtime = new JDBCDatasetRuntime();
runtime.initialize(null, dataset);
Schema schema = runtime.getSchema();
Assert.assertNotNull(schema);
DBTestUtils.testMetadata(schema.getFields(), true);
}
use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.
the class JDBCDatasetTestIT method testDoHealthChecks.
@Test
public void testDoHealthChecks() {
JDBCDatasetProperties dataset = createDatasetProperties(true);
JDBCDatastoreRuntime runtime = new JDBCDatastoreRuntime();
runtime.initialize(null, dataset.getDatastoreProperties());
Iterable<ValidationResult> result = runtime.doHealthChecks(null);
Assert.assertNotNull(result);
Iterator<ValidationResult> iterator = result.iterator();
Assert.assertTrue(iterator.hasNext());
Assert.assertEquals(ValidationResult.Result.OK, iterator.next().getStatus());
}
use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.
the class JDBCDatasetOracleTestIT method testGetSampleWithoutDesignSchema.
@Ignore
@Test
public void testGetSampleWithoutDesignSchema() {
JDBCDatasetProperties dataset = createDatasetProperties();
getSampleAction(dataset);
}
Aggregations