Search in sources :

Example 11 with CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testCustomerOrder.

@Test
public void testCustomerOrder() 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());
    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)

Example 12 with CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testNestedArray.

@Test
public void testNestedArray() 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, nestedArray(), mf, table, KEYSPACE, false, new Dimension());
    helpTest("nestedArray.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 13 with CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testMetadataCaseSensitive.

@Ignore("not resolved so far")
@Test
public void testMetadataCaseSensitive() throws ResourceException {
    CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor();
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    JsonObject json = JsonObject.create().put("name", "value").put("Name", "value").put("nAmE", "value");
    Table table = createTable(mf, KEYSPACE, KEYSPACE);
    mp.scanRow(KEYSPACE, KEYSPACE_SOURCE, json, mf, table, KEYSPACE, false, new Dimension());
    helpTest("TODO.expected", mf);
}
Also used : Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) CouchbaseMetadataProcessor(org.teiid.translator.couchbase.CouchbaseMetadataProcessor) JsonObject(com.couchbase.client.java.document.json.JsonObject) Dimension(org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension) CouchbaseProperties(org.teiid.translator.couchbase.CouchbaseProperties) Properties(java.util.Properties) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 14 with CouchbaseMetadataProcessor

use of org.teiid.translator.couchbase.CouchbaseMetadataProcessor in project teiid by teiid.

the class TestCouchbaseMetadataProcessor method testNullValue.

@Test
public void testNullValue() 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, formNullValueJson(), mf, table, KEYSPACE, false, new Dimension());
    helpTest("nullValue.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