Search in sources :

Example 21 with JDBCDatasetProperties

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

the class JDBCOutputPropertiesTest method testGetRuntimeSetting.

@Test
public void testGetRuntimeSetting() {
    JDBCOutputProperties fixture = new JDBCOutputProperties("output");
    JDBCDatasetProperties dataset = new JDBCDatasetProperties("dataset");
    JDBCDatastoreProperties datastore = new JDBCDatastoreProperties("datastore");
    datastore.init();
    dataset.setDatastoreProperties(datastore);
    fixture.setDatasetProperties(dataset);
    AllSetting result = fixture.getRuntimeSetting();
    assertNotNull(result);
}
Also used : AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties) Test(org.junit.Test)

Example 22 with JDBCDatasetProperties

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

the class JDBCInputPropertiesTest method testGetDatasetProperties.

/**
 * Run the JDBCDatasetProperties getDatasetProperties() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 17-6-23 AM11:58
 */
@Test
public void testGetDatasetProperties() throws Exception {
    JDBCInputProperties fixture = new JDBCInputProperties("input");
    fixture.init();
    fixture.setDatasetProperties(new JDBCDatasetProperties("dataset"));
    JDBCDatasetProperties result = fixture.getDatasetProperties();
    assertNotNull(result);
}
Also used : JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) Test(org.junit.Test)

Example 23 with JDBCDatasetProperties

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

the class JDBCDatastoreDefinition method createDatasetProperties.

@SuppressWarnings("rawtypes")
@Override
public DatasetProperties createDatasetProperties(JDBCDatastoreProperties storeProp) {
    JDBCDatasetProperties datasetProperties = new JDBCDatasetProperties("dataset");
    datasetProperties.init();
    datasetProperties.setDatastoreProperties(storeProp);
    return datasetProperties;
}
Also used : JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties)

Example 24 with JDBCDatasetProperties

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

the class JDBCDatasetTestIT method testGetSchemaFromTable.

@Test
public void testGetSchemaFromTable() throws IOException {
    JDBCDatasetProperties dataset = createDatasetProperties(false);
    JDBCDatasetRuntime runtime = new JDBCDatasetRuntime();
    runtime.initialize(null, dataset);
    JDBCSourceOrSink jss = new JDBCSourceOrSink();
    jss.initialize(null, dataset);
    Schema schema = jss.getEndpointSchema(null, tablename);
    Assert.assertNotNull(schema);
    DBTestUtils.testMetadata(schema.getFields(), true);
    jss.getEndpointSchema(null, tablename_all_type);
// TODO assert the result
}
Also used : JDBCSourceOrSink(org.talend.components.jdbc.runtime.JDBCSourceOrSink) JDBCDatasetRuntime(org.talend.components.jdbc.runtime.dataprep.JDBCDatasetRuntime) Schema(org.apache.avro.Schema) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) Test(org.junit.Test)

Example 25 with JDBCDatasetProperties

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

the class JDBCDatasetTestIT method testUpdateSchema.

@Test
public void testUpdateSchema() {
    JDBCDatasetProperties dataset = createDatasetProperties(true);
    Schema schema = dataset.main.schema.getValue();
    Assert.assertNotNull(schema);
    DBTestUtils.testMetadata(schema.getFields(), true);
}
Also used : Schema(org.apache.avro.Schema) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) Test(org.junit.Test)

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