Search in sources :

Example 1 with BlackHolePlugin

use of io.prestosql.plugin.blackhole.BlackHolePlugin in project hetu-core by openlookeng.

the class TestPrestoDriver method setup.

@BeforeClass
public void setup() throws Exception {
    Logging.initialize();
    server = new TestingPrestoServer();
    server.installPlugin(new TpchPlugin());
    server.createCatalog(TEST_CATALOG, "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    waitForNodeRefresh(server);
    setupTestTables();
    executorService = newCachedThreadPool(daemonThreadsNamed("test-%s"));
}
Also used : BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with BlackHolePlugin

use of io.prestosql.plugin.blackhole.BlackHolePlugin in project hetu-core by openlookeng.

the class TestJdbcWarnings method setupServer.

@BeforeClass
public void setupServer() throws Exception {
    server = new TestingPrestoServer(ImmutableMap.<String, String>builder().put("testing-warning-collector.add-warnings", "true").put("testing-warning-collector.preloaded-warnings", String.valueOf(PRELOADED_WARNINGS)).build());
    server.installPlugin(new TpchPlugin());
    server.createCatalog("tpch", "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    waitForNodeRefresh(server);
}
Also used : BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with BlackHolePlugin

use of io.prestosql.plugin.blackhole.BlackHolePlugin in project hetu-core by openlookeng.

the class TestProxyServer method setupServer.

@BeforeClass
public void setupServer() throws Exception {
    byte[] sharedSecret = Base64.getMimeEncoder().encode("test secret".getBytes(US_ASCII));
    sharedSecretFile = Files.createTempFile("secret", "txt");
    Files.write(sharedSecretFile, sharedSecret);
    Logging.initialize();
    server = new TestingPrestoServer();
    server.installPlugin(new TpchPlugin());
    server.createCatalog("tpch", "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    server.refreshNodes();
    Bootstrap app = new Bootstrap(new TestingNodeModule("test"), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(), new TestingJmxModule(), new ProxyModule());
    Injector injector = app.strictConfig().doNotInitializeLogging().setRequiredConfigurationProperty("proxy.uri", server.getBaseUrl().toString()).setRequiredConfigurationProperty("proxy.shared-secret-file", sharedSecretFile.toString()).quiet().initialize();
    lifeCycleManager = injector.getInstance(LifeCycleManager.class);
    httpServerInfo = injector.getInstance(HttpServerInfo.class);
    executorService = newCachedThreadPool(daemonThreadsNamed("test-%s"));
    setupTestTable();
}
Also used : TestingHttpServerModule(io.airlift.http.server.testing.TestingHttpServerModule) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingNodeModule(io.airlift.node.testing.TestingNodeModule) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) JaxrsModule(io.airlift.jaxrs.JaxrsModule) JsonModule(io.airlift.json.JsonModule) TestingJmxModule(io.airlift.jmx.testing.TestingJmxModule) LifeCycleManager(io.airlift.bootstrap.LifeCycleManager) BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) Injector(com.google.inject.Injector) Bootstrap(io.airlift.bootstrap.Bootstrap) HttpServerInfo(io.airlift.http.server.HttpServerInfo) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with BlackHolePlugin

use of io.prestosql.plugin.blackhole.BlackHolePlugin in project hetu-core by openlookeng.

the class TestPrestoDriverTimeZone method setup.

@BeforeClass
public void setup() throws Exception {
    Logging.initialize();
    server = new TestingPrestoServer();
    server.installPlugin(new TpchPlugin());
    server.createCatalog(TEST_CATALOG, "tpch");
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    waitForNodeRefresh(server);
    setupTestTables();
    executorService = newCachedThreadPool(daemonThreadsNamed("test-%s"));
}
Also used : BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) TpchPlugin(io.prestosql.plugin.tpch.TpchPlugin) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with BlackHolePlugin

use of io.prestosql.plugin.blackhole.BlackHolePlugin in project hetu-core by openlookeng.

the class TestJdbcPreparedStatement method setup.

@BeforeClass
public void setup() throws Exception {
    Logging.initialize();
    server = new TestingPrestoServer();
    server.installPlugin(new BlackHolePlugin());
    server.createCatalog("blackhole", "blackhole");
    waitForNodeRefresh(server);
    try (Connection connection = createConnection();
        Statement statement = connection.createStatement()) {
        statement.executeUpdate("CREATE SCHEMA blackhole.blackhole");
    }
}
Also used : BlackHolePlugin(io.prestosql.plugin.blackhole.BlackHolePlugin) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) TestingPrestoServer(io.prestosql.server.testing.TestingPrestoServer) Connection(java.sql.Connection) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

BlackHolePlugin (io.prestosql.plugin.blackhole.BlackHolePlugin)5 TestingPrestoServer (io.prestosql.server.testing.TestingPrestoServer)5 BeforeClass (org.testng.annotations.BeforeClass)5 TpchPlugin (io.prestosql.plugin.tpch.TpchPlugin)4 Injector (com.google.inject.Injector)1 Bootstrap (io.airlift.bootstrap.Bootstrap)1 LifeCycleManager (io.airlift.bootstrap.LifeCycleManager)1 HttpServerInfo (io.airlift.http.server.HttpServerInfo)1 TestingHttpServerModule (io.airlift.http.server.testing.TestingHttpServerModule)1 JaxrsModule (io.airlift.jaxrs.JaxrsModule)1 TestingJmxModule (io.airlift.jmx.testing.TestingJmxModule)1 JsonModule (io.airlift.json.JsonModule)1 TestingNodeModule (io.airlift.node.testing.TestingNodeModule)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 Statement (java.sql.Statement)1