Class TestNameGroupNameMethodSelector
java.lang.Object
io.trino.tempto.internal.listeners.TestNameGroupNameMethodSelector
- All Implemented Interfaces:
Serializable,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:
- "io.trino.tempto.groups" - should contain comma separated list of groups from which tests should be run
- "io.trino.tempto.exclude_groups" - should contain comma separated list of groups from which tests should be excluded
- "io.trino.tempto.tests" - should contain comma separated list of test names to be run
- "io.trino.tempto.exclude_tests" - should contain comma separated list of test names to be excluded
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanincludeMethod(org.testng.IMethodSelectorContext context, org.testng.ITestNGMethod method, boolean isTestMethod) voidsetTestMethods(List<org.testng.ITestNGMethod> testMethods)
-
Field Details
-
TEST_NAMES_TO_RUN_PROPERTY
- See Also:
-
TEST_NAMES_TO_EXCLUDE_PROPERTY
- See Also:
-
TEST_GROUPS_TO_RUN_PROPERTY
- See Also:
-
TEST_GROUPS_TO_EXCLUDE_PROPERTY
- See Also:
-
-
Constructor Details
-
TestNameGroupNameMethodSelector
public TestNameGroupNameMethodSelector() -
TestNameGroupNameMethodSelector
-
-
Method Details
-
includeMethod
public boolean includeMethod(org.testng.IMethodSelectorContext context, org.testng.ITestNGMethod method, boolean isTestMethod) - Specified by:
includeMethodin interfaceorg.testng.IMethodSelector
-
setTestMethods
- Specified by:
setTestMethodsin interfaceorg.testng.IMethodSelector
-