maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tracey Ruark (JIRA)" <>
Subject [jira] (SUREFIRE-1058) TestSetFailedException trying to use maven-surefire-plugin + regular expressions for TestNG groups
Date Wed, 05 Feb 2014 20:56:57 GMT
Tracey Ruark created SUREFIRE-1058:

             Summary: TestSetFailedException trying to use maven-surefire-plugin + regular
expressions for TestNG groups
                 Key: SUREFIRE-1058
             Project: Maven Surefire
          Issue Type: Bug
          Components: TestNG support
    Affects Versions: 2.16
            Reporter: Tracey Ruark

I have a Maven project with parent -> child poms. Each child project has TestNG tests.
What I'd like to be able to do is use regular expressions on the TestNG group and execute
tests across projects which match the given regex.

Running TestNG tests using a non-regular expression group across projects works just fine.
For example this works:

{noformat}mvn test -DargLine="-Denvironment=test" -Dgroups=""{noformat}
This runs the correct test methods which have that exact tag across all my child projects.

However if I do something like this:
{noformat}mvn test -DargLine="-Denvironment=test" -Dgroups="*"{noformat}

I get this exception:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test  
  (default-test) on project test-automation-ui: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test
failed: There was an error in the forked process
[ERROR] org.apache.maven.surefire.testset.TestSetFailedException: null; nested exception is
java.lang.reflect.InvocationTargetException: null
[ERROR] java.lang.reflect.InvocationTargetException
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
[ERROR] at java.lang.reflect.Method.invoke(
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.getGroupMatchingSelector(
[ERROR] at
[ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(
[ERROR] at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(
[ERROR] Caused by: Lexical error at line
1, column 13.  Encountered: <EOF> after : ""
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at
[ERROR] at org.apache.maven.surefire.testng.utils.GroupMatcherMethodSelector.setGroups(
[ERROR] ... 12 more
[ERROR] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

If I use the bypass surefire and run TestNG directly using same regular expression in a testng.xml
suite file it works just fine:
<!DOCTYPE suite SYSTEM "" >

<suite name="foosuite">
    <parameter name="environment"  value="dev"/>
    <test name="footest">
                <include name="*"/>
            <package name="*"/>

This message was sent by Atlassian JIRA

View raw message