// Path: sane-dbc-hikari/src/main/java/com/novarto/sanedbc/hikari/Hikari.java
// public class Hikari
// {
//     private static final Logger LOGGER = LoggerFactory.getLogger(Hikari.class);
// 
//     public static HikariDataSource createHikari(String url, String user, String pass, Properties dsProps)
//     {
//         HikariConfig config = new HikariConfig();
// 
//         config.setJdbcUrl(url);
//         config.setUsername(user);
//         config.setPassword(pass);
// 
//         config.setDataSourceProperties(dsProps);
// 
//         LOGGER.info("creating hikaricp datasource. using jdbc url {}", config.getJdbcUrl());
// 
//         return new HikariDataSource(config);
//     }
// 
//     public static ExecutorService createExecutorFor(HikariDataSource ds, boolean shutdownOnJvmExit)
//     {
//         return createExecutorFor(ds, shutdownOnJvmExit, Executors::newCachedThreadPool);
// 
//     }
// 
//     public static <A extends ExecutorService> A createExecutorFor(HikariDataSource ds, boolean shutdownOnJvmExit,
//             F0<A> ctor
//     )
//     {
//         A executor = ctor.f();
// 
//         if (shutdownOnJvmExit)
//         {
//             String serviceName = "Shutdown hook for hikari@" + ds.getJdbcUrl();
//             final Thread datasourceShutdownHook = new Thread(() -> gracefulShutdown(executor, ds));
//             datasourceShutdownHook.setName(serviceName);
//             Runtime.getRuntime().addShutdownHook(datasourceShutdownHook);
// 
//         }
// 
//         return executor;
// 
//     }
// 
// 
//     public static void gracefulShutdown(ExecutorService ex, HikariDataSource ds)
//     {
//         ds.close();
//         ConcurrentUtil.shutdownAndAwaitTermination(ex, 5, TimeUnit.SECONDS);
//     }
// 
// }
// 
// Path: sane-dbc-hikari/src/main/java/com/novarto/sanedbc/hikari/Hikari.java
// public static void gracefulShutdown(ExecutorService ex, HikariDataSource ds)
// {
//     ds.close();
//     ConcurrentUtil.shutdownAndAwaitTermination(ex, 5, TimeUnit.SECONDS);
// }


import com.novarto.sanedbc.hikari.Hikari;
import com.zaxxer.hikari.HikariDataSource;
import fj.control.db.DB;
import fj.function.Try1;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.UnorderedThreadPoolEventExecutor;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import static com.novarto.lang.testutil.TestUtil.tryTo;
import static com.novarto.sanedbc.hikari.Hikari.gracefulShutdown;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
package com.novarto.sanedbc.netty;




public class SanityTest
{
    private static FutureInterpreter dbAsync;
    private static HikariDataSource ds;
    private static UnorderedThreadPoolEventExecutor ex;

    @BeforeClass public static void setupHikari()
    {
// Path: sane-dbc-hikari/src/main/java/com/novarto/sanedbc/hikari/Hikari.java
// public class Hikari
// {
//     private static final Logger LOGGER = LoggerFactory.getLogger(Hikari.class);
// 
//     public static HikariDataSource createHikari(String url, String user, String pass, Properties dsProps)
//     {
//         HikariConfig config = new HikariConfig();
// 
//         config.setJdbcUrl(url);
//         config.setUsername(user);
//         config.setPassword(pass);
// 
//         config.setDataSourceProperties(dsProps);
// 
//         LOGGER.info("creating hikaricp datasource. using jdbc url {}", config.getJdbcUrl());
// 
//         return new HikariDataSource(config);
//     }
// 
//     public static ExecutorService createExecutorFor(HikariDataSource ds, boolean shutdownOnJvmExit)
//     {
//         return createExecutorFor(ds, shutdownOnJvmExit, Executors::newCachedThreadPool);
// 
//     }
// 
//     public static <A extends ExecutorService> A createExecutorFor(HikariDataSource ds, boolean shutdownOnJvmExit,
//             F0<A> ctor
//     )
//     {
//         A executor = ctor.f();
// 
//         if (shutdownOnJvmExit)
//         {
//             String serviceName = "Shutdown hook for hikari@" + ds.getJdbcUrl();
//             final Thread datasourceShutdownHook = new Thread(() -> gracefulShutdown(executor, ds));
//             datasourceShutdownHook.setName(serviceName);
//             Runtime.getRuntime().addShutdownHook(datasourceShutdownHook);
// 
//         }
// 
//         return executor;
// 
//     }
// 
// 
//     public static void gracefulShutdown(ExecutorService ex, HikariDataSource ds)
//     {
//         ds.close();
//         ConcurrentUtil.shutdownAndAwaitTermination(ex, 5, TimeUnit.SECONDS);
//     }
// 
// }
// 
// Path: sane-dbc-hikari/src/main/java/com/novarto/sanedbc/hikari/Hikari.java
// public static void gracefulShutdown(ExecutorService ex, HikariDataSource ds)
// {
//     ds.close();
//     ConcurrentUtil.shutdownAndAwaitTermination(ex, 5, TimeUnit.SECONDS);
// }


// Path: sane-dbc-netty/src/test/java/com/novarto/sanedbc/netty/SanityTest.java
import com.novarto.sanedbc.hikari.Hikari;
import com.zaxxer.hikari.HikariDataSource;
import fj.control.db.DB;
import fj.function.Try1;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.UnorderedThreadPoolEventExecutor;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import static com.novarto.lang.testutil.TestUtil.tryTo;
import static com.novarto.sanedbc.hikari.Hikari.gracefulShutdown;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

package com.novarto.sanedbc.netty;




public class SanityTest
{
    private static FutureInterpreter dbAsync;
    private static HikariDataSource ds;
    private static UnorderedThreadPoolEventExecutor ex;

    @BeforeClass public static void setupHikari()
    {
        ds = Hikari.createHikari("jdbc:hsqldb:mem:JdbcUtilsTest", "sa", "", new Properties());