Search in sources :

Example 1 with LoopbackExecutionFactory

use of org.teiid.translator.loopback.LoopbackExecutionFactory in project teiid by teiid.

the class TestODataIntegration method before.

@Before
public void before() throws Exception {
    TimestampWithTimezone.resetCalendar(TimeZone.getTimeZone("UTC"));
    teiid = new EmbeddedServer();
    EmbeddedConfiguration config = new EmbeddedConfiguration();
    config.setTransactionManager(new DummyBaseTransactionManager());
    teiid.start(config);
    ef = new LoopbackExecutionFactory() {

        @Override
        public boolean supportsRowOffset() {
            return false;
        }
    };
    teiid.addTranslator("loopback", ef);
    createContext("/odata4", null);
    deployVDB();
}
Also used : DummyBaseTransactionManager(org.infinispan.transaction.tm.DummyBaseTransactionManager) EmbeddedServer(org.teiid.runtime.EmbeddedServer) LoopbackExecutionFactory(org.teiid.translator.loopback.LoopbackExecutionFactory) EmbeddedConfiguration(org.teiid.runtime.EmbeddedConfiguration) Before(org.junit.Before)

Example 2 with LoopbackExecutionFactory

use of org.teiid.translator.loopback.LoopbackExecutionFactory in project teiid by teiid.

the class TestASTQueries method setUp.

@BeforeClass
public static void setUp() throws Exception {
    server = new EmbeddedServer();
    server.start(new EmbeddedConfiguration());
    LoopbackExecutionFactory loopy = new LoopbackExecutionFactory();
    loopy.setRowCount(10);
    loopy.start();
    server.addTranslator("l", loopy);
    String DDL = "CREATE FOREIGN TABLE G1 (e1 string, e2 integer);";
    ModelMetaData model = new ModelMetaData();
    model.setName("PM1");
    model.setModelType(Model.Type.PHYSICAL);
    model.setSchemaSourceType("DDL");
    model.setSchemaText(DDL);
    SourceMappingMetadata sm = new SourceMappingMetadata();
    sm.setName("loopy");
    sm.setTranslatorName("l");
    model.addSourceMapping(sm);
    server.deployVDB("test", model);
}
Also used : SourceMappingMetadata(org.teiid.adminapi.impl.SourceMappingMetadata) EmbeddedServer(org.teiid.runtime.EmbeddedServer) LoopbackExecutionFactory(org.teiid.translator.loopback.LoopbackExecutionFactory) EmbeddedConfiguration(org.teiid.runtime.EmbeddedConfiguration) ModelMetaData(org.teiid.adminapi.impl.ModelMetaData) BeforeClass(org.junit.BeforeClass)

Example 3 with LoopbackExecutionFactory

use of org.teiid.translator.loopback.LoopbackExecutionFactory in project teiid by teiid.

the class TestLoobackAsynch method test.

public void test() throws Exception {
    LoopbackExecutionFactory connector = new LoopbackExecutionFactory();
    connector.setWaitTime(200);
    connector.setRowCount(1000);
    connector.setPollIntervalInMilli(100L);
    ConnectorHost host = new ConnectorHost(connector, null, FakeTranslationFactory.getInstance().getBQTTranslationUtility());
    // $NON-NLS-1$
    List results = host.executeCommand("SELECT intkey from bqt1.smalla");
    assertEquals(1000, results.size());
}
Also used : LoopbackExecutionFactory(org.teiid.translator.loopback.LoopbackExecutionFactory) List(java.util.List) ConnectorHost(org.teiid.cdk.api.ConnectorHost)

Aggregations

LoopbackExecutionFactory (org.teiid.translator.loopback.LoopbackExecutionFactory)3 EmbeddedConfiguration (org.teiid.runtime.EmbeddedConfiguration)2 EmbeddedServer (org.teiid.runtime.EmbeddedServer)2 List (java.util.List)1 DummyBaseTransactionManager (org.infinispan.transaction.tm.DummyBaseTransactionManager)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 ModelMetaData (org.teiid.adminapi.impl.ModelMetaData)1 SourceMappingMetadata (org.teiid.adminapi.impl.SourceMappingMetadata)1 ConnectorHost (org.teiid.cdk.api.ConnectorHost)1