Search in sources :

Example 1 with MetadataFactory

use of org.teiid.metadata.MetadataFactory in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testProcedures.

@Test
public void testProcedures() throws ResourceException {
    CouchbaseMetadataProcessor metadataProcessor = new CouchbaseMetadataProcessor();
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    metadataProcessor.addProcedures(mf, null);
    helpTest("procedures.expected", mf);
}
Also used : MetadataFactory(org.teiid.metadata.MetadataFactory) CouchbaseMetadataProcessor(org.teiid.translator.couchbase.CouchbaseMetadataProcessor) CouchbaseProperties(org.teiid.translator.couchbase.CouchbaseProperties) Properties(java.util.Properties) Test(org.junit.Test)

Example 2 with MetadataFactory

use of org.teiid.metadata.MetadataFactory in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testComplexJson.

@Test
public void testComplexJson() throws ResourceException {
    CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor();
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    Table table = createTable(mf, KEYSPACE, KEYSPACE);
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, complexJson(), mf, table, KEYSPACE, false, new Dimension());
    helpTest("complexJson.expected", mf);
}
Also used : Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) CouchbaseMetadataProcessor(org.teiid.translator.couchbase.CouchbaseMetadataProcessor) Dimension(org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension) CouchbaseProperties(org.teiid.translator.couchbase.CouchbaseProperties) Properties(java.util.Properties) Test(org.junit.Test)

Example 3 with MetadataFactory

use of org.teiid.metadata.MetadataFactory in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testCustomerOrderWithTypedName.

@Test
public void testCustomerOrderWithTypedName() throws ResourceException {
    CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor();
    mp.setTypeNameList("`test`:`type`,`beer-sample`:`type`,` travel-sample`:`type`");
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    Table customer = createTable(mf, KEYSPACE, "Customer");
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, formCustomer(), mf, customer, customer.getName(), false, new Dimension());
    Table order = createTable(mf, KEYSPACE, "Oder");
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, formOder(), mf, order, order.getName(), false, new Dimension());
    helpTest("customerOrderTypedName.expected", mf);
}
Also used : Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) CouchbaseMetadataProcessor(org.teiid.translator.couchbase.CouchbaseMetadataProcessor) Dimension(org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension) CouchbaseProperties(org.teiid.translator.couchbase.CouchbaseProperties) Properties(java.util.Properties) Test(org.junit.Test)

Example 4 with MetadataFactory

use of org.teiid.metadata.MetadataFactory in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testJsonNestedArray.

@Test
public void testJsonNestedArray() throws ResourceException {
    CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor();
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    Table table = createTable(mf, KEYSPACE, KEYSPACE);
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, complexJsonNestedArray(), mf, table, KEYSPACE, false, new Dimension());
    helpTest("complexJsonNestedArray.expected", mf);
}
Also used : Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) CouchbaseMetadataProcessor(org.teiid.translator.couchbase.CouchbaseMetadataProcessor) Dimension(org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension) CouchbaseProperties(org.teiid.translator.couchbase.CouchbaseProperties) Properties(java.util.Properties) Test(org.junit.Test)

Example 5 with MetadataFactory

use of org.teiid.metadata.MetadataFactory in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testCustomerOrderMultiple.

@Test
public void testCustomerOrderMultiple() throws ResourceException {
    CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor();
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    Table table = createTable(mf, KEYSPACE, KEYSPACE);
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, formCustomer(), mf, table, KEYSPACE, false, new Dimension());
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, formOder(), mf, table, KEYSPACE, false, new Dimension());
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, formCustomer(), mf, table, KEYSPACE, false, new Dimension());
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, formOder(), mf, table, KEYSPACE, false, new Dimension());
    helpTest("customerOrder.expected", mf);
}
Also used : Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) CouchbaseMetadataProcessor(org.teiid.translator.couchbase.CouchbaseMetadataProcessor) Dimension(org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension) CouchbaseProperties(org.teiid.translator.couchbase.CouchbaseProperties) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

MetadataFactory (org.teiid.metadata.MetadataFactory)159 Test (org.junit.Test)116 RealMetadataFactory (org.teiid.query.unittest.RealMetadataFactory)91 Properties (java.util.Properties)74 Table (org.teiid.metadata.Table)59 TransformationMetadata (org.teiid.query.metadata.TransformationMetadata)35 Procedure (org.teiid.metadata.Procedure)30 ModelMetaData (org.teiid.adminapi.impl.ModelMetaData)21 Column (org.teiid.metadata.Column)20 Connection (java.sql.Connection)18 FunctionTree (org.teiid.query.function.FunctionTree)15 UDFSource (org.teiid.query.function.UDFSource)14 CouchbaseMetadataProcessor (org.teiid.translator.couchbase.CouchbaseMetadataProcessor)14 Dimension (org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension)14 CouchbaseProperties (org.teiid.translator.couchbase.CouchbaseProperties)14 TranslationUtility (org.teiid.cdk.api.TranslationUtility)13 ValidatorReport (org.teiid.query.validator.ValidatorReport)13 XMLMetadata (org.apache.olingo.client.api.edm.xml.XMLMetadata)12 ClientCsdlXMLMetadata (org.apache.olingo.client.core.edm.ClientCsdlXMLMetadata)12 ForeignKey (org.teiid.metadata.ForeignKey)12