use of org.talend.components.jdbc.runtime.dataprep.JDBCDatasetRuntime 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.runtime.dataprep.JDBCDatasetRuntime in project components by Talend.
the class JDBCDatasetOracleTestIT method getSampleAction.
private void getSampleAction(JDBCDatasetProperties dataset) {
JDBCDatasetRuntime runtime = new JDBCDatasetRuntime();
runtime.initialize(null, dataset);
final IndexedRecord[] record = new IndexedRecord[1];
Consumer<IndexedRecord> storeTheRecords = new Consumer<IndexedRecord>() {
@Override
public void accept(IndexedRecord data) {
record[0] = data;
}
};
runtime.getSample(1, storeTheRecords);
Assert.assertEquals(new BigDecimal("1"), record[0].get(0));
Assert.assertEquals("wangwei", record[0].get(1));
}
use of org.talend.components.jdbc.runtime.dataprep.JDBCDatasetRuntime in project components by Talend.
the class JDBCInputTestIT method updateSchema.
protected void updateSchema(JDBCDatasetProperties dataset) {
JDBCDatasetRuntime runtime = new JDBCDatasetRuntime();
runtime.initialize(null, dataset);
dataset.main.schema.setValue(runtime.getSchema());
}
use of org.talend.components.jdbc.runtime.dataprep.JDBCDatasetRuntime 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.runtime.dataprep.JDBCDatasetRuntime in project components by Talend.
the class JdbcDatasetTestIT method getSampleAction.
private void getSampleAction(JDBCDatasetProperties dataset) {
JDBCDatasetRuntime runtime = new JDBCDatasetRuntime();
runtime.initialize(null, dataset);
final IndexedRecord[] record = new IndexedRecord[1];
Consumer<IndexedRecord> storeTheRecords = new Consumer<IndexedRecord>() {
@Override
public void accept(IndexedRecord data) {
record[0] = data;
}
};
runtime.getSample(1, storeTheRecords);
Assert.assertEquals("1", record[0].get(0));
Assert.assertEquals("wangwei", record[0].get(1));
}
Aggregations