Search in sources :

Example 21 with FakeServer

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

the class TestJDBCSocketTransport method oneTimeSetup.

@BeforeClass
public static void oneTimeSetup() throws Exception {
    SocketConfiguration config = new SocketConfiguration();
    config.setSSLConfiguration(new SSLConfiguration());
    addr = new InetSocketAddress(0);
    config.setBindAddress(addr.getHostName());
    config.setPortNumber(0);
    EmbeddedConfiguration dqpConfig = new EmbeddedConfiguration();
    dqpConfig.setMaxActivePlans(2);
    server = new FakeServer(false);
    server.start(dqpConfig, false);
    server.deployVDB("parts", UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb");
    jdbcTransport = new SocketListener(addr, config, server.getClientServiceRegistry(), BufferManagerFactory.getStandaloneBufferManager()) {

        @Override
        protected SSLAwareChannelHandler createChannelHandler() {
            SSLAwareChannelHandler result = new SSLAwareChannelHandler(this) {

                public void messageReceived(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception {
                    if (delay > 0) {
                        Thread.sleep(delay);
                    }
                    super.messageReceived(ctx, msg);
                }
            };
            return result;
        }
    };
    jdbcTransport.setMaxMessageSize(MAX_MESSAGE);
    jdbcTransport.setMaxLobSize(MAX_LOB);
}
Also used : FakeServer(org.teiid.jdbc.FakeServer) InetSocketAddress(java.net.InetSocketAddress) EmbeddedConfiguration(org.teiid.runtime.EmbeddedConfiguration) TeiidSQLException(org.teiid.jdbc.TeiidSQLException) ConnectionException(org.teiid.net.ConnectionException) BatchUpdateException(java.sql.BatchUpdateException) SQLException(java.sql.SQLException) TranslatorException(org.teiid.translator.TranslatorException) CommunicationException(org.teiid.net.CommunicationException) IOException(java.io.IOException) NotSerializableException(java.io.NotSerializableException) BeforeClass(org.junit.BeforeClass)

Example 22 with FakeServer

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

the class TestODBCProceduresSchema method oneTimeSetup.

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

Example 23 with FakeServer

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

the class TestPartsDatabaseMetadata method setUp.

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

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