Class TestNameGroupNameMethodSelector

java.lang.Object
io.trino.tempto.internal.listeners.TestNameGroupNameMethodSelector
All Implemented Interfaces:
Serializable, org.testng.IMethodSelector

public class TestNameGroupNameMethodSelector extends Object implements org.testng.IMethodSelector
We want to be able to select test methods to be run on per testName/testGroup basis. We cannot use standard testNG methods to select based on group/methodName for that though. We generate some tests from factories and we want those generated tests to belong to different test groups. But we cannot assign testNG groups to them as those can only be defined in static way through annotations.

So we introduce our own mechanism of tests selection. This is governed by following java system properties:

For inclusion, test name matching is done by verifying if value from system property is suffix of actual test name in question. When excluding tests, an exact match is performed, i.e. the fully qualified class name must be provided (and exact method name, when excluding individual methods).

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • includeMethod

      public boolean includeMethod(org.testng.IMethodSelectorContext context, org.testng.ITestNGMethod method, boolean isTestMethod)
      Specified by:
      includeMethod in interface org.testng.IMethodSelector
    • setTestMethods

      public void setTestMethods(List<org.testng.ITestNGMethod> testMethods)
      Specified by:
      setTestMethods in interface org.testng.IMethodSelector