Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7900112

don't print unnecessary stack traces

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • jtreg4.1
    • None
    • tools
    • None

      From Sherman via email:


      There is a "complain" that the JTreg report includes "long" stacktrace
      for exception from tests that test "@expectedException". It makes
      the reading of the report a littler harder, if it includes both successful
      tests with expected exceptions and failed tests with the exceptions.
      I would assume people only be interested to see the throwable from
      the failed ones. I took a quick scan at the related jtreg source,

      TestNGAction.RegressionListener.report() currently has the implementation
      as

              void report(InfoKind k, ITestResult itr) {
                  System.out.println(k.toString().toLowerCase()
                          + " " + itr.getMethod().getConstructorOrMethod()
                          + ": " + statusToString(itr.getStatus()));
                  Throwable t = itr.getThrowable();
                  if (t != null) {
                      t.printStackTrace(System.out);
                  }
              }


      Is it possible to only print the t.printStackTrace if the itr.getStatus()
      is not SUCCESS? or make it configurable?

            rriggs Roger Riggs
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: