@Override
  public int run(String[] args) throws Exception {
    try {
      webServiceClient = WebServiceClient.getWebServiceClient().createClient();
      return runCommand(args);
    } finally {
      if (yarnClient != null) {
        yarnClient.close();
      }
      if (webServiceClient != null) {
        webServiceClient.destroy();
      }
    }
  }
@Test (timeout = 5000)
  public void testWithInvalidApplicationId() throws Exception {
    LogsCLI cli = createCli();

    // Specify an invalid applicationId
    int exitCode = cli.run(new String[] {"-applicationId", "123"});
    assertTrue(exitCode == -1);
    assertTrue(sysErrStream.toString().contains(
            "Invalid ApplicationId specified"));
  }