Search in sources :

Example 1 with DataSource

use of jdk.incubator.sql2.DataSource in project syndesis-qe by syndesisio.

the class AtlasMapperGenerator method processTarget.

/**
 * Gets input data shape for specified step, which should follow after the mapping.
 *
 * @param followingStep
 * @return
 */
private DataSource processTarget(StepDefinition followingStep) {
    DataSource target = null;
    DataShape inDataShape = followingStep.getConnectorDescriptor().get().getInputDataShape().get();
    target = createDataSource(inDataShape, followingStep, DataSourceType.TARGET);
    return target;
}
Also used : DataShape(io.syndesis.common.model.DataShape) DataSource(io.atlasmap.v2.DataSource) JsonDataSource(io.atlasmap.json.v2.JsonDataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource)

Example 2 with DataSource

use of jdk.incubator.sql2.DataSource in project syndesis-qe by syndesisio.

the class AtlasMapperGenerator method getAtlasMappingStep.

public Step getAtlasMappingStep(StepDefinition mapping, List<StepDefinition> precedingSteps, StepDefinition followingStep) {
    processPrecedingSteps(precedingSteps);
    processFolowingStep(followingStep);
    List<DataMapperStepDefinition> mappings = mapping.getDataMapperDefinition().get().getDataMapperStepDefinition();
    AtlasMapping atlasMapping = new AtlasMapping();
    atlasMapping.setMappings(new Mappings());
    for (DataSource s : processSources(precedingSteps)) {
        atlasMapping.getDataSource().add(s);
    }
    atlasMapping.setName("REST." + UUID.randomUUID().toString());
    atlasMapping.setLookupTables(new LookupTables());
    atlasMapping.setProperties(new Properties());
    atlasMapping.getDataSource().add(processTarget(followingStep));
    atlasMapping.getMappings().getMapping().addAll(generateBaseMappings(mappings, precedingSteps, followingStep));
    ObjectMapper mapper = new ObjectMapper();
    mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
    String mapperString = null;
    try {
        mapperString = mapper.writeValueAsString(atlasMapping);
        log.debug(mapperString);
    } catch (JsonProcessingException e) {
        log.error("error: {}" + e);
    }
    final Step mapperStep = new Step.Builder().stepKind(StepKind.mapper).configuredProperties(TestUtils.map("atlasmapping", mapperString)).action(getMapperStepAction(followingStep.getConnectorDescriptor().get())).id(UUID.randomUUID().toString()).build();
    return mapperStep;
}
Also used : DataMapperStepDefinition(io.syndesis.qe.bdd.entities.DataMapperStepDefinition) AtlasMapping(io.atlasmap.v2.AtlasMapping) Mappings(io.atlasmap.v2.Mappings) LookupTables(io.atlasmap.v2.LookupTables) Step(io.syndesis.common.model.integration.Step) Properties(io.atlasmap.v2.Properties) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) DataSource(io.atlasmap.v2.DataSource) JsonDataSource(io.atlasmap.json.v2.JsonDataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource)

Example 3 with DataSource

use of jdk.incubator.sql2.DataSource in project atlasmap by atlasmap.

the class JavaJsonFlatMappingTest method generateDataSource.

protected DataSource generateDataSource(String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    return ds;
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Example 4 with DataSource

use of jdk.incubator.sql2.DataSource in project atlasmap by atlasmap.

the class XmlJsonFlatMappingTest method generateDataSource.

protected DataSource generateDataSource(String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    return ds;
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Example 5 with DataSource

use of jdk.incubator.sql2.DataSource in project atlasmap by atlasmap.

the class XmlJavaFlatMappingTest method generateDataSource.

protected DataSource generateDataSource(String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    return ds;
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Aggregations

DataSource (jdk.incubator.sql2.DataSource)96 Session (jdk.incubator.sql2.Session)88 Test (org.junit.Test)85 DataSource (io.atlasmap.v2.DataSource)54 ArrayList (java.util.ArrayList)50 AfterClass (org.junit.AfterClass)44 BeforeClass (org.junit.BeforeClass)44 TimeUnit (java.util.concurrent.TimeUnit)42 Collector (java.util.stream.Collector)36 ForkJoinPool (java.util.concurrent.ForkJoinPool)32 AdbaType (jdk.incubator.sql2.AdbaType)32 TestConfig (com.oracle.adbaoverjdbc.test.TestConfig)30 DataSourceFactory (jdk.incubator.sql2.DataSourceFactory)28 Assert (org.junit.Assert)28 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)24 List (java.util.List)23 CompletableFuture (java.util.concurrent.CompletableFuture)22 NoSuchElementException (java.util.NoSuchElementException)18 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)18 Column (jdk.incubator.sql2.Result.Column)18