Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25836

Improve LogFeature to be able to annotate test methods

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Tests
    • Upgrade notes:
      Hide

      New test annotations are available on classes and methods:

      • @ConsoleLogLevelThreshold
      • @LoggerLevel
      Show
      New test annotations are available on classes and methods: @ConsoleLogLevelThreshold @LoggerLevel
    • Sprint:
      nxplatform 11.1.12, nxplatform 11.1.13
    • Story Points:
      3

      Description

      We want to improve our LogFeature in order to be able to annotate test methods. We want to replace such pattern:

      public void test() {
          logFeature.hideErrorFromConsoleLog();
          try (InputStream in = blob.getStream()) {
              bytes = IOUtils.toByteArray(in);
          } finally {
              logFeature.restoreConsoleLog();
          }
      }
      

      by

      @HideError
      public void test() {
          try (InputStream in = blob.getStream()) {
              bytes = IOUtils.toByteArray(in);
          }
      }
      

      This will allow us to hide warning or error from console for the whole tests.

      Ticket is also about adding this annotation for tests generating logs to Console. Goal is to have a clean maven output.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 2 hours
                  3d 2h