apache / apache/maven-surefire

[SUREFIRE-1880] Run nested junit test from abstract class

Open
#2,970 2 comments 1 reaction 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[jakob braun](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jakob.braun@exasol.com)** opened **[SUREFIRE-1880](https://issues.apache.org/jira/browse/SUREFIRE-1880?redirect=false)** and commented

 

Consider the following Junit5 tests:

```java
abstract class AbstractTest{

@Nested

class NestedTest{

@Test

void myTest(){

}

}

}

class TestImpl extends AbstractTest{

}
```

I would like to run myTest. It seems however like this is not possible using the failsafe plugin.

Here is what I tried:
* AbstractTest$NestedTest.myTest
* TestImpl$NestedTest.myTest
* AbstractTest$NestedTest#myTest
* TestImpl$NestedTest#myTest

If I'm doing something wrong I would be glad about some help!

 

---

**Affects:** 3.0.0-M3, 3.0.0-M5

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Failsafe behavior with the abstract and nested JUnit 5 classes shown in the issue. Try the four listed selectors and inspect how the plugin discovers or filters the inherited nested test. Done means myTest can be selected and executed from TestImpl, with regression coverage for this example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.