Search in sources :

Example 1 with Dimension

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

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

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

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

Example 5 with Dimension

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

the class TestCouchbaseMetadataProcessor method testCustomerWithDuplicatedTypedName.

@Test
public void testCustomerWithDuplicatedTypedName() throws ResourceException {
    CouchbaseMetadataProcessor mp = new CouchbaseMetadataProcessor();
    mp.setTypeNameList("`test`:`type`,`test2`:`type`");
    MetadataFactory mf = new MetadataFactory("vdb", 1, "couchbase", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null);
    String typedName = "Customer";
    String keyspace1 = "test";
    String keyspace2 = "test2";
    Table table1 = createTable(mf, keyspace1, typedName);
    mp.scanRow("test", KEYSPACE_SOURCE, formCustomer(), mf, table1, table1.getName(), false, new Dimension());
    Table table2 = createTable(mf, keyspace2, typedName);
    mp.scanRow("test2", "`test2`", formCustomer(), mf, table2, table2.getName(), false, new Dimension());
    helpTest("customerDuplicatedTypedName.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)14 Table (org.teiid.metadata.Table)14 Dimension (org.teiid.translator.couchbase.CouchbaseMetadataProcessor.Dimension)14 Properties (java.util.Properties)13 Test (org.junit.Test)13 CouchbaseMetadataProcessor (org.teiid.translator.couchbase.CouchbaseMetadataProcessor)13 CouchbaseProperties (org.teiid.translator.couchbase.CouchbaseProperties)13 JsonObject (com.couchbase.client.java.document.json.JsonObject)1 Ignore (org.junit.Ignore)1 ModelMetaData (org.teiid.adminapi.impl.ModelMetaData)1 MetadataException (org.teiid.metadata.MetadataException)1 MetadataValidator (org.teiid.query.metadata.MetadataValidator)1 TransformationMetadata (org.teiid.query.metadata.TransformationMetadata)1 RealMetadataFactory (org.teiid.query.unittest.RealMetadataFactory)1 ValidatorReport (org.teiid.query.validator.ValidatorReport)1 TestCouchbaseMetadataProcessor (org.teiid.translator.couchbase.TestCouchbaseMetadataProcessor)1