0

I have the following configuration in the pom.xml:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
            <includes>
                <include>**/TestA.java</include>
                <include>%regex[.*TestB.*]</include>
            </includes>
        </configuration>
        <executions>
            <execution>
                <id>integration-test</id>
                <goals>
                    <goal>integration-test</goal>
                    <goal>verify</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

What I want is to run via command line methods case0 and case1 of TestA and case100 and case101 of TestB. Both TestA and TestB have more methods that I want to ignore. I can do it easily with the surefire-plugin:

mvn test -Dtest=org.TestA#case0+case1,org.TestB#case100+case101

but I cannot do the same using failsafe-plugin. Is it doable at all?

I use: JUnit 4.11, and failsafe/surefire 2.18.1.

Thanks in advance!

user3155208
  • 191
  • 1
  • 9
  • The [documentation](http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#test) seems to suggest that should work... – Duncan Jones Feb 24 '15 at 14:35
  • And it really work in the cases, they describe: one or several classes separated by comma (all methods), or one/several methods in the single class (and no other classes specified). Probably will work with wildcards, though I didn't try. However my case is different and I cannot find any mention if it is supported. My understanding that it won't run in default configuration. But it has so many options to configure... – user3155208 Feb 24 '15 at 14:55

1 Answers1

0

Please try using "-Dit.test=MyTestClass#myMethod" as it is normally used to run Integration Tests as documented. Please also be aware that it works with junit-4.x or TestNG frameworks.

Not sure how to get it work with comma separated values though.

Kiarash Zamanifar
  • 647
  • 1
  • 9
  • 19