testng: Can't selectively run an inherited test case

TestNG Version

6.11

Expected behavior

In a clone of https://github.com/Pr0methean/BetterRandom/commit/56f418984b4d03e2fdceb768760dbbd3002c5d22, I can run

cd betterrandom
mvn test -Dtest=io.github.pr0methean.betterrandom.prng.RandomWrapperRandomTest#testDistribution

and the test method testDistribution (which RandomWrapperRandomTest inherits from BaseRandomTest) is run.

Actual behavior

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project BetterRandom: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]

Is the issue reproductible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

See above.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@juherr I am not sure if this can be executed from within an IDE, because one needs to right click on a method and then choose run as testng. But for doing that, one has to open up the class and I don’t think the IDE displays/lists inherited methods.

I think this can be done by manually creating a launch configuration, and type the method name (the text box is editable)