Search in sources :

Example 6 with FakeServer

use of org.teiid.jdbc.FakeServer in project teiid by teiid.

the class TestGeometryTransform method setup.

@BeforeClass
public static void setup() throws Exception {
    server = new FakeServer(true);
    // $NON-NLS-1$
    server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
}
Also used : FakeServer(org.teiid.jdbc.FakeServer) BeforeClass(org.junit.BeforeClass)

Example 7 with FakeServer

use of org.teiid.jdbc.FakeServer in project teiid by teiid.

the class TestMatViewAliasing method setUp.

@Before
public void setUp() throws Exception {
    server = new FakeServer(true);
    VDBRepository vdbRepository = new VDBRepository();
    MetadataFactory mf = new MetadataFactory(null, 1, "foo", vdbRepository.getRuntimeTypeMap(), new Properties(), null);
    mf.getSchema().setPhysical(false);
    Table mat = mf.addTable("mat");
    mat.setVirtual(true);
    mat.setMaterialized(true);
    mat.setSelectTransformation("/*+ cache(ttl:0) */ select 1 as x, 'y' as Name");
    mf.addColumn("x", DataTypeManager.DefaultDataTypes.INTEGER, mat);
    mf.addColumn("Name", DataTypeManager.DefaultDataTypes.STRING, mat);
    MetadataStore ms = mf.asMetadataStore();
    server.deployVDB(MATVIEWS, ms);
    conn = server.createConnection("jdbc:teiid:" + MATVIEWS);
}
Also used : MetadataStore(org.teiid.metadata.MetadataStore) Table(org.teiid.metadata.Table) MetadataFactory(org.teiid.metadata.MetadataFactory) FakeServer(org.teiid.jdbc.FakeServer) VDBRepository(org.teiid.deployers.VDBRepository) Properties(java.util.Properties) Before(org.junit.Before)

Example 8 with FakeServer

use of org.teiid.jdbc.FakeServer in project teiid by teiid.

the class TestMatViews method setUp.

@Before
public void setUp() throws Exception {
    server = new FakeServer(true);
    HashMap<String, Collection<FunctionMethod>> udfs = new HashMap<String, Collection<FunctionMethod>>();
    udfs.put("funcs", Arrays.asList(new FunctionMethod("pause", null, null, PushDown.CANNOT_PUSHDOWN, TestMatViews.class.getName(), "pause", null, new FunctionParameter("return", DataTypeManager.DefaultDataTypes.INTEGER), true, Determinism.NONDETERMINISTIC)));
    server.deployVDB(MATVIEWS, UnitTestUtil.getTestDataPath() + "/matviews.vdb", new DeployVDBParameter(udfs, null));
    conn = server.createConnection("jdbc:teiid:matviews");
}
Also used : DeployVDBParameter(org.teiid.jdbc.FakeServer.DeployVDBParameter) FakeServer(org.teiid.jdbc.FakeServer) HashMap(java.util.HashMap) Collection(java.util.Collection) FunctionMethod(org.teiid.metadata.FunctionMethod) FunctionParameter(org.teiid.metadata.FunctionParameter) Before(org.junit.Before)

Example 9 with FakeServer

use of org.teiid.jdbc.FakeServer in project teiid by teiid.

the class TestODBCSchema method oneTimeSetUp.

@BeforeClass
public static void oneTimeSetUp() throws Exception {
    server = new FakeServer(true);
    server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
}
Also used : FakeServer(org.teiid.jdbc.FakeServer) BeforeClass(org.junit.BeforeClass)

Example 10 with FakeServer

use of org.teiid.jdbc.FakeServer in project teiid by teiid.

the class TestReplication method createServer.

private FakeServer createServer(String ispn, String jgroups) throws Exception {
    FakeServer server = new FakeServer(false);
    EmbeddedConfiguration config = new EmbeddedConfiguration();
    config.setInfinispanConfigFile(ispn);
    config.setJgroupsConfigFile(jgroups);
    config.setTransactionManager(new DummyTransactionManager());
    server.start(config, true);
    return server;
}
Also used : DummyTransactionManager(org.infinispan.transaction.tm.DummyTransactionManager) FakeServer(org.teiid.jdbc.FakeServer) EmbeddedConfiguration(org.teiid.runtime.EmbeddedConfiguration)

Aggregations

FakeServer (org.teiid.jdbc.FakeServer)23 BeforeClass (org.junit.BeforeClass)13 EmbeddedConfiguration (org.teiid.runtime.EmbeddedConfiguration)8 ModelMetaData (org.teiid.adminapi.impl.ModelMetaData)5 Before (org.junit.Before)4 Test (org.junit.Test)4 HardCodedExecutionFactory (org.teiid.runtime.HardCodedExecutionFactory)4 InetSocketAddress (java.net.InetSocketAddress)3 Connection (java.sql.Connection)3 QueryExpression (org.teiid.language.QueryExpression)3 TranslatorException (org.teiid.translator.TranslatorException)3 ResultSet (java.sql.ResultSet)2 Properties (java.util.Properties)2 DummyTransactionManager (org.infinispan.transaction.tm.DummyTransactionManager)2 TeiidSQLException (org.teiid.jdbc.TeiidSQLException)2 RuntimeMetadata (org.teiid.metadata.RuntimeMetadata)2 ExecutionContext (org.teiid.translator.ExecutionContext)2 ResultSetExecution (org.teiid.translator.ResultSetExecution)2 IOException (java.io.IOException)1 NotSerializableException (java.io.NotSerializableException)1