Search in sources :

Example 16 with DataSource

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

the class JavaValidationServiceTest method generateDataSource.

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

Example 17 with DataSource

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

the class BaseMarshallerTest method generateDataSource.

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

Example 18 with DataSource

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

the class JsonJsonFlatMappingTest 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 19 with DataSource

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

the class XmlFieldReaderTest method mockDataSources.

private void mockDataSources(String docId, AtlasInternalSession session) {
    AtlasMapping atlasMapping = mock(AtlasMapping.class);
    List<DataSource> dataSources = new ArrayList<>();
    XmlDataSource xmlDataSource = new XmlDataSource();
    xmlDataSource.setId(docId);
    xmlDataSource.setDataSourceType(DataSourceType.SOURCE);
    XmlNamespaces atlasNamespaces = new XmlNamespaces();
    XmlNamespace xmlNamespaceQ = new XmlNamespace();
    xmlNamespaceQ.setAlias("q");
    xmlNamespaceQ.setUri("http://www.example.com/q/");
    XmlNamespace xmlNamespaceX = new XmlNamespace();
    xmlNamespaceX.setAlias("");
    xmlNamespaceX.setUri("http://www.example.com/x/");
    XmlNamespace xmlNamespaceY = new XmlNamespace();
    xmlNamespaceY.setAlias("y");
    xmlNamespaceY.setUri("http://www.example.com/y/");
    atlasNamespaces.getXmlNamespace().add(xmlNamespaceQ);
    atlasNamespaces.getXmlNamespace().add(xmlNamespaceX);
    atlasNamespaces.getXmlNamespace().add(xmlNamespaceY);
    xmlDataSource.setXmlNamespaces(atlasNamespaces);
    dataSources.add(xmlDataSource);
    when(atlasMapping.getDataSource()).thenReturn(dataSources);
    when(session.getMapping()).thenReturn(atlasMapping);
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) XmlNamespace(io.atlasmap.xml.v2.XmlNamespace) ArrayList(java.util.ArrayList) XmlNamespaces(io.atlasmap.xml.v2.XmlNamespaces) DataSource(io.atlasmap.v2.DataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource)

Example 20 with DataSource

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

the class AtlasMapperGenerator method processSources.

/**
 * Gets list of output data shapes for preceding steps.
 *
 * @return list of datasources from preceding steps
 */
private List<DataSource> processSources() {
    List<DataSource> sources = new ArrayList<>();
    precedingSteps.stream().filter(s -> s.getStep().getAction().isPresent()).forEach(s -> {
        DataShape outDataShape = s.getStep().getAction().get().getOutputDataShape().get();
        // Steps with "ANY" or "NONE" are ignored for sources and only those that have proper datashape are used
        if (outDataShape.getKind() != DataShapeKinds.ANY && outDataShape.getKind() != DataShapeKinds.NONE) {
            sources.add(createDataSource(outDataShape, s, DataSourceType.SOURCE));
        }
    });
    return sources;
}
Also used : JsonInspectionResponse(io.atlasmap.json.v2.JsonInspectionResponse) Action(io.syndesis.common.model.action.Action) Step(io.syndesis.common.model.integration.Step) XmlComplexType(io.atlasmap.xml.v2.XmlComplexType) DataSource(io.atlasmap.v2.DataSource) Autowired(org.springframework.beans.factory.annotation.Autowired) MappingType(io.atlasmap.v2.MappingType) DataMapperStepDefinition(io.syndesis.qe.entities.DataMapperStepDefinition) JsonDataSource(io.atlasmap.json.v2.JsonDataSource) StringUtils(org.apache.commons.lang3.StringUtils) DeserializationFeature(com.fasterxml.jackson.databind.DeserializationFeature) ArrayList(java.util.ArrayList) JSONObject(org.json.JSONObject) StepDescriptor(io.syndesis.common.model.action.StepDescriptor) JsonUtils(io.syndesis.common.util.json.JsonUtils) Field(io.atlasmap.v2.Field) XmlInspectionResponse(io.atlasmap.xml.v2.XmlInspectionResponse) StepKind(io.syndesis.common.model.integration.StepKind) JavaClass(io.atlasmap.java.v2.JavaClass) StepDefinition(io.syndesis.qe.entities.StepDefinition) BaseMapping(io.atlasmap.v2.BaseMapping) LookupTables(io.atlasmap.v2.LookupTables) DataShape(io.syndesis.common.model.DataShape) StepAction(io.syndesis.common.model.action.StepAction) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) AtlasmapEndpoint(io.syndesis.qe.endpoint.AtlasmapEndpoint) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) DataShapeKinds(io.syndesis.common.model.DataShapeKinds) Properties(io.atlasmap.v2.Properties) DataSourceType(io.atlasmap.v2.DataSourceType) Mapping(io.atlasmap.v2.Mapping) Component(org.springframework.stereotype.Component) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) Assertions.fail(org.assertj.core.api.Assertions.fail) TestUtils(io.syndesis.qe.utils.TestUtils) XmlNamespaces(io.atlasmap.xml.v2.XmlNamespaces) AtlasMapping(io.atlasmap.v2.AtlasMapping) JavaField(io.atlasmap.java.v2.JavaField) SerializationFeature(com.fasterxml.jackson.databind.SerializationFeature) Mappings(io.atlasmap.v2.Mappings) Collections(java.util.Collections) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource) JsonComplexType(io.atlasmap.json.v2.JsonComplexType) ArrayList(java.util.ArrayList) DataShape(io.syndesis.common.model.DataShape) DataSource(io.atlasmap.v2.DataSource) JsonDataSource(io.atlasmap.json.v2.JsonDataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource)

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