maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1060395 - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ surefire-booter/src/main/java/org/apache/maven/surefire/booter/ surefire-integration-tests/src/test/java/org/apache/maven/surefire/it...
Date Tue, 18 Jan 2011 14:37:18 GMT
Author: krosenvold
Date: Tue Jan 18 14:37:17 2011
New Revision: 1060395

URL: http://svn.apache.org/viewvc?rev=1060395&view=rev
Log:
[SUREFIRE-685] Multiple includes/excludes on same parameter not respected (regresion)

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire685CommaSeparatedIncludesIT.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/pom.xml
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestA.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestB.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestC.java
  (with props)
Modified:
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java?rev=1060395&r1=1060394&r2=1060395&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
(original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
Tue Jan 18 14:37:17 2011
@@ -213,6 +213,10 @@ public class IntegrationTestMojo
             &nbsp;&lt;include>**&#47;*ITCase.java&lt;/include><br/>
         &lt;/includes><br/>
      * </code>
+     *
+     * Each include item may also contain a comma-separated sublist of items, which will
be treated as multiple &nbsp;&lt;include>
+     * entries.<br/>
+     *
      * This parameter is ignored if the TestNG <code>suiteXmlFiles</code> parameter
is specified.
      *
      * @parameter
@@ -230,6 +234,9 @@ public class IntegrationTestMojo
      * (which excludes all inner classes).<br>
      * This parameter is ignored if the TestNG <code>suiteXmlFiles</code> parameter
is specified.
      *
+     * Each exclude item may also contain a comma-separated sublist of items, which will
be treated as multiple &nbsp;&lt;exclude>
+     * entries.<br/>
+     *
      * @parameter
      */
     private List excludes;

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java?rev=1060395&r1=1060394&r2=1060395&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
(original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/PropertiesWrapper.java
Tue Jan 18 14:37:17 2011
@@ -233,14 +233,23 @@ public class PropertiesWrapper
         {
             return;
         }
-        for ( int i = 0; i < items.size(); i++ )
+        int i = 0;
+        for (Iterator iterator = items.iterator(); iterator.hasNext();)
         {
-            Object item = items.get( i );
+            Object item = iterator.next();
             if ( item == null )
             {
                 throw new NullPointerException( propertyPrefix + i + " has null value" );
             }
-            properties.setProperty( propertyPrefix + i, item.toString() );
+
+            String[] stringArray = StringUtils.split(item.toString(), ",");
+
+            for ( int j = 0; j < stringArray.length; j++ )
+            {
+                properties.setProperty( propertyPrefix + i, stringArray[j] );
+                i++;
+            }
+
         }
     }
 

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire685CommaSeparatedIncludesIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire685CommaSeparatedIncludesIT.java?rev=1060395&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire685CommaSeparatedIncludesIT.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire685CommaSeparatedIncludesIT.java
Tue Jan 18 14:37:17 2011
@@ -0,0 +1,41 @@
+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.
+ */
+
+
+/**
+ * SUREFIRE-685 Asserts that only the specified tests are run with comma separated includes
+ *
+ * @author Kristian Rosenvold
+ */
+public class Surefire685CommaSeparatedIncludesIT
+    extends SurefireVerifierTestClass
+{
+    public Surefire685CommaSeparatedIncludesIT()
+    {
+        super( "/surefire-685-commaseparatedIncludes" );
+    }
+
+    public void testBuildFailingWhenErrors()
+        throws Exception
+    {
+        executeTest();
+        assertTestSuiteResults( 2, 0, 0, 0 );
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire685CommaSeparatedIncludesIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/pom.xml?rev=1060395&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/pom.xml
Tue Jan 18 14:37:17 2011
@@ -0,0 +1,58 @@
+<?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>
+
+    <groupId>org.apache.maven.plugins.surefire</groupId>
+    <artifactId>surefire-685-commaseparatedIncludes</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <name>surefire-685-commaseparatedIncludes</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${surefire.version}</version>
+                <configuration>
+                    <forkMode>once</forkMode>
+                    <includes>
+                        <include>**/TestA.java,**/TestB.java</include>
+                    </includes>
+                </configuration>
+                <dependencies>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestA.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestA.java?rev=1060395&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestA.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestA.java
Tue Jan 18 14:37:17 2011
@@ -0,0 +1,10 @@
+package surefire685;
+import junit.framework.TestCase;
+
+
+public class TestA
+    extends TestCase
+{
+    public void testTwo() {
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestA.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestB.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestB.java?rev=1060395&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestB.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestB.java
Tue Jan 18 14:37:17 2011
@@ -0,0 +1,10 @@
+package surefire685;
+import junit.framework.TestCase;
+
+
+public class TestB
+    extends TestCase
+{
+    public void testTwo() {
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestC.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestC.java?rev=1060395&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestC.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestC.java
Tue Jan 18 14:37:17 2011
@@ -0,0 +1,10 @@
+package surefire685;
+import junit.framework.TestCase;
+
+
+public class TestC
+    extends TestCase
+{
+    public void testTwo() {
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685/TestC.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message