maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [15/19] maven-surefire git commit: [SUREFIRE] completed commit 889caca
Date Thu, 26 Mar 2015 00:15:57 GMT
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
index 374d1a4..cd38118 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/testset/TestListResolver.java
@@ -20,111 +20,173 @@ package org.apache.maven.surefire.testset;
  */
 
 import org.apache.maven.shared.utils.StringUtils;
+import org.apache.maven.shared.utils.io.SelectorUtils;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
 import java.util.LinkedHashSet;
-import java.util.Map;
 import java.util.Set;
 
+import static java.util.Collections.singleton;
+import static java.util.Collections.emptySet;
+
 /**
  * Resolved multi pattern filter e.g. -Dtest=MyTest#test,!AnotherTest#otherTest into an object model
  * composed of included and excluded tests.<br/>
- * The methods {@link #shouldRun(Class, String)} are filters easily used in JUnit filter or TestNG.
+ * The methods {@link #shouldRun(String, String)} are filters easily used in JUnit filter or TestNG.
  * This class is independent of JUnit and TestNG API.<br/>
- * This class is accessed by Java Reflection API in {@link org.apache.maven.surefire.booter.SurefireReflector}
+ * It is accessed by Java Reflection API in {@link org.apache.maven.surefire.booter.SurefireReflector}
  * using specific ClassLoader.
  */
 public class TestListResolver
