Baubak Gandomi created SUREFIRE-2115:
----------------------------------------

             Summary: Unable to execute specific inner class test in Surefire
                 Key: SUREFIRE-2115
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2115
             Project: Maven Surefire
          Issue Type: Bug
          Components: Maven Surefire Plugin, TestNG support
            Reporter: Baubak Gandomi


Hi I have a nested class hierarchy which is as follows:
{code:java}
public class NestClassContainer {

    @Test
    public static class TestClass1 {

        public void testC1_m1() {
            System.out.println("Should not execute");
        }
    }

    @Test
    public static class TestClass2 {

        public void testC2_m1() {
            System.out.println("Should execute");
        }
    }

}{code}
I want to use Surefire to only execute NestClassContainer$TestClass2, This 
works just fine in TestNG exeution, but I cannot get it to work in Surefire.

When I try to execute one of the nested classes TestClass2 , it executes all 
the tests in the top class. (Tested versions 2.22.1 & 3.0.0-M7)

Here is my commandline:
{code:java}
mvn clean test -Dtest=NestClassContainer$TestClass2 {code}
Expected outcome:

We execute only testC2_m1

Actual outcome:

Both testC1_m1 & testC2_m1 are executed.

I have even tries setting the annotations on the test methods instead, but the 
result is the same.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to