Class XWikiExecutorTestMethodFilter


  • public class XWikiExecutorTestMethodFilter
    extends org.junit.runner.manipulation.Filter
    Filter to be applied on XWikiExecutorSuite's executed Runners (i.e. test classes).

    Each child runner (i.e. test method) of a test class is compared with a pattern to see if it shouldRun(Description) during this test execution.

    The "pattern" System Property is a regex that gets applied to values such as:

    • pa.ck.a.ge.Class
    • pa.ck.a.ge.Class#method

    Examples of valid patterns:

    -Dpattern="Test1"
    run all tests from the matching test class(es) (that contain(s) "Test1" in its name)
    -Dpattern="Test1|Test2"
    run all tests from 2 test classes
    -Dpattern="Test1#method1"
    run just matching method(s) from matching test class(es)
    -Dpattern="Test1#method1|Test2#method2"
    run just matching methods from matching test classes (more than just 1 class)
    -Dpattern="Test1#method1|Test2"
    mix it; run just matching methods from the first matching class(es) and ALL tests from the second matching class(es)
    Since:
    6.2
    Version:
    $Id: 4d7ad58e7e307a26fc14c0d4fdbc49511172b1d1 $
    • Field Detail

      • pattern

        protected String pattern
    • Constructor Detail

      • XWikiExecutorTestMethodFilter

        public XWikiExecutorTestMethodFilter​(String pattern)
        Constructor.
        Parameters:
        pattern - the pattern to use when filtering a runner's children (i.e. test methods).
    • Method Detail

      • getPattern

        public String getPattern()
        Returns:
        the pattern to use when filtering a Runner's children (i.e. test methods).
      • setPattern

        public void setPattern​(String pattern)
        Parameters:
        pattern - the new pattern to use.
      • shouldRun

        public boolean shouldRun​(org.junit.runner.Description description)
        Specified by:
        shouldRun in class org.junit.runner.manipulation.Filter
      • describe

        public String describe()
        Specified by:
        describe in class org.junit.runner.manipulation.Filter