@Test
public void hiveServer2ShouldStart() throws InterruptedException, ClassNotFoundException, SQLException {

      assertThat(Utils.available("127.0.0.1", 20103)).isFalse();
    // Load the Hive JDBC driver
    LOGGER.info("HIVE: Loading the Hive JDBC Driver");
    Class.forName("org.apache.hive.jdbc.HiveDriver");
    //
    // Create an ORC table and describe it
    //
    // Get the connection
    Connection con = DriverManager.getConnection("jdbc:hive2://" +
                    configuration.getString(HiveConfig.HIVE_SERVER2_HOSTNAME_KEY) + ":" +
                    configuration.getInt(HiveConfig.HIVE_SERVER2_PORT_KEY) + "/" +
                    configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY),
            "user",
            "pass");
    // Create the DB
    Statement stmt;
    try {
        String createDbDdl = "CREATE DATABASE IF NOT EXISTS " +
                configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY);
        stmt = con.createStatement();
        LOGGER.info("HIVE: Running Create Database Statement: {}", createDbDdl);
        stmt.execute(createDbDdl);
    } catch (Exception e) {
        e.printStackTrace();
    }
    // Drop the table incase it still exists
    String dropDdl = "DROP TABLE " + configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY) + "." +
            configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY);
    stmt = con.createStatement();
    LOGGER.info("HIVE: Running Drop Table Statement: {}", dropDdl);
    stmt.execute(dropDdl);
    // Create the ORC table
    String createDdl = "CREATE TABLE IF NOT EXISTS " +
            configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY) + "." +
            configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY) + " (id INT, msg STRING) " +
            "PARTITIONED BY (dt STRING) " +
            "CLUSTERED BY (id) INTO 16 BUCKETS " +
            "STORED AS ORC tblproperties(\"orc.compress\"=\"NONE\")";
    stmt = con.createStatement();
    LOGGER.info("HIVE: Running Create Table Statement: {}", createDdl);
    stmt.execute(createDdl);
    // Issue a describe on the new table and display the output
    LOGGER.info("HIVE: Validating Table was Created: ");
    ResultSet resultSet = stmt.executeQuery("DESCRIBE FORMATTED " +
            configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY));
    int count = 0;
    while (resultSet.next()) {
        ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
        for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
            System.out.print(resultSet.getString(i));
        }
        System.out.println();
        count++;
    }
    assertEquals(33, count);
    // Drop the table
    dropDdl = "DROP TABLE " + configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY) + "." +
            configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY);
    stmt = con.createStatement();
    LOGGER.info("HIVE: Running Drop Table Statement: {}", dropDdl);
    stmt.execute(dropDdl);
}