Search in sources :

Example 26 with JDBCDatasetProperties

use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.

the class JDBCDatasetTestIT method testGetSampleWithoutDesignSchema.

@Test
public void testGetSampleWithoutDesignSchema() {
    JDBCDatasetProperties dataset = createDatasetProperties(false);
    getSampleAction(dataset);
}
Also used : JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) Test(org.junit.Test)

Example 27 with JDBCDatasetProperties

use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.

the class JDBCDatasetOracleTestIT method testGetSchema.

@Ignore
@Test
public void testGetSchema() {
    JDBCDatasetProperties dataset = createDatasetProperties();
    JDBCDatasetRuntime runtime = new JDBCDatasetRuntime();
    runtime.initialize(null, dataset);
    Schema schema = runtime.getSchema();
    Assert.assertNotNull(schema);
    Assert.assertEquals(2, schema.getFields().size());
}
Also used : JDBCDatasetRuntime(org.talend.components.jdbc.runtime.dataprep.JDBCDatasetRuntime) Schema(org.apache.avro.Schema) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 28 with JDBCDatasetProperties

use of org.talend.components.jdbc.dataset.JDBCDatasetProperties in project components by Talend.

the class JDBCInputTestIT method createCommonJDBCInputProperties.

private JDBCInputProperties createCommonJDBCInputProperties(JDBCInputDefinition definition) {
    JDBCDatastoreDefinition datastore_def = new JDBCDatastoreDefinition();
    JDBCDatastoreProperties datastore_props = new JDBCDatastoreProperties("datastore");
    datastore_props.dbTypes.setValue("DERBY");
    datastore_props.afterDbTypes();
    datastore_props.jdbcUrl.setValue(allSetting.getJdbcUrl());
    datastore_props.userId.setValue(allSetting.getUsername());
    datastore_props.password.setValue(allSetting.getPassword());
    JDBCDatasetProperties dataset = (JDBCDatasetProperties) datastore_def.createDatasetProperties(datastore_props);
    dataset.sql.setValue(DBTestUtils.getSQL(tablename));
    updateSchema(dataset);
    JDBCInputProperties properties = (JDBCInputProperties) definition.createRuntimeProperties();
    properties.setDatasetProperties(dataset);
    return properties;
}
Also used : JDBCDatastoreDefinition(org.talend.components.jdbc.datastore.JDBCDatastoreDefinition) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Aggregations

JDBCDatasetProperties (org.talend.components.jdbc.dataset.JDBCDatasetProperties)28 Test (org.junit.Test)19 JDBCDatastoreProperties (org.talend.components.jdbc.datastore.JDBCDatastoreProperties)12 Schema (org.apache.avro.Schema)8 JDBCDatastoreDefinition (org.talend.components.jdbc.datastore.JDBCDatastoreDefinition)5 JDBCDatasetRuntime (org.talend.components.jdbc.runtime.dataprep.JDBCDatasetRuntime)4 AllSetting (org.talend.components.jdbc.runtime.setting.AllSetting)4 Ignore (org.junit.Ignore)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 Response (com.jayway.restassured.response.Response)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 Statement (java.sql.Statement)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 PipelineResult (org.apache.beam.sdk.PipelineResult)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1 DatasetRuntime (org.talend.components.common.dataset.runtime.DatasetRuntime)1