@Test
  public void testBeelineReconnect() throws  Throwable {
    List<String> argList = getBaseArgs(miniHS2.getBaseJdbcURL());
    final String SCRIPT_TEXT =
        "!close\n" +
            "!reconnect\n\n\n" +
            "create table reconnecttest (d int);\nshow tables;\ndrop table reconnecttest;\n";
    final String EXPECTED_PATTERN = "reconnecttest";

    testScriptFile(SCRIPT_TEXT, argList, OutStream.OUT,
        Collections.singletonList(new Tuple<>(EXPECTED_PATTERN, true)),
        Collections.singletonList(Modes.SCRIPT));

  }
Test that if we !close, we can still !reconnect
@throws Throwable
itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java