Fix for SUREFIRE-1278 - TestNG tests are run with group name that ends with specified group.
Configured pom.xml to run only group "group" in order to show the issue. Added IT test class. Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/bab3175e Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/bab3175e Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/bab3175e Branch: refs/heads/master Commit: bab3175e8388b675e1e56814d3b1a5aa25ae250a Parents: ae6337e Author: Kostya Hospodarysko <khospodary...@lohika.com> Authored: Fri Sep 16 01:08:42 2016 +0300 Committer: Tibor17 <tibo...@lycos.com> Committed: Sun Sep 18 21:05:27 2016 +0200 ---------------------------------------------------------------------- .../jiras/Surefire1278GroupNameEndingIT.java | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/bab3175e/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1278GroupNameEndingIT.java ---------------------------------------------------------------------- diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1278GroupNameEndingIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1278GroupNameEndingIT.java new file mode 100644 index 0000000..c0b0339 --- /dev/null +++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1278GroupNameEndingIT.java @@ -0,0 +1,44 @@ +package org.apache.maven.surefire.its.jiras; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; +import org.apache.maven.surefire.its.fixture.SurefireLauncher; +import org.junit.Test; + +/** + * Test the group filter for TestNG + * + */ +public class Surefire1278GroupNameEndingIT + extends SurefireJUnit4IntegrationTestCase +{ + @Test + public void testOnlyGroups() + { + unpack().setGroups( "group" ).executeTest().verifyErrorFree( 1 ); + } + + public SurefireLauncher unpack() + { + return unpack( "/surefire-1278-group-name-ending" ); + } + +}