+    implements GenericTestPattern<TestListResolver, ResolvedTest, String, String>
 {
     private static final String JAVA_CLASS_FILE_EXTENSION = ".class";
 
-    private final String parameterTest;
+    private static final Set<ResolvedTest> EMPTY_TEST_PATTERNS = emptySet();
+
+    private static final Set<String> EMPTY_SPECIFIC_TESTS = emptySet();
 
-    private final Set<ResolvedTest> includedFilters;
+    private final Set<ResolvedTest> includedPatterns;
 
-    private final Set<ResolvedTest> excludedFilters;
+    private final Set<ResolvedTest> excludedPatterns;
 
     private final Set<String> specificClasses;
 
-    public TestListResolver( String parameterTest )
+    private final boolean hasIncludedMethodPatterns;
+
+    private final boolean hasExcludedMethodPatterns;
+
+    public TestListResolver( Collection<String> tests )
     {
-        Set<ResolvedTest> includedFilters = new LinkedHashSet<ResolvedTest>( 0 );
-        Set<ResolvedTest> excludedFilters = new LinkedHashSet<ResolvedTest>( 0 );
-        Set<String> specificClasses = new LinkedHashSet<String>( 0 );
-        if ( StringUtils.isNotBlank( parameterTest ) )
+        final IncludedExcludedPatterns patterns = new IncludedExcludedPatterns();
+        final Set<ResolvedTest> includedFilters = new LinkedHashSet<ResolvedTest>( 0 );
+        final Set<ResolvedTest> excludedFilters = new LinkedHashSet<ResolvedTest>( 0 );
+        final Set<String> specificClasses = new LinkedHashSet<String>( 0 );
+
+        for ( final String csvTests : tests )
         {
-            final Map<Class<?>, String> classConversion = new IdentityHashMap<Class<?>, String>( 512 );
-            for ( String request : StringUtils.split( parameterTest, "," ) )
+            if ( StringUtils.isNotBlank( csvTests ) )
             {
-                request = request.trim();
-                if ( request.length() != 0 && !request.equals( "!" ) )
+                for ( String request : StringUtils.split( csvTests, "," ) )
                 {
-                    final int indexOfMethodSeparator = request.indexOf( '#' );
-                    if ( indexOfMethodSeparator == -1 )
-                    {
-                        String classPattern = removeExclamationMark( request );
-                        boolean isExcluded = classPattern.length() < request.length();
-                        ResolvedTest test = new ResolvedTest( classPattern, null, classConversion );
-                        if ( !test.isEmpty() )
-                        {
-                            updatedFilters( isExcluded, test, includedFilters, excludedFilters );
-                        }
-                    }
-                    else
+                    request = request.trim();
+                    if ( request.length() != 0 && !request.equals( "!" ) )
                     {
-                        String className = request.substring( 0, indexOfMethodSeparator );
-                        String methodNames = request.substring( 1 + indexOfMethodSeparator );
-                        for ( String methodName : StringUtils.split( methodNames, "+" ) )
-                        {
-                            String classPattern = removeExclamationMark( className );
-                            boolean isExcluded = classPattern.length() < className.length();
-                            ResolvedTest test = new ResolvedTest( classPattern, methodName, classConversion );
-                            if ( !test.isEmpty() )
-                            {
-                                updatedFilters( isExcluded, test, includedFilters, excludedFilters );
-                            }
-                        }
+                        resolveTestRequest( request, patterns, includedFilters, excludedFilters );
                     }
                 }
             }
+        }
 
-            for ( ResolvedTest test : includedFilters )
-            {
-                populateSpecificClasses( specificClasses, test );
-            }
+        for ( ResolvedTest test : includedFilters )
+        {
+            populateSpecificClasses( specificClasses, test );
+        }
 
-            for ( ResolvedTest test : excludedFilters )
-            {
-                populateSpecificClasses( specificClasses, test );
-            }
+        for ( ResolvedTest test : excludedFilters )
+        {
+            populateSpecificClasses( specificClasses, test );
         }
-        this.parameterTest = StringUtils.isBlank( parameterTest ) ? null : parameterTest;
+
         this.specificClasses = Collections.unmodifiableSet( specificClasses );
-        this.includedFilters = Collections.unmodifiableSet( includedFilters );
-        this.excludedFilters = Collections.unmodifiableSet( excludedFilters );
+        this.includedPatterns = Collections.unmodifiableSet( includedFilters );
+        this.excludedPatterns = Collections.unmodifiableSet( excludedFilters );
+        this.hasIncludedMethodPatterns = patterns.hasIncludedMethodPatterns;
+        this.hasExcludedMethodPatterns = patterns.hasExcludedMethodPatterns;
+    }
+
+    public TestListResolver( String csvTests )
+    {
+        this( csvTests == null ? Collections.<String>emptySet() : singleton( csvTests ) );
+    }
+
+    public TestListResolver( Collection<String> included, Collection<String> excluded )
+    {
+        this( mergeIncludedAndExcludedTests( included, excluded ) );
     }
 
-    private TestListResolver( String parameterTest, Set<ResolvedTest> includedFilters,
-                              Set<ResolvedTest> excludedFilters )
+    /**
+     * Used only in method filter.
+     */
+    private TestListResolver( boolean hasIncludedMethodPatterns, boolean hasExcludedMethodPatterns,
+                              Set<String> specificClasses, Set<ResolvedTest> includedPatterns,
+                              Set<ResolvedTest> excludedPatterns )
     {
-        this.includedFilters = includedFilters;
-        this.excludedFilters = excludedFilters;
-        this.specificClasses = null;
-        this.parameterTest = parameterTest;
+        this.includedPatterns = includedPatterns;
+        this.excludedPatterns = excludedPatterns;
+        this.specificClasses = specificClasses;
+        this.hasIncludedMethodPatterns = hasIncludedMethodPatterns;
+        this.hasExcludedMethodPatterns = hasExcludedMethodPatterns;
     }
 
-    public TestListResolver onlyMethodFilters()
+    public boolean hasIncludedMethodPatterns()
     {
-        return new TestListResolver( getPluginParameterTest(), selectMethodFilters( getIncludedFilters() ),
-                                     selectMethodFilters( getExcludedFilters() ) );
+        return hasIncludedMethodPatterns;
+    }
+
+    public boolean hasExcludedMethodPatterns()
+    {
+        return hasExcludedMethodPatterns;
+    }
+
+    public boolean hasMethodPatterns()
+    {
+        return hasIncludedMethodPatterns() || hasExcludedMethodPatterns();
+    }
+
+    /**
+     * Method filter.
+     */
+    public TestListResolver createMethodFilters()
+    {
+        boolean hasMethodPatterns = hasMethodPatterns();
+        Set<ResolvedTest> inc = hasMethodPatterns ? getIncludedPatterns() : EMPTY_TEST_PATTERNS;
+        Set<ResolvedTest> exc = hasMethodPatterns ? getExcludedPatterns() : EMPTY_TEST_PATTERNS;
+        Set<String> specificClasses = hasMethodPatterns ? getTestSpecificClasses() : EMPTY_SPECIFIC_TESTS;
+        return new TestListResolver( hasIncludedMethodPatterns(), hasExcludedMethodPatterns(), specificClasses,
+                                     inc, exc );
+    }
+
+    public TestListResolver createClassFilters()
+    {
+        return hasMethodPatterns() ? new TestListResolver( "" ) : this;
+    }
+
+    public TestFilter<String, String> and( final TestListResolver another )
+    {
+        return new TestFilter<String, String>()
+        {
+            public boolean shouldRun( String testClass, String methodName )
+            {
+                return TestListResolver.this.shouldRun( testClass, methodName )
+                    && another.shouldRun( testClass, methodName );
+            }
+        };
+    }
+
+    public TestFilter<String, String> or( final TestListResolver another )
+    {
+        return new TestFilter<String, String>()
+        {
+            public boolean shouldRun( String testClass, String methodName )
+            {
+                return TestListResolver.this.shouldRun( testClass, methodName )
+                    || another.shouldRun( testClass, methodName );
+            }
+        };
     }
 
     public boolean shouldRun( Class<?> testClass, String methodName )
     {
-        if ( isEmpty() || testClass == null && methodName == null )
+        String clsFile = testClass == null ? null : testClass.getName().replace( '.', '/' ) + JAVA_CLASS_FILE_EXTENSION;
+        return shouldRun( clsFile, methodName );
+    }
+
+    public boolean shouldRun( String testClassFile, String methodName )
+    {
+        if ( isEmpty() || StringUtils.isBlank( testClassFile ) && StringUtils.isBlank( methodName ) )
         {
             return true;
         }
@@ -132,15 +194,15 @@ public class TestListResolver
         {
             boolean shouldRun = false;
 
-            if ( includedFilters.isEmpty() )
+            if ( getIncludedPatterns().isEmpty() )
             {
                 shouldRun = true;
             }
             else
             {
-                for ( ResolvedTest filter : includedFilters )
+                for ( ResolvedTest filter : getIncludedPatterns() )
                 {
-                    if ( filter.shouldRun( testClass, methodName ) )
+                    if ( filter.shouldRun( testClassFile, methodName ) )
                     {
                         shouldRun = true;
                         break;
@@ -150,9 +212,9 @@ public class TestListResolver
 
             if ( shouldRun )
             {
-                for ( ResolvedTest filter : excludedFilters )
+                for ( ResolvedTest filter : getExcludedPatterns() )
                 {
-                    if ( filter.shouldRun( testClass, methodName ) )
+                    if ( filter.shouldRun( testClassFile, methodName ) )
                     {
                         shouldRun = false;
                         break;
@@ -165,22 +227,24 @@ public class TestListResolver
 
     public boolean isEmpty()
     {
-        return getIncludedFilters().isEmpty() && getIncludedFilters().isEmpty();
+        return getIncludedPatterns().isEmpty() && getExcludedPatterns().isEmpty();
     }
 
     public String getPluginParameterTest()
     {
-        return parameterTest;
+        String aggregatedTest = aggregatedTest( "", getIncludedPatterns() );
+        aggregatedTest += aggregatedTest( "!", getExcludedPatterns() );
+        return aggregatedTest.length() == 0 ? null : aggregatedTest;
     }
 
-    public Set<ResolvedTest> getIncludedFilters()
+    public Set<ResolvedTest> getIncludedPatterns()
     {
-        return includedFilters;
+        return includedPatterns;
     }
 
-    public Set<ResolvedTest> getExcludedFilters()
+    public Set<ResolvedTest> getExcludedPatterns()
     {
-        return excludedFilters;
+        return excludedPatterns;
     }
 
     public Set<String> getTestSpecificClasses()
@@ -202,34 +266,37 @@ public class TestListResolver
 
         TestListResolver that = (TestListResolver) o;
 
-        return getIncludedFilters().equals( that.getIncludedFilters() )
-            && getExcludedFilters().equals( that.getExcludedFilters() );
+        return getIncludedPatterns().equals( that.getIncludedPatterns() )
+            && getExcludedPatterns().equals( that.getExcludedPatterns() );
 
     }
 
     @Override
     public int hashCode()
     {
-        int result = getIncludedFilters().hashCode();
-        result = 31 * result + getExcludedFilters().hashCode();
+        int result = getIncludedPatterns().hashCode();
+        result = 31 * result + getExcludedPatterns().hashCode();
         return result;
     }
 
-    private static String removeExclamationMark( String s )
+    static String removeExclamationMark( String s )
     {
         return s.length() != 0 && s.charAt( 0 ) == '!' ? s.substring( 1 ) : s;
     }
 
-    private static void updatedFilters( boolean isExcluded, ResolvedTest test, Collection<ResolvedTest> includedFilters,
+    private static void updatedFilters( boolean isExcluded, ResolvedTest test, IncludedExcludedPatterns patterns,
+                                        Collection<ResolvedTest> includedFilters,
                                         Collection<ResolvedTest> excludedFilters )
     {
         if ( isExcluded )
         {
             excludedFilters.add( test );
+            patterns.hasExcludedMethodPatterns |= test.hasTestMethodPattern();
         }
         else
         {
             includedFilters.add( test );
+            patterns.hasIncludedMethodPatterns |= test.hasTestMethodPattern();
         }
     }
 
@@ -246,16 +313,155 @@ public class TestListResolver
         }
     }
 
-    private static Set<ResolvedTest> selectMethodFilters( Collection<ResolvedTest> filters )
+    private static String aggregatedTest( String testPrefix, Set<ResolvedTest> tests )
+    {
+        String aggregatedTest = "";
+        for ( ResolvedTest test : tests )
+        {
+            String readableTest = test.toString();
+            if ( aggregatedTest.length() != 0 && readableTest != null )
+            {
+                aggregatedTest += ",";
+            }
+            aggregatedTest += testPrefix + readableTest;
+        }
+        return aggregatedTest;
+    }
+
+    private static Collection<String> mergeIncludedAndExcludedTests( Collection<String> included,
+                                                                     Collection<String> excluded )
+    {
+        ArrayList<String> incExc = new ArrayList<String>( included );
+        incExc.removeAll( Collections.<String>singleton( null ) );
+        for ( String exc : excluded )
+        {
+            if ( exc != null )
+            {
+                exc = exc.trim();
+                if ( exc.length() != 0 )
+                {
+                    if ( exc.contains( "!" ) )
+                    {
+                        throw new IllegalArgumentException( "Exclamation mark not expected in 'exclusion': " + exc );
+                    }
+                    exc = exc.replace( ",", ",!" );
+                    if ( !exc.startsWith( "!" ) )
+                    {
+                        exc = "!" + exc;
+                    }
+                    incExc.add( exc );
+                }
+            }
+        }
+        return incExc;
+    }
+
+    static boolean isRegexPrefixedPattern( String pattern )
     {
-        Set<ResolvedTest> selectedFilters = new HashSet<ResolvedTest>( filters.size() );
-        for ( ResolvedTest filter : filters )
+        int indexOfRegex = pattern.indexOf( SelectorUtils.REGEX_HANDLER_PREFIX );
+        int prefixLength = SelectorUtils.REGEX_HANDLER_PREFIX.length();
+        if ( indexOfRegex != -1 )
         {
-            if ( filter.getTestMethodPattern() != null )
+            if ( indexOfRegex != 0
+                || !pattern.endsWith( SelectorUtils.PATTERN_HANDLER_SUFFIX )
+                || pattern.indexOf( SelectorUtils.REGEX_HANDLER_PREFIX, prefixLength ) != -1 )
             {
-                selectedFilters.add( filter );
+                String msg = "Illegal test|includes|excludes regex '%s'. Expected %%regex[class#method] "
+                    + "or !%%regex[class#method] " + "with optional class or #method.";
+                throw new IllegalArgumentException( String.format( msg, pattern ) );
             }
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    static String[] unwrapRegex( String regex )
+    {
+        regex = regex.trim();
+        int from = SelectorUtils.REGEX_HANDLER_PREFIX.length();
+        int to = regex.length() - SelectorUtils.PATTERN_HANDLER_SUFFIX.length();
+        return unwrap( regex.substring( from, to ) );
+    }
+
+    static String[] unwrap( String request )
+    {
+        String[] classAndMethod = new String[] { "", "" };
+        int indexOfHash = request.indexOf( '#' );
+        if ( indexOfHash == -1 )
+        {
+            classAndMethod[0] = request.trim();
+        }
+        else
+        {
+            classAndMethod[0] = request.substring( 0, indexOfHash ).trim();
+            classAndMethod[1] = request.substring( 1 + indexOfHash ).trim();
+        }
+        return classAndMethod;
+    }
+
+    static void nonRegexClassAndMethods( String clazz, String methods, boolean isExcluded,
+                         IncludedExcludedPatterns patterns,
+                         Collection<ResolvedTest> includedFilters, Collection<ResolvedTest> excludedFilters )
+    {
+        for ( String method : StringUtils.split( methods, "+" ) )
+        {
+            method = method.trim();
+            ResolvedTest test = new ResolvedTest( clazz, method, false );
+            if ( !test.isEmpty() )
+            {
+                updatedFilters( isExcluded, test, patterns, includedFilters, excludedFilters );
+            }
+        }
+    }
+
+    /**
+     * Requires trimmed <code>request</code> been not equal to "!".
+     */
+    static void resolveTestRequest( String request, IncludedExcludedPatterns patterns,
+                                    Collection<ResolvedTest> includedFilters, Collection<ResolvedTest> excludedFilters )
+    {
+        final boolean isExcluded = request.startsWith( "!" );
+        ResolvedTest test = null;
+        request = removeExclamationMark( request );
+        if ( isRegexPrefixedPattern( request ) )
+        {
+            final String[] unwrapped = unwrapRegex( request );
+            final boolean hasClass = unwrapped[0].length() != 0;
+            final boolean hasMethod = unwrapped[1].length() != 0;
+            if ( hasClass && hasMethod )
+            {
+                test = new ResolvedTest( unwrapped[0], unwrapped[1], true );
+            }
+            else if ( hasClass )
+            {
+                test = new ResolvedTest( ResolvedTest.Type.CLASS, unwrapped[0], true );
+            }
+            else if ( hasMethod )
+            {
+                test = new ResolvedTest( ResolvedTest.Type.METHOD, unwrapped[1], true );
+            }
+        }
+        else
+        {
+            final int indexOfMethodSeparator = request.indexOf( '#' );
+            if ( indexOfMethodSeparator == -1 )
+            {
+                test = new ResolvedTest( ResolvedTest.Type.CLASS, request, false );
+            }
+            else
+            {
+                String clazz = request.substring( 0, indexOfMethodSeparator );
+                String methods = request.substring( 1 + indexOfMethodSeparator );
+                nonRegexClassAndMethods( clazz, methods, isExcluded, patterns, includedFilters, excludedFilters );
+            }
+        }
+
+        if ( test != null && !test.isEmpty() )
+        {
+            updatedFilters( isExcluded, test, patterns, includedFilters, excludedFilters );
         }
-        return selectedFilters;
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java
new file mode 100644
index 0000000..783209a
--- /dev/null
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java
@@ -0,0 +1,49 @@
+package org.apache.maven.surefire.testset;
+/*
+ * 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 junit.framework.TestCase;
+
+public class ResolvedTestTest
+    extends TestCase
+{
+    public void testEmptyClassRegex()
+    {
+        ResolvedTest test = new ResolvedTest( ResolvedTest.Type.CLASS, "  ", true );
+        assertNull( test.getTestClassPattern() );
+        assertNull( test.getTestMethodPattern() );
+        assertFalse( test.hasTestClassPattern() );
+        assertFalse( test.hasTestMethodPattern() );
+        assertTrue( test.isRegexTestClassPattern() );
+        assertFalse( test.isRegexTestMethodPattern() );
+        assertTrue( test.isEmpty() );
+    }
+
+    public void testEmptyMethodRegex()
+    {
+        ResolvedTest test = new ResolvedTest( ResolvedTest.Type.METHOD, "  ", true );
+        assertNull( test.getTestClassPattern() );
+        assertNull( test.getTestMethodPattern() );
+        assertFalse( test.hasTestClassPattern() );
+        assertFalse( test.hasTestMethodPattern() );
+        assertFalse( test.isRegexTestClassPattern() );
+        assertTrue( test.isRegexTestMethodPattern() );
+        assertTrue( test.isEmpty() );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java
----------------------------------------------------------------------
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java
new file mode 100644
index 0000000..e34e080
--- /dev/null
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java
@@ -0,0 +1,302 @@
+package org.apache.maven.surefire.testset;
+/*
+ * 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 junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+
+public class TestListResolverTest
+    extends TestCase
+{
+    public void testRegexSanity1()
+    {
+        try
+        {
+            TestListResolver.isRegexPrefixedPattern( "#%regex[]" );
+            fail( "#%regex[]" );
+        }
+        catch ( IllegalArgumentException e )
+        {
+            // expected in junit 3.x
+        }
+    }
+
+    public void testRegexSanity2()
+    {
+        try
+        {
+            TestListResolver.isRegexPrefixedPattern( "%regex[]#" );
+            fail( "%regex[]#" );
+        }
+        catch ( IllegalArgumentException e )
+        {
+            // expected in junit 3.x
+        }
+    }
+
+    public void testRegexSanity3()
+    {
+        try
+        {
+            TestListResolver.isRegexPrefixedPattern( "%regex[]%regex[]" );
+            fail( "%regex[]%regex[]" );
+        }
+        catch ( IllegalArgumentException e )
+        {
+            // expected in junit 3.x
+        }
+    }
+
+    public void testRemoveExclamationMark()
+    {
+        String pattern = TestListResolver.removeExclamationMark( "!%regex[]" );
+        assertEquals( "%regex[]", pattern );
+        pattern = TestListResolver.removeExclamationMark( "%regex[]" );
+        assertEquals( "%regex[]", pattern );
+    }
+
+    public void testUnwrapped()
+    {
+        String[] classAndMethod = TestListResolver.unwrap( " MyTest " );
+        assertEquals( "MyTest", classAndMethod[0] );
+        assertEquals( "", classAndMethod[1] );
+        classAndMethod = TestListResolver.unwrap( " # test " );
+        assertEquals( "", classAndMethod[0] );
+        assertEquals( "test", classAndMethod[1] );
+        classAndMethod = TestListResolver.unwrap( " MyTest # test " );
+        assertEquals( "MyTest", classAndMethod[0] );
+        assertEquals( "test", classAndMethod[1] );
+    }
+
+    public void testUnwrappedRegex()
+    {
+        String[] classAndMethod = TestListResolver.unwrapRegex( "%regex[ .*.MyTest.class ]" );
+        assertEquals( ".*.MyTest.class", classAndMethod[0] );
+        assertEquals( "", classAndMethod[1] );
+        classAndMethod = TestListResolver.unwrapRegex( "%regex[ # myMethod|secondTest ]" );
+        assertEquals( "", classAndMethod[0] );
+        assertEquals( "myMethod|secondTest", classAndMethod[1] );
+        classAndMethod = TestListResolver.unwrapRegex( "%regex[ .*.MyTest.class # myMethod|secondTest ]" );
+        assertEquals( ".*.MyTest.class", classAndMethod[0] );
+        assertEquals( "myMethod|secondTest", classAndMethod[1] );
+    }
+
+    public void testMakeRegex()
+    {
+        String regex = ResolvedTest.wrapRegex( ".*.MyTest.class" );
+        assertEquals( "%regex[.*.MyTest.class]", regex );
+    }
+
+    public void testNonRegexClassAndMethod()
+    {
+        Collection<ResolvedTest> includedFilters = new ArrayList<ResolvedTest>();
+        Collection<ResolvedTest> excludedFilters = new ArrayList<ResolvedTest>();
+        IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns();
+        TestListResolver.nonRegexClassAndMethods( "MyTest", "myTest", false, includedExcludedPatterns, includedFilters,
+                                                  excludedFilters );
+        assertTrue( includedExcludedPatterns.hasIncludedMethodPatterns );
+        assertFalse( includedExcludedPatterns.hasExcludedMethodPatterns );
+        assertFalse( includedFilters.isEmpty() );
+        assertTrue( excludedFilters.isEmpty() );
+        assertEquals( 1, includedFilters.size() );
+        ResolvedTest test = includedFilters.iterator().next();
+        assertFalse( test.isEmpty() );
+        assertFalse( test.isRegexTestClassPattern() );
+        assertFalse( test.isRegexTestMethodPattern() );
+        assertTrue( test.hasTestClassPattern() );
+        assertTrue( test.hasTestMethodPattern() );
+        assertEquals( "**/MyTest", test.getTestClassPattern() );
+        assertEquals( "myTest", test.getTestMethodPattern() );
+        assertTrue( test.shouldRun( "MyTest", "myTest" ) );
+        assertFalse( test.shouldRun( "MyTest", "otherTest" ) );
+    }
+
+    public void testNonRegexClassAndMethods()
+    {
+        Collection<ResolvedTest> includedFilters = new ArrayList<ResolvedTest>();
+        Collection<ResolvedTest> excludedFilters = new ArrayList<ResolvedTest>();
+        IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns();
+        TestListResolver.nonRegexClassAndMethods( "MyTest.class", "first*+second*", false, includedExcludedPatterns,
+                                                  includedFilters, excludedFilters );
+        assertTrue( includedExcludedPatterns.hasIncludedMethodPatterns );
+        assertFalse( includedExcludedPatterns.hasExcludedMethodPatterns );
+        assertFalse( includedFilters.isEmpty() );
+        assertTrue( excludedFilters.isEmpty() );
+        assertEquals( 2, includedFilters.size() );
+        Iterator<ResolvedTest> tests = includedFilters.iterator();
+        ResolvedTest first = tests.next();
+        assertFalse( first.isEmpty() );
+        assertFalse( first.isRegexTestClassPattern() );
+        assertFalse( first.isRegexTestMethodPattern() );
+        assertTrue( first.hasTestClassPattern() );
+        assertTrue( first.hasTestMethodPattern() );
+        assertEquals( "**/MyTest.class", first.getTestClassPattern() );
+        assertEquals( "first*", first.getTestMethodPattern() );
+        assertTrue( first.shouldRun( "your/pkg/MyTest.class", "firstTest" ) );
+        ResolvedTest second = tests.next();
+        assertFalse( second.isEmpty() );
+        assertFalse( second.isRegexTestClassPattern() );
+        assertFalse( second.isRegexTestMethodPattern() );
+        assertTrue( second.hasTestClassPattern() );
+        assertTrue( second.hasTestMethodPattern() );
+        assertEquals( "**/MyTest.class", second.getTestClassPattern() );
+        assertEquals( "second*", second.getTestMethodPattern() );
+        assertTrue( second.shouldRun( "your/pkg/MyTest.class", "secondTest" ) );
+        assertFalse( second.shouldRun( "your/pkg/MyTest.class", "thirdTest" ) );
+    }
+
+    public void testNegativeNonRegexClassAndMethod()
+    {
+        Collection<ResolvedTest> includedFilters = new ArrayList<ResolvedTest>();
+        Collection<ResolvedTest> excludedFilters = new ArrayList<ResolvedTest>();
+        IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns();
+        TestListResolver.nonRegexClassAndMethods( "MyTest", "myTest", true, includedExcludedPatterns, includedFilters,
+                                                  excludedFilters );
+        assertFalse( includedExcludedPatterns.hasIncludedMethodPatterns );
+        assertTrue( includedExcludedPatterns.hasExcludedMethodPatterns );
+        assertTrue( includedFilters.isEmpty() );
+        assertEquals( 1, excludedFilters.size() );
+        ResolvedTest test = excludedFilters.iterator().next();
+        assertFalse( test.isEmpty() );
+        assertFalse( test.isRegexTestClassPattern() );
+        assertFalse( test.isRegexTestMethodPattern() );
+        assertTrue( test.hasTestClassPattern() );
+        assertTrue( test.hasTestMethodPattern() );
+        assertEquals( "**/MyTest", test.getTestClassPattern() );
+        assertEquals( "myTest", test.getTestMethodPattern() );
+        // ResolvedTest should not care about isExcluded. This attribute is handled by TestListResolver.
+        assertTrue( test.shouldRun( "MyTest", "myTest" ) );
+        assertFalse( test.shouldRun( "MyTest", "otherTest" ) );
+        assertFalse( test.shouldRun( "pkg/OtherTest.class", "myTest" ) );
+    }
+
+    public void testResolveTestRequest()
+    {
+        Collection<ResolvedTest> includedFilters = new ArrayList<ResolvedTest>();
+        Collection<ResolvedTest> excludedFilters = new ArrayList<ResolvedTest>();
+        IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns();
+        TestListResolver.resolveTestRequest( "!%regex[.*.MyTest.class#myTest]", includedExcludedPatterns,
+                                             includedFilters, excludedFilters );
+        assertFalse( includedExcludedPatterns.hasIncludedMethodPatterns );
+        assertTrue( includedExcludedPatterns.hasExcludedMethodPatterns );
+        assertTrue( includedFilters.isEmpty() );
+        assertFalse( excludedFilters.isEmpty() );
+        assertEquals( 1, excludedFilters.size() );
+        ResolvedTest test = excludedFilters.iterator().next();
+        // ResolvedTest should not care about isExcluded. This attribute is handled by TestListResolver.
+        assertTrue( test.shouldRun( "pkg/MyTest.class", "myTest" ) );
+        assertFalse( test.shouldRun( "pkg/MyTest.class", "otherTest" ) );
+        assertFalse( test.shouldRun( "pkg/OtherTest.class", "myTest" ) );
+    }
+
+    public void testShouldNotRunExcludedMethods()
+    {
+        TestListResolver resolver = new TestListResolver( "!#*Fail*, !%regex[#.*One], !#testSuccessThree" );
+        assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) );
+    }
+
+    public void testShouldNotRunIncludedMethods()
+    {
+        TestListResolver resolver = new TestListResolver( "#*Fail*, %regex[#.*One], #testSuccessThree" );
+        assertFalse( resolver.shouldRun( "pkg/MyTest.class", null ) );
+    }
+
+    public void testShouldRunAny()
+    {
+        TestListResolver resolver = new TestListResolver( "" );
+        assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) );
+
+        resolver = new TestListResolver( Collections.<String>emptySet() );
+        assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) );
+    }
+
+    public void testClassFilter()
+    {
+        TestListResolver resolver = new TestListResolver( "#test" );
+        assertTrue( resolver.createClassFilters().shouldRun( "pkg/MyTest.class", null ) );
+
+        resolver = new TestListResolver( "!#test" );
+        assertTrue( resolver.createClassFilters().shouldRun( "pkg/MyTest.class", null ) );
+
+        resolver = new TestListResolver( "SomeOtherClass" );
+        assertFalse( resolver.createClassFilters().shouldRun( "pkg/MyTest.class", null ) );
+    }
+
+    public void testBrokenPatternThrowsException()
+    {
+        Collection<String> included = Collections.emptySet();
+        Collection<String> excluded = Arrays.asList( "BasicTest, !**/TestTwo, **/TestThree.java" );
+        try
+        {
+            new TestListResolver( included, excluded );
+            fail( "Expected: IllegalArgumentException" );
+        } catch ( IllegalArgumentException e )
+        {
+            // JUnit 3.x style
+            assertEquals( "Exclamation mark not expected in 'exclusion': BasicTest, !**/TestTwo, **/TestThree.java",
+                          e.getLocalizedMessage() );
+        }
+    }
+
+    public void testMultipleExcludedClassesOnly()
+    {
+        Collection<String> included = Collections.emptySet();
+        Collection<String> excluded = Arrays.asList( "BasicTest, **/TestTwo, **/TestThree.java" );
+        TestListResolver resolver = new TestListResolver( included, excluded );
+        assertFalse( resolver.shouldRun( "jiras/surefire745/BasicTest.class", null ) );
+        assertFalse( resolver.shouldRun( "jiras/surefire745/TestTwo.class", null ) );
+        assertFalse( resolver.shouldRun( "jiras/surefire745/TestThree.class", null ) );
+        assertTrue( resolver.shouldRun( "jiras/surefire745/TestFour.class", null ) );
+    }
+
+    public void testMultipleExcludedClasses()
+    {
+        Collection<String> included = Arrays.asList( "**/Test*.java, **/*Test.java, **/*TestCase.java" );
+        Collection<String> excluded = Arrays.asList( "BasicTest, **/TestTwo, **/TestThree.java" );
+        TestListResolver resolver = new TestListResolver( included, excluded );
+        assertFalse( resolver.shouldRun( "jiras/surefire745/BasicTest.class", null ) );
+        assertFalse( resolver.shouldRun( "jiras/surefire745/TestTwo.class", null ) );
+        assertFalse( resolver.shouldRun( "jiras/surefire745/TestThree.class", null ) );
+        assertTrue( resolver.shouldRun( "jiras/surefire745/TestFour.class", null ) );
+    }
+
+    public void testMultipleExcludedClassesWithNoSpecificTests()
+    {
+        Collection<String> included = Arrays.asList( "**/Test*.java, **/*Test.java, **/*TestCase.java" );
+        Collection<String> excluded = Arrays.asList( "BasicTest, **/TestTwo, **/TestThree.java" );
+
+        TestListResolver includedAndExcludedTests = new TestListResolver( included, excluded );
+        TestListResolver includedExcludedClasses = includedAndExcludedTests.createClassFilters();
+
+        TestListResolver specificTests = new TestListResolver( "" );
+        TestListResolver specificClasses = specificTests.createClassFilters();
+
+        TestFilter<String, String> filter = includedExcludedClasses.and( specificClasses );
+
+        assertFalse( filter.shouldRun( "jiras/surefire745/BasicTest.class", null ) );
+        assertFalse( filter.shouldRun( "jiras/surefire745/TestTwo.class", null ) );
+        assertFalse( filter.shouldRun( "jiras/surefire745/TestThree.class", null ) );
+        assertTrue( filter.shouldRun( "jiras/surefire745/TestFour.class", null ) );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
index d46304c..ed29602 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
@@ -84,7 +84,7 @@ public class ForkedBooter
                 classpathConfiguration.isEnableAssertions() );
             startupConfiguration.writeSurefireTestClasspathProperty();
 
-            Object testSet;
+            final Object testSet;
             if ( forkedTestSet != null )
             {
                 testSet = forkedTestSet.getDecodedValue( Thread.currentThread().getContextClassLoader() );

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
index 8081988..f5d96c5 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderFactory.java
@@ -80,11 +80,6 @@ public class ProviderFactory
         }
         finally
         {
-            System.out.println( "TIBOR providerConfiguration: " + providerConfiguration );
-            System.out.println( "TIBOR providerConfiguration.getTestSuiteDefinition(): "
-                                    + providerConfiguration.getTestSuiteDefinition() );
-            System.out.println( "TIBOR providerConfiguration.getTestSuiteDefinition().getTestListResolver(): "
-                                    + providerConfiguration.getTestSuiteDefinition().getTestListResolver() );
             if ( restoreStreams && System.getSecurityManager() == null )
             {
                 System.setOut( orgSystemOut );
@@ -93,7 +88,6 @@ public class ProviderFactory
         }
     }
 
-
     public SurefireProvider createProvider( boolean isInsideFork )
     {
         final Thread currentThread = Thread.currentThread();

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/pom.xml b/surefire-integration-tests/pom.xml
index 6361c50..8990d47 100644
--- a/surefire-integration-tests/pom.xml
+++ b/surefire-integration-tests/pom.xml
@@ -101,9 +101,7 @@
           <forkMode>never</forkMode>
           <argLine>-Xmx512m -XX:MaxPermSize=356m</argLine>
           <includes>
-            <!--<include>org/apache/**/TestMultipleMethodPatternsIT.java</include>-->
-            <include>org/apache/**/JUnit47ParallelIT.java</include>
-            <!--include>org/apache/**/*IT*.java</include-->
+            <include>org/apache/**/*IT*.java</include>
           </includes>
           <!-- Pass current surefire version to the main suite so that it -->
           <!-- can forward to all integration test projects. SUREFIRE-513 -->

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java
new file mode 100644
index 0000000..cf91ef9
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java
@@ -0,0 +1,466 @@
+package org.apache.maven.surefire.its;
+
+/*
+ * 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.Settings;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.junit.Test;
+
+import static org.apache.maven.surefire.its.fixture.TestFramework.*;
+import static org.apache.maven.surefire.its.fixture.Configuration.*;
+import static org.hamcrest.core.AnyOf.anyOf;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assume.assumeThat;
+
+/**
+ * Test project using multiple method patterns, including wildcards in class and method names.
+ */
+public abstract class AbstractTestMultipleMethodPatterns
+    extends SurefireJUnit4IntegrationTestCase
+{
+    protected abstract Settings getSettings();
+
+    protected abstract SurefireLauncher unpack();
+
+    protected SurefireLauncher prepare( String tests )
+    {
+        SurefireLauncher launcher = unpack().addGoal( "-P " + getSettings().profile() );
+        String[] includedExcluded = splitIncludesExcludes( tests );
+        switch ( getSettings().getConfiguration() ) {
+            case TEST:
+                launcher.setTestToRun( tests );
+                break;
+            case INCLUDES:
+                launcher.sysProp( "included", tests );
+                break;
+            case INCLUDES_EXCLUDES:
+                launcher.sysProp( "included", includedExcluded[0] );
+                launcher.sysProp( "excluded", includedExcluded[1] );
+                break;
+            default:
+                throw new IllegalArgumentException( "Unsupported configuration " + getSettings().getConfiguration() );
+        }
+        return launcher;
+    }
+
+    private String[] splitIncludesExcludes( String patterns )
+    {
+        String included = "";
+        String excluded = "";
+        for ( String pattern : patterns.split( "," ) )
+        {
+            pattern = pattern.trim();
+            if ( pattern.startsWith( "!" ) )
+            {
+                excluded += pattern.substring( 1 );
+                excluded += ", ";
+            }
+            else
+            {
+                included += pattern;
+                included += ", ";
+            }
+        }
+        return new String[]{ included, excluded.endsWith( ", " ) ? excluded.substring( 0, excluded.length() - 2 ) : excluded };
+    }
+
+    @Test
+    public void simpleNameTest()
+        throws Exception
+    {
+        prepare( "TestTwo" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void simpleNameTestAsParallel()
+        throws Exception
+    {
+        assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
+        prepare( "TestTwo" )
+            .parallel( "classes" )
+            .useUnlimitedThreads()
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void simpleNameTestWithJavaExt()
+        throws Exception
+    {
+        prepare( "TestTwo.java" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void simpleNameTestWithWildcardPkg()
+        throws Exception
+    {
+        prepare( "**/TestTwo" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void simpleNameTestWithJavaExtWildcardPkg()
+        throws Exception
+    {
+        prepare( "**/TestTwo.java" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void fullyQualifiedTest()
+        throws Exception
+    {
+        prepare( "jiras/surefire745/TestTwo.java" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchSimpleClassNameAndMethod()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "BasicTest#testSuccessTwo" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchSimpleClassNameAndMethodWithJavaExt()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "BasicTest.java#testSuccessTwo" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchSimpleClassNameAndMethodWithWildcardPkg()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "**/BasicTest#testSuccessTwo" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchSimpleClassNameAndMethodWithJavaExtWildcardPkg()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "**/BasicTest.java#testSuccessTwo" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchWildcardPackageAndClassAndMethod()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "jiras/**/BasicTest#testSuccessTwo" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void regexClass()
+        throws Exception
+    {
+        prepare( "%regex[.*.TestTwo.*]" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" );
+    }
+
+    @Test
+    public void testSuccessTwo()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "#testSuccessTwo" )
+            .maven().debugLogging()
+            .executeTest()
+            .verifyErrorFree( 5 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void testRegexSuccessTwo()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "%regex[#testSuccessTwo]" )
+            .executeTest()
+            .verifyErrorFree( 5 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void regexClassAndMethod()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "%regex[.*.BasicTest.*#testSuccessTwo]" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchExactClassAndMethodWildcard()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "BasicTest#test*One" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" );
+    }
+
+    @Test
+    public void shouldMatchExactClassAndMethodsWildcard()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "BasicTest#testSuccess*" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchExactClassAndMethodCharacters()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "BasicTest#test???????One" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" );
+    }
+
+    @Test
+    public void shouldMatchExactClassAndMethodsPostfix()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "TestFive#testSuccess???" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessTwo" );
+    }
+
+    @Test
+    public void shouldMatchExactClassAndMethodPostfix()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "TestFive#testSuccess?????" )
+            .executeTest()
+            .verifyErrorFree( 1 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessThree" );
+    }
+
+    @Test
+    public void shouldMatchExactClassAndMultipleMethods()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "TestFive#testSuccessOne+testSuccessThree" )
+            .executeTest()
+            .verifyErrorFree( 2 )
+            .verifyErrorFreeLog()
+            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessOne" )
+            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessThree" );
+    }
+
+    @Test
+    public void shouldMatchMultiplePatterns()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo"//2
+            + ',' + "jiras/**/TestTwo"//2
+            + ',' + "jiras/surefire745/TestThree#testSuccess*"//2
+            + ',' + "TestFour#testSuccess???"//2
+            + ',' + "jiras/surefire745/*Five#test*One";//1
+
+        prepare( test )
+            .executeTest()
+            .verifyErrorFree( 9 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldMatchMultiplePatternsAsParallel()
+        throws Exception
+    {
+        assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo"//2
+            + ',' + "jiras/**/TestTwo"//2
+            + ',' + "jiras/surefire745/TestThree#testSuccess*"//2
+            + ',' + "TestFour#testSuccess???"//2
+            + ',' + "jiras/surefire745/*Five#test*One";//1
+
+        prepare( test )
+            .parallel( "classes" )
+            .useUnlimitedThreads()
+            .executeTest()
+            .verifyErrorFree( 9 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldMatchMultiplePatternsComplex()
+        throws Exception
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        String test = "**/BasicTest#testSuccessOne+testSuccessTwo"//2
+            + ',' + "jiras/**/TestTwo"//2
+            + ',' + "?????/surefire745/TestThree#testSuccess*"//2
+            + ',' + "jiras/surefire745/TestFour.java#testSuccess???"//2
+            + ',' + "jiras/surefire745/*Five#test*One";//1
+
+        prepare( test )
+            .executeTest()
+            .verifyErrorFree( 9 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldMatchMultiplePatternsComplexAsParallel()
+        throws Exception
+    {
+        assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        String test = "**/BasicTest#testSuccessOne+testSuccessTwo"//2
+            + ',' + "jiras/**/TestTwo"//2
+            + ',' + "?????/surefire745/TestThree#testSuccess*"//2
+            + ',' + "jiras/surefire745/TestFour.java#testSuccess???"//2
+            + ',' + "jiras/surefire745/*Five#test*One";//1
+
+        prepare( test )
+            .parallel( "classes" )
+            .useUnlimitedThreads()
+            .executeTest()
+            .verifyErrorFree( 9 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldNotRunExcludedClasses()
+    {
+        prepare( "!BasicTest, !**/TestTwo, !**/TestThree.java" )
+            .executeTest()
+            .verifyErrorFree( 6 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldNotRunExcludedClassesIfIncluded()
+    {
+        prepare( "TestF*.java, !**/TestFour.java" )
+            .executeTest()
+            .verifyErrorFree( 3 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldNotRunExcludedMethods()
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "!#*Fail*, !%regex[#.*One], !#testSuccessThree" )
+            .executeTest()
+            .verifyErrorFree( 5 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void shouldNotRunExcludedClassesAndMethods()
+    {
+        assumeThat( getSettings().getConfiguration(), is( TEST ) );
+        prepare( "!#*Fail*, !TestFour#testSuccessTwo" )
+            .executeTest()
+            .verifyErrorFree( 11 )
+            .verifyErrorFreeLog();
+    }
+
+    @Test
+    public void negativeTest()
+    {
+        assumeThat( getSettings().getConfiguration(), anyOf( is( INCLUDES ), is( INCLUDES_EXCLUDES ),
+                                                             is( INCLUDES_FILE ), is( INCLUDES_EXCLUDES_FILE ) ) );
+        String pattern = "TestFive#testSuccessOne+testSuccessThree";
+        prepare( pattern )
+            .failNever()
+            .executeTest()
+            .verifyTextInLog( "Method filter prohibited in includes|excludes|includesFile|excludesFile parameter: "
+                                  + pattern );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsIT.java
index 5284ea1..d490ce5 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsIT.java
@@ -19,157 +19,49 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.surefire.its.fixture.OutputValidator;
-import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.Settings;
 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
-import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
+import java.util.Arrays;
 
 /**
- * Test project using multiple method patterns, including wildcards in class and method names.
+ * JUnit test project using multiple method patterns, including wildcards in class and method names.
  */
+@RunWith( Parameterized.class )
 public class TestMultipleMethodPatternsIT
-    extends SurefireJUnit4IntegrationTestCase
+    extends AbstractTestMultipleMethodPatterns
 {
+    private final Settings settings;
 
-    private static final String RUNNING_WITH_JUNIT48 = "parallel='none', perCoreThreadCount=true, threadCount=0";
-
-    /*public OutputValidator multipleMethod( String projectName )
-        throws Exception
-    {
-        return unpack( projectName ).executeTest().verifyErrorFreeLog().assertTestSuiteResults( 7, 0, 0, 0 );
-    }*/
-
-    public SurefireLauncher multipleMethod( String projectName )
-        throws Exception
-    {
-        return unpack( projectName );
-    }
-
-
-    /*@Test
-    public void testJunit48()
-        throws Exception
-    {
-        multipleMethod( "junit48-multiple-method-patterns" ).verifyTextInLog( RUNNING_WITH_JUNIT48 );
-    }*/
-
-    @Test
-    public void shouldMatchExactClassAndMethod()
-        throws Exception
-    {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "BasicTest#testSuccessTwo" )
-            .executeTest()
-            .verifyErrorFree( 1 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
-    }
-
-    @Test
-    public void shouldMatchWildcardPackageAndExactClassAndMethod()
-        throws Exception
-    {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "jiras.**.BasicTest#testSuccessTwo" )
-            .executeTest()
-            .verifyErrorFree( 1 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
-    }
-
-    @Test
-    public void shouldMatchExactClassAndMethodWildcard()
-        throws Exception
+    public TestMultipleMethodPatternsIT( Settings settings )
     {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .maven()
-            .addGoal( "-e" ).addGoal( "-X" )
-            .debugLogging().sysProp( "test", "BasicTest#test*One" )
-            .executeTest()
-            .verifyErrorFree( 1 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" );
+        this.settings = settings;
     }
 
-    @Test
-    public void shouldMatchExactClassAndMethodsWildcard()
-        throws Exception
+    @Parameterized.Parameters
+    public static Iterable<Object[]> data()
     {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "BasicTest#testSuccess*" )
-            .executeTest()
-            .verifyErrorFree( 2 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" )
-            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" );
+        return Arrays.asList( new Object[][]{
+            { Settings.JUNIT4_TEST },
+            { Settings.JUNIT47_TEST },
+            { Settings.JUNIT4_INCLUDES },
+            { Settings.JUNIT47_INCLUDES },
+            { Settings.JUNIT4_INCLUDES_EXCLUDES },
+            { Settings.JUNIT47_INCLUDES_EXCLUDES }
+        } );
     }
 
-    @Test
-    public void shouldMatchExactClassAndMethodCharacters()
-        throws Exception
+    @Override
+    protected Settings getSettings()
     {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "BasicTest#test???????One" )
-            .executeTest()
-            .verifyErrorFree( 1 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" );
+        return settings;
     }
 
-    @Test
-    public void shouldMatchExactClassAndMethodsPostfix()
-        throws Exception
+    @Override
+    protected SurefireLauncher unpack()
     {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "TestFive#testSuccess???" )
-            .executeTest()
-            .verifyErrorFree( 2 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessOne" )
-            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessTwo" );
+        return unpack( "junit48-multiple-method-patterns", "_" + settings.path() );
     }
-
-    @Test
-    public void shouldMatchExactClassAndMethodPostfix()
-        throws Exception
-    {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "TestFive#testSuccess?????" )
-            .executeTest()
-            .verifyErrorFree( 1 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessThree" );
-    }
-
-    @Test
-    public void shouldMatchExactClassAndMultipleMethods()
-        throws Exception
-    {
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( "TestFive#testSuccessOne+testSuccessThree" )
-            .executeTest()
-            .verifyErrorFree( 2 )
-            .verifyErrorFreeLog()
-            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessOne" )
-            .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessThree" );
-    }
-
-    @Test
-    public void shouldMatchMultiplePatterns()
-        throws Exception
-    {
-        String test = "jiras.surefire745.BasicTest#testSuccessOne+testSuccessTwo"//2
-                + ',' + "jiras.**.TestTwo"//2
-                + ',' + "jiras.surefire745.TestThree#testSuccess*"//2
-                + ',' + "jiras.surefire745.TestFour#testSuccess???"//2
-                + ',' + "jiras.surefire745.*Five#test*One";//1
-
-        multipleMethod( "junit48-multiple-method-patterns" )
-            .setTestToRun( test )
-            .executeTest()
-            .verifyErrorFree( 9 )
-            .verifyErrorFreeLog();
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsTestNGIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsTestNGIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsTestNGIT.java
new file mode 100644
index 0000000..2de3670
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodPatternsTestNGIT.java
@@ -0,0 +1,64 @@
+package org.apache.maven.surefire.its;
+
+/*
+ * 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.Settings;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+
+/**
+ * TestNG test project using multiple method patterns, including wildcards in class and method names.
+ */
+@RunWith( Parameterized.class )
+public class TestMultipleMethodPatternsTestNGIT
+    extends AbstractTestMultipleMethodPatterns
+{
+    private final Settings settings;
+
+    public TestMultipleMethodPatternsTestNGIT( Settings settings )
+    {
+        this.settings = settings;
+    }
+
+    @Parameterized.Parameters
+    public static Iterable<Object[]> data()
+    {
+        return Arrays.asList( new Object[][]{
+            { Settings.TestNG_TEST },
+            { Settings.TestNG_INCLUDES },
+            { Settings.TestNG_INCLUDES_EXCLUDES }
+        } );
+    }
+
+    @Override
+    protected Settings getSettings()
+    {
+        return settings;
+    }
+
+    @Override
+    protected SurefireLauncher unpack()
+    {
+        return unpack( "testng-multiple-method-patterns", "_" + settings.path() );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Configuration.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Configuration.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Configuration.java
new file mode 100644
index 0000000..dcd8184
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Configuration.java
@@ -0,0 +1,29 @@
+package org.apache.maven.surefire.its.fixture;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
+ * @since 2.19
+ */
+public enum Configuration
+{
+    TEST, INCLUDES, INCLUDES_FILE, INCLUDES_EXCLUDES, INCLUDES_EXCLUDES_FILE
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Settings.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Settings.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Settings.java
new file mode 100644
index 0000000..28013fb
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/Settings.java
@@ -0,0 +1,72 @@
+package org.apache.maven.surefire.its.fixture;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
+ * @since 2.19
+ */
+public enum Settings
+{
+    JUNIT4_TEST( TestFramework.JUNIT4, Configuration.TEST ),
+    JUNIT47_TEST( TestFramework.JUNIT47, Configuration.TEST ),
+    JUNIT4_INCLUDES( TestFramework.JUNIT4, Configuration.INCLUDES ),
+    JUNIT47_INCLUDES( TestFramework.JUNIT47, Configuration.INCLUDES ),
+    JUNIT4_INCLUDES_EXCLUDES( TestFramework.JUNIT4, Configuration.INCLUDES_EXCLUDES ),
+    JUNIT47_INCLUDES_EXCLUDES( TestFramework.JUNIT47, Configuration.INCLUDES_EXCLUDES ),
+    JUNIT4_INCLUDES_FILE( TestFramework.JUNIT4, Configuration.INCLUDES_FILE ),
+    JUNIT47_INCLUDES_FILE( TestFramework.JUNIT47, Configuration.INCLUDES_FILE ),
+    JUNIT4_INCLUDES_EXCLUDES_FILE( TestFramework.JUNIT4, Configuration.INCLUDES_EXCLUDES_FILE ),
+    JUNIT47_INCLUDES_EXCLUDES_FILE( TestFramework.JUNIT47, Configuration.INCLUDES_EXCLUDES_FILE ),
+    TestNG_TEST( TestFramework.TestNG, Configuration.TEST ),
+    TestNG_INCLUDES( TestFramework.TestNG, Configuration.INCLUDES ),
+    TestNG_INCLUDES_EXCLUDES( TestFramework.TestNG, Configuration.INCLUDES_EXCLUDES ),
+    TestNG_INCLUDES_FILE( TestFramework.TestNG, Configuration.INCLUDES_FILE ),
+    TestNG_INCLUDES_EXCLUDES_FILE( TestFramework.TestNG, Configuration.INCLUDES_EXCLUDES_FILE );
+
+    private final TestFramework framework;
+    private final Configuration configuration;
+
+    Settings( TestFramework framework, Configuration configuration )
+    {
+        this.framework = framework;
+        this.configuration = configuration;
+    }
+
+    public String path()
+    {
+        return name().replace( '_', '-' ).toLowerCase();
+    }
+
+    public String profile()
+    {
+        return path();
+    }
+
+    public TestFramework getFramework()
+    {
+        return framework;
+    }
+
+    public Configuration getConfiguration()
+    {
+        return configuration;
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
index 599d916..ff49392 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/SurefireJUnit4IntegrationTestCase.java
@@ -38,8 +38,12 @@ public abstract class SurefireJUnit4IntegrationTestCase
 
     public SurefireLauncher unpack( String sourceName )
     {
-        MavenLauncher mavenLauncher = new MavenLauncher( this.getClass(), sourceName, "" );
-        return new SurefireLauncher( mavenLauncher );
+        return unpack( getClass(), sourceName, "" );
+    }
+
+    public SurefireLauncher unpack( String sourceName, String suffix )
+    {
+        return unpack( getClass(), sourceName, suffix );
     }
 
     public static SurefireLauncher unpack( Class testClass, String sourceName, String suffix )

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/TestFramework.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/TestFramework.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/TestFramework.java
new file mode 100644
index 0000000..c544347
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/TestFramework.java
@@ -0,0 +1,29 @@
+package org.apache.maven.surefire.its.fixture;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
+ * @since 2.19
+ */
+public enum TestFramework
+{
+    JUNIT4, JUNIT47, TestNG
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
index f267ee8..eaecc90 100755
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
@@ -28,6 +28,6 @@ public class Surefire847AdditionalFailureIT
     public void testJUnitRunCategoryAB()
     {
         unpack( "surefire-847-testngfail" ).setTestToRun(
-            "org.codehaus.SomePassedTest" ).executeTest().verifyErrorFreeLog();
+            "org/codehaus/SomePassedTest" ).executeTest().verifyErrorFreeLog();
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml b/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
index ea40f37..101dad1 100644
--- a/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit44-multiple-methods/pom.xml
@@ -23,11 +23,22 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
   <groupId>org.apache.maven.plugins.surefire</groupId>
   <artifactId>junit4</artifactId>
   <version>1.0-SNAPSHOT</version>
   <name>Test for JUnit 4</name>
 
+  <!--
+  This is using junit 4.0 provider.
+  Same test in junit48-multiple-methods is used with different provider junit 4.7.
+  -->
 
   <properties>
     <junitVersion>4.4</junitVersion>
@@ -55,9 +66,8 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>${surefire.version}</version>
         <configuration>
-          <test>junit4.BasicTest#testSuccessOne+testFailOne,junit4.TestThree#testSuccessTwo</test>
+          <test>junit4/BasicTest#testSuccessOne+testFailOne,junit4/TestThree#testSuccessTwo</test>
         </configuration>
       </plugin>
     </plugins>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/resources/junit48-multiple-method-patterns/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit48-multiple-method-patterns/pom.xml b/surefire-integration-tests/src/test/resources/junit48-multiple-method-patterns/pom.xml
index f5ee204..00ebfa5 100644
--- a/surefire-integration-tests/src/test/resources/junit48-multiple-method-patterns/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit48-multiple-method-patterns/pom.xml
@@ -29,9 +29,14 @@
     <relativePath>../pom.xml</relativePath>
   </parent>
   <groupId>org.apache.maven.plugins.surefire</groupId>
-  <artifactId>jiras-surefire-745</artifactId>
+  <artifactId>jiras-surefire-745-junit</artifactId>
   <version>1.0</version>
 
+  <properties>
+    <included/>
+    <excluded/>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>
@@ -54,20 +59,145 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <!--<test>
-          iras.surefire745.BasicTest#testSuccessOne+testSuccessTwo,iras.surefire745.TestThree#testSuccess*,iras.surefire745.TestFour#testSuccess???,iras.surefire745.*Five#test*One
-          </test>-->
-        </configuration>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.maven.surefire</groupId>
-            <artifactId>surefire-junit47</artifactId>
-            <version>${surefire.version}</version>
-          </dependency>
-        </dependencies>
       </plugin>
     </plugins>
   </build>
 
+  <profiles>
+    <profile>
+      <id>junit4-test</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.maven.surefire</groupId>
+                <artifactId>surefire-junit4</artifactId>
+                <version>${surefire.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>junit47-test</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.maven.surefire</groupId>
+                <artifactId>surefire-junit47</artifactId>
+                <version>${surefire.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>junit4-includes</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <includes>
+                <include>${included}</include>
+              </includes>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.maven.surefire</groupId>
+                <artifactId>surefire-junit4</artifactId>
+                <version>${surefire.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>junit47-includes</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <includes>
+                <include>${included}</include>
+              </includes>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.maven.surefire</groupId>
+                <artifactId>surefire-junit47</artifactId>
+                <version>${surefire.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>junit4-includes-excludes</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <includes>
+                <include>${included}</include>
+              </includes>
+              <excludes>
+                <exclude>${excluded}</exclude>
+              </excludes>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.maven.surefire</groupId>
+                <artifactId>surefire-junit4</artifactId>
+                <version>${surefire.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>junit47-includes-excludes</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <includes>
+                <include>${included}</include>
+              </includes>
+              <excludes>
+                <exclude>${excluded}</exclude>
+              </excludes>
+            </configuration>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.maven.surefire</groupId>
+                <artifactId>surefire-junit47</artifactId>
+                <version>${surefire.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/866a535b/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml b/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
index df8a981..635acb7 100644
--- a/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
+++ b/surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml
@@ -23,6 +23,13 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
+  <parent>
+    <groupId>org.apache.maven.surefire</groupId>
+    <artifactId>it-parent</artifactId>
+    <version>1.0</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
   <groupId>org.apache.maven.plugins.surefire</groupId>
   <artifactId>junit4</artifactId>
   <version>1.0-SNAPSHOT</version>
@@ -55,9 +62,8 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>${surefire.version}</version>
         <configuration>
-          <test>junit4.BasicTest#testSuccessOne+testFailOne,junit4.TestThree#testSuccessTwo</test>
+          <test>junit4/BasicTest#testSuccessOne+testFailOne,junit4/TestThree#testSuccessTwo</test>
         </configuration>
         <dependencies>
           <dependency>


Mime
View raw message