@Test
  public void testPasswordFileArgs() throws Exception {
    TestBeeline bl = new TestBeeline();
    File passFile = new File("file.password");
    passFile.deleteOnExit();
    FileOutputStream passFileOut = new FileOutputStream(passFile);
    passFileOut.write("mypass\n".getBytes());
    passFileOut.close();
    String args[] = new String[] {"-u", "url", "-n", "name",
      "-w", "file.password", "-p", "not-taken-if-w-is-present",
      "-d", "driver", "-a", "authType"};
    bl.initArgs(args);
    System.out.println(bl.connectArgs);
    // Password file contents are trimmed of trailing whitespaces and newlines
    Assert.assertTrue(bl.connectArgs.equals("url name mypass driver"));
    Assert.assertTrue(bl.getOpts().getAuthType().equals("authType"));
    passFile.delete();
  }
Unit test for Beeline arg parser.
beeline/src/test/org/apache/hive/beeline/TestBeelineArgParsing.java