@BeforeClass
  public static void beforeTests() throws Exception {
    PrintWriter writer = new PrintWriter(fileName);
    writer.println("select 1;");
    writer.println("select 2;");
    writer.println("select 3;");
    writer.println("select 4;");
    writer.println("select 5;");
    writer.println("select 6;");
    writer.println("select 7;");
    writer.println("select 8;");
    writer.println("select 9;");
    writer.println("select 10;");
    writer.close();
  }
TestBeeLineHistory - executes tests of the !history command of BeeLine
beeline/src/test/org/apache/hive/beeline/TestBeeLineHistory.java