Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-1741

Uprgade to Hamcrest 2.1

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Currently on version 1.3.

      This will allow to use matchesPattern() for example:

                  assertThat(summary.getFailures().get(1).getException().getMessage(), matchesPattern(
                      "There should be no content output to the console by the test! Instead we got \\[.* \\[main\\] "
                          + "INFO  o\\.x\\.t\\.j\\.CaptureConsoleExtensionTest\\$SampleTestCase - In beforeEach\n"
                          + "\\]"
                  ));
      

      which provides much better error reporting than:

                  assertTrue(summary.getFailures().get(0).getException().getMessage().matches(
                      "There should be no content output to the console by the test! Instead we got \\[.* \\[main\\] "
                          + "INFO  o\\.x\\.t\\.j\\.CaptureConsoleTestExecutionListenerTest\\$SampleTestCase - In beforeAll\n"
                          + ".* \\[main\\] INFO  o\\.x\\.t\\.j\\.CaptureConsoleTestExecutionListenerTest\\$SampleTestCase - "
                          + "In outputToConsole\n"
                          + "\\]"
                  ));
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: