Search in sources :

Example 1 with CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor 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 CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor 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 CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor 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 CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor 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 CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor 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

Properties (java.util.Properties)14 Test (org.junit.Test)14 MetadataFactory (org.teiid.metadata.MetadataFactory)14 CouchbaseMetadataProcessor (org.teiid.translator.couchbase.CouchbaseMetadataProcessor)14 CouchbaseProperties (org.teiid.translator.couchbase.CouchbaseProperties)14 Table (org.teiid.metadata.Table)13 Dimension (org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension)13 JsonObject (com.couchbase.client.java.document.json.JsonObject)1 Ignore (org.junit.Ignore)1