You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2016/08/20 12:33:11 UTC

maven-surefire git commit: [SUREFIRE-1260] Add **/*Tests.java as one of the default include patterns

Repository: maven-surefire
Updated Branches:
  refs/heads/master 0d3458633 -> 2a4f413f9


[SUREFIRE-1260]  Add **/*Tests.java as one of the default include patterns


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/2a4f413f
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/2a4f413f
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/2a4f413f

Branch: refs/heads/master
Commit: 2a4f413f9efd9a5d2ab53b1026c126c47856f71d
Parents: 0d34586
Author: Tibor17 <ti...@lycos.com>
Authored: Sat Aug 20 14:23:52 2016 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Sat Aug 20 14:23:52 2016 +0200

----------------------------------------------------------------------
 .../maven/plugin/surefire/SurefirePlugin.java   |  3 +-
 .../apt/examples/inclusion-exclusion.apt.vm     |  3 ++
 .../its/jiras/Surefire1260NewTestsPattern.java  |  1 +
 .../surefire-1260-new-tests-pattern/pom.xml     |  1 +
 .../src/test/java/pkg/JUnit3Tests.java          | 34 ++++++++++++++++
 .../src/test/java/pkg/JUnit4Tests.java          | 42 ++++++++++++++++++++
 6 files changed, 83 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2a4f413f/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
index 52a6210..291bf25 100644
--- a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
+++ b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
@@ -168,6 +168,7 @@ public class SurefirePlugin
      * &lt;includes><br/>
      * &nbsp;&lt;include>**&#47;Test*.java&lt;/include><br/>
      * &nbsp;&lt;include>**&#47;*Test.java&lt;/include><br/>
+     * &nbsp;&lt;include>**&#47;*Tests.java&lt;/include><br/>
      * &nbsp;&lt;include>**&#47;*TestCase.java&lt;/include><br/>
      * &lt;/includes><br/>
      * </code>
@@ -341,7 +342,7 @@ public class SurefirePlugin
 
     protected String[] getDefaultIncludes()
     {
-        return new String[]{ "**/Test*.java", "**/*Test.java", "**/*TestCase.java" };
+        return new String[]{ "**/Test*.java", "**/*Test.java", "**/*Tests.java", "**/*TestCase.java" };
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2a4f413f/maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm b/maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
index 143e026..22b1ce2 100644
--- a/maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/inclusion-exclusion.apt.vm
@@ -40,6 +40,9 @@ Inclusions and Exclusions of Tests
    * <<<"**/*Test.java">>> - includes all of its subdirectories and all Java
    filenames that end with "Test".
 
+   * <<<"**/*Tests.java">>> - includes all of its subdirectories and all Java
+   filenames that end with "Tests".
+
    * <<<"**/*TestCase.java">>> - includes all of its subdirectories and all Java
    filenames that end with "TestCase".
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2a4f413f/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java
new file mode 100644
index 0000000..63b1e24
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java
@@ -0,0 +1 @@
+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.*;
import org.junit.Test;

/**
 * Added included pattern Tests.java.
 * <p>
 * Found in Surefir
 e 2.19.1.
 *
 * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
 * @see {@linkplain https://jira.codehaus.org/browse/SUREFIRE-12-60}
 * @since 2.19.2
 */
public class Surefire1260NewTestsPattern
        extends SurefireJUnit4IntegrationTestCase
{
    @Test
    public void defaultConfig()
    {
        unpack()
                .executeTest()
                .verifyErrorFree( 5 );
    }

    private SurefireLauncher unpack()
    {
        return unpack( "/surefire-1260-new-tests-pattern" );
    }
}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2a4f413f/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/pom.xml b/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/pom.xml
new file mode 100644
index 0000000..c6673b8
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/pom.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ 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.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         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>surefire-1260</artifactId>
    <version>1.0</version>

    <url>http://maven.apache.org</url>

    <developers>
        <developer>
            <id>tibordigana</id>
            <name>Tibor Diga\u0148a (tibor17)</name>
            <email>tibordigana@apache.org</email>
            <roles>
                <role>PMC</role>
            </roles>
            <timezone>Europe/Bratislava</timezone>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.0</version>
   
          <scope>test</scope>
        </dependency>
    </dependencies>
</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2a4f413f/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit3Tests.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit3Tests.java b/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit3Tests.java
new file mode 100644
index 0000000..d607a3b
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit3Tests.java
@@ -0,0 +1,34 @@
+package pkg;
+
+/*
+ * 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 JUnit3Tests extends TestCase
+{
+    public void test1()
+    {
+    }
+
+    public void test2()
+    {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2a4f413f/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit4Tests.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit4Tests.java b/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit4Tests.java
new file mode 100644
index 0000000..f34aee7
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkg/JUnit4Tests.java
@@ -0,0 +1,42 @@
+package pkg;
+
+/*
+ * 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.junit.Test;
+
+public class JUnit4Tests
+{
+
+    @Test
+    public void shouldTestA()
+    {
+    }
+
+    @Test
+    public void shouldTestB()
+    {
+    }
+
+    @Test
+    public void shouldTestC()
+    {
+    }
+
+}