@Test
  public void testBeelineCommands() throws IOException {
 // avoid System.exit() call in beeline which causes JVM to exit and fails the test
    System.setProperty(BeeLineOpts.PROPERTY_NAME_EXIT, "true");
    // Verify the command without ';' at the end also works fine
    BeeLine.mainWithInputRedirection(new String[] {"-u", "jdbc:hive2://", "-e", "select 3"}, null);
    BeeLine.mainWithInputRedirection(
        new String[] {"-u", "jdbc:hive2://", "-e", "create table t1(x int); show tables"}, null);
  }
Test the commands directly call from beeline.
@throws IOException
beeline/src/test/org/apache/hive/beeline/TestCommands.java