Search in sources :

Example 1 with HotRodTestServer

use of org.teiid.infinispan.api.HotRodTestServer in project teiid by teiid.

the class TestHotrodExecution method setup.

@BeforeClass
public static void setup() throws Exception {
    TimestampWithTimezone.resetCalendar(TimeZone.getTimeZone("GMT-5"));
    SERVER = new HotRodTestServer(PORT);
    MetadataFactory mf = TestProtobufMetadataProcessor.protoMatadata("tables.proto");
    EF = new InfinispanExecutionFactory();
    TransformationMetadata tm = TestProtobufMetadataProcessor.getTransformationMetadata(mf, EF);
    // String ddl = DDLStringVisitor.getDDLString(mf.getSchema(), null, null);
    // System.out.println(ddl);
    METADATA = new RuntimeMetadataImpl(tm);
    UTILITY = new TranslationUtility(tm);
    InfinispanConnection connection = SERVER.getConnection();
    // only use G2 & G4 as cache only support single id
    connection.registerProtobufFile(new ProtobufResource("tables.proto", ObjectConverterUtil.convertFileToString(UnitTestUtil.getTestDataFile("tables.proto"))));
    EC = Mockito.mock(ExecutionContext.class);
    Mockito.stub(EC.getBatchSize()).toReturn(512);
}
Also used : TransformationMetadata(org.teiid.query.metadata.TransformationMetadata) ExecutionContext(org.teiid.translator.ExecutionContext) MetadataFactory(org.teiid.metadata.MetadataFactory) RuntimeMetadataImpl(org.teiid.dqp.internal.datamgr.RuntimeMetadataImpl) HotRodTestServer(org.teiid.infinispan.api.HotRodTestServer) TranslationUtility(org.teiid.cdk.api.TranslationUtility) InfinispanConnection(org.teiid.infinispan.api.InfinispanConnection) ProtobufResource(org.teiid.infinispan.api.ProtobufResource) BeforeClass(org.junit.BeforeClass)

Aggregations

BeforeClass (org.junit.BeforeClass)1 TranslationUtility (org.teiid.cdk.api.TranslationUtility)1 RuntimeMetadataImpl (org.teiid.dqp.internal.datamgr.RuntimeMetadataImpl)1 HotRodTestServer (org.teiid.infinispan.api.HotRodTestServer)1 InfinispanConnection (org.teiid.infinispan.api.InfinispanConnection)1 ProtobufResource (org.teiid.infinispan.api.ProtobufResource)1 MetadataFactory (org.teiid.metadata.MetadataFactory)1 TransformationMetadata (org.teiid.query.metadata.TransformationMetadata)1 ExecutionContext (org.teiid.translator.ExecutionContext)1