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 2015/09/30 00:55:39 UTC

[1/7] maven-surefire git commit: Quick fix for SUREFIRE-1177 and SUREFIRE-1179

Repository: maven-surefire
Updated Branches:
  refs/heads/master feda08851 -> 3dba8e7bd


Quick fix for SUREFIRE-1177 and SUREFIRE-1179


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

Branch: refs/heads/master
Commit: f3bbccbe48888cfc7eb2134af4dcc0fcd32edb94
Parents: feda088
Author: Julien Herr <ju...@alcatel-lucent.com>
Authored: Fri Sep 18 16:19:10 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:52 2015 +0200

----------------------------------------------------------------------
 .../surefire/testng/conf/TestNGMapConfigurator.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/f3bbccbe/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
index ff7378d..0d7d625 100755
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -113,6 +113,14 @@ public class TestNGMapConfigurator
             {
                 val = convert ( val, String.class );
             }
+            else if ( "suitethreadpoolsize".equals( key ) )
+            {
+                val = convert( val, Integer.class );
+            }
+            else if ( "dataproviderthreadcount".equals( key ) )
+            {
+                val = convert( val, Integer.class );
+            }
             // TODO objectfactory... not even documented, does it work?
             if ( key.startsWith( "-" ) )
             {
@@ -161,6 +169,11 @@ public class TestNGMapConfigurator
             return Boolean.valueOf( (String) val );
         }
 
+        if ( ( Integer.class.equals( type ) || int.class.equals( type ) ) && String.class.equals( val.getClass() ) )
+        {
+            return Integer.valueOf( (String) val );
+        }
+
         if ( String.class.equals( type ) )
         {
             return val.toString();


[3/7] maven-surefire git commit: Update test to override default TestNG value of dataproviderthreadcount

Posted by ti...@apache.org.
Update test to override default TestNG value of dataproviderthreadcount


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

Branch: refs/heads/master
Commit: 3cf2ba7334e4b2e11dc64220b30743fa6c6890ac
Parents: ec64bd5
Author: Julien Herr <ju...@alcatel-lucent.com>
Authored: Mon Sep 28 15:13:53 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:54 2015 +0200

----------------------------------------------------------------------
 .../test/java/org/apache/maven/surefire/its/Surefire1179IT.java    | 2 +-
 .../resources/surefire-1179-testng-parallel-dataprovider/pom.xml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/3cf2ba73/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
index 6acb97b..d29ccf9 100644
--- a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
@@ -33,7 +33,7 @@ public class Surefire1179IT
     @Test
     public void suiteXmlForkCountTwoReuse()
     {
-        unpack().executeTest().verifyErrorFreeLog().verifyTextInLog( " CONCURRENCY=10." );
+        unpack().executeTest().verifyErrorFreeLog().verifyTextInLog( " CONCURRENCY=30." );
     }
 
     private SurefireLauncher unpack()

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/3cf2ba73/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
index 90d2238..97414b3 100644
--- a/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
+++ b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
@@ -50,7 +50,7 @@
                         </property>
                         <property>
                             <name>dataproviderthreadcount</name>
-                            <value>10</value>
+                            <value>30</value>
                         </property>
                     </properties>
                 </configuration>


[2/7] maven-surefire git commit: [SUREFIRE-1179] integration test

Posted by ti...@apache.org.
[SUREFIRE-1179] integration test


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

Branch: refs/heads/master
Commit: 65b26d12051c5ddb973238ed10b3ae5d334159c9
Parents: f3bbccb
Author: Tibor17 <ti...@lycos.com>
Authored: Sun Sep 27 01:18:12 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:53 2015 +0200

----------------------------------------------------------------------
 .../maven/surefire/its/Surefire1179IT.java      | 43 ++++++++++++++
 .../pom.xml                                     | 60 ++++++++++++++++++++
 .../src/test/java/debug/ParallelTest.java       | 45 +++++++++++++++
 3 files changed, 148 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/65b26d12/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
new file mode 100644
index 0000000..6acb97b
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire1179IT.java
@@ -0,0 +1,43 @@
+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.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.junit.Test;
+
+/**
+ * Fix for TestNG parameter -dataproviderthreadcount.
+ */
+public class Surefire1179IT
+    extends SurefireJUnit4IntegrationTestCase
+{
+
+    @Test
+    public void suiteXmlForkCountTwoReuse()
+    {
+        unpack().executeTest().verifyErrorFreeLog().verifyTextInLog( " CONCURRENCY=10." );
+    }
+
+    private SurefireLauncher unpack()
+    {
+        return unpack( "surefire-1179-testng-parallel-dataprovider" );
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/65b26d12/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
new file mode 100644
index 0000000..90d2238
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
@@ -0,0 +1,60 @@
+<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/xsd/maven-4.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-1179-testng-parallel-dataprovider</artifactId>
+    <version>1.0</version>
+    <url>http://maven.apache.org</url>
+    <developers>
+        <developer>
+            <id>tibordigana</id>
+            <name>Tibor Digaňa (tibor17)</name>
+            <email>tibordigana@apache.org</email>
+            <roles>
+                <role>Committer</role>
+            </roles>
+            <timezone>Europe/Bratislava</timezone>
+        </developer>
+    </developers>
+    <dependencies>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>6.9.6</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <properties>
+                        <property>
+                            <name>parallel</name>
+                            <value>methods</value>
+                        </property>
+                        <property>
+                            <name>dataproviderthreadcount</name>
+                            <value>10</value>
+                        </property>
+                    </properties>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/65b26d12/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java
new file mode 100644
index 0000000..6863f62
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java
@@ -0,0 +1,45 @@
+package debug;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class ParallelTest
+{
+    private static final AtomicInteger concurrency = new AtomicInteger();
+
+    private static final AtomicInteger counter = new AtomicInteger();
+
+    @DataProvider( parallel = true, name = "dataProvider" )
+    public Iterator<Object[]> dataProvider()
+    {
+        List<Object[]> data = new ArrayList<Object[]>();
+        for ( int i = 0; i < 5000; i++ )
+        {
+            data.add( new Object[]{ "ID_" + i } );
+        }
+        return data.iterator();
+    }
+
+    @Test( dataProvider = "dataProvider" )
+    public void testParallelDataProvider( String iterId )
+        throws Exception
+    {
+        int methodCount = counter.incrementAndGet();
+        int currentlyParallelCalls = concurrency.incrementAndGet();
+        if ( methodCount % 100 == 0 )
+        {
+            System.out.println( iterId + ": CONCURRENCY=" + currentlyParallelCalls + "." );
+        }
+        TimeUnit.MILLISECONDS.sleep( 20 );
+        concurrency.decrementAndGet();
+    }
+}
\ No newline at end of file


[5/7] maven-surefire git commit: Update class equality convention

Posted by ti...@apache.org.
Update class equality convention


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

Branch: refs/heads/master
Commit: 80a5df76ff2411fcd2aee2fa8b289157f8f89af8
Parents: 3cf2ba7
Author: Julien Herr <ju...@alcatel-lucent.com>
Authored: Mon Sep 28 15:28:02 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:55 2015 +0200

----------------------------------------------------------------------
 .../maven/surefire/testng/conf/TestNGMapConfigurator.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/80a5df76/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
index 0d7d625..1ffcba1 100755
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -164,17 +164,17 @@ public class TestNGMapConfigurator
             return val;
         }
 
-        if ( ( Boolean.class.equals( type ) || boolean.class.equals( type ) ) && String.class.equals( val.getClass() ) )
+        if ( ( type == Boolean.class || type == boolean.class ) && val.getClass() == String.class )
         {
             return Boolean.valueOf( (String) val );
         }
 
-        if ( ( Integer.class.equals( type ) || int.class.equals( type ) ) && String.class.equals( val.getClass() ) )
+        if ( ( type == Integer.class || type == int.class ) && val.getClass() == String.class )
         {
             return Integer.valueOf( (String) val );
         }
 
-        if ( String.class.equals( type ) )
+        if ( type == String.class )
         {
             return val.toString();
         }


[7/7] maven-surefire git commit: [SUREFIRE-1177] added documentation, minimum required TestNG version in IT and refactoring

Posted by ti...@apache.org.
[SUREFIRE-1177] added documentation, minimum required TestNG version in IT and refactoring


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

Branch: refs/heads/master
Commit: 3dba8e7bdc54a8be1b7e2e349a492d601dd7a4fc
Parents: dcf925e
Author: Tibor17 <ti...@lycos.com>
Authored: Wed Sep 30 00:52:47 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:57 2015 +0200

----------------------------------------------------------------------
 .../src/site/apt/examples/testng.apt.vm         | 26 ++++++++++++++++++++
 .../pom.xml                                     |  3 ++-
 .../testng/conf/TestNG510Configurator.java      | 21 ++++++++--------
 .../testng/conf/TestNGMapConfigurator.java      |  4 +++
 4 files changed, 43 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/3dba8e7b/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
----------------------------------------------------------------------
diff --git a/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm b/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
index 489771b..e9c6cde 100644
--- a/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
@@ -170,6 +170,32 @@ Using TestNG
 
   This is particularly useful for slow tests that can have high concurrency, or to quickly and roughly assess the independence
   and thread safety of your tests and code.
+  
+  TestNG 5.10 or higher allows you to run methods in parallel test using data provider.
+  
++---+
+</plugins>
+    [...]
+      <plugin>
+        <groupId>${project.groupId}</groupId>
+        <artifactId>${project.artifactId}</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <properties>
+            <property>
+              <name>parallel</name>
+              <value>methods</value>
+            </property>
+            <property>
+              <name>dataproviderthreadcount</name>
+              <value>30</value>
+            </property>
+          </properties>
+        </configuration>
+      </plugin>
+    [...]
+</plugins>
++---+
 
   See also {{{./fork-options-and-parallel-execution.html}Fork Options and Parallel Test Execution}}.
 

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/3dba8e7b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
index 97414b3..4366138 100644
--- a/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
+++ b/surefire-integration-tests/src/test/resources/surefire-1179-testng-parallel-dataprovider/pom.xml
@@ -26,7 +26,8 @@
         <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
-            <version>6.9.6</version>
+            <version>5.10</version>
+            <classifier>jdk15</classifier>
         </dependency>
     </dependencies>
     <build>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/3dba8e7b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
index 2bb2577..8e12008 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
@@ -25,7 +25,7 @@ import org.testng.xml.XmlSuite;
 import java.util.Map;
 
 /**
- * TestNG 5.10 configurator. Add support of dataproviderthreadcount
+ * TestNG 5.10 configurator. Added support of dataproviderthreadcount.
  *
  * @since 2.19
  */
@@ -33,15 +33,16 @@ public class TestNG510Configurator
     extends TestNGMapConfigurator
 {
 
-  @Override
-  public void configure( XmlSuite suite, Map<String, String> options ) throws TestSetFailedException
-  {
-    super.configure( suite, options );
-
-    String dataProviderThreadCount = options.get( "dataproviderthreadcount" );
-    if ( dataProviderThreadCount != null )
+    @Override
+    public void configure( XmlSuite suite, Map<String, String> options )
+        throws TestSetFailedException
     {
-      suite.setDataProviderThreadCount( Integer.parseInt( dataProviderThreadCount ) );
+        super.configure( suite, options );
+
+        String dataProviderThreadCount = options.get( "dataproviderthreadcount" );
+        if ( dataProviderThreadCount != null )
+        {
+            suite.setDataProviderThreadCount( Integer.parseInt( dataProviderThreadCount ) );
+        }
     }
-  }
 }

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/3dba8e7b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
index 0ce0868..fe08810 100755
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -117,10 +117,14 @@ public class TestNGMapConfigurator
             // Related issues:
             // https://issues.apache.org/jira/browse/SUREFIRE-1177
             // https://issues.apache.org/jira/browse/SUREFIRE-1179
+            // should work in TestNG 6.9.7
+            // only useful in specific cases - prevents from passing string instead of integer
             else if ( "suitethreadpoolsize".equals( key ) )
             {
                 val = convert( val, Integer.class );
             }
+            // should work in TestNG 6.9.7
+            // only useful in specific cases - prevents from passing string instead of integer
             else if ( "dataproviderthreadcount".equals( key ) )
             {
                 val = convert( val, Integer.class );


[4/7] maven-surefire git commit: Add TestNG510Configurator to support dataproviderthreadcount properties

Posted by ti...@apache.org.
Add TestNG510Configurator to support dataproviderthreadcount properties


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

Branch: refs/heads/master
Commit: ec64bd560bf6dc1ff9292678ad29955fc0649b8d
Parents: 65b26d1
Author: Julien Herr <ju...@alcatel-lucent.com>
Authored: Mon Sep 28 15:12:57 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:54 2015 +0200

----------------------------------------------------------------------
 .../plugin/surefire/AbstractSurefireMojo.java   |  7 ++-
 surefire-providers/surefire-testng/pom.xml      |  2 +-
 .../testng/conf/TestNG510Configurator.java      | 47 ++++++++++++++++++++
 .../testng/conf/TestNG652Configurator.java      |  2 +-
 4 files changed, 55 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ec64bd56/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
----------------------------------------------------------------------
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 5546152..a5bb43f 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -1122,11 +1122,16 @@ public abstract class AbstractSurefireMojo
             {
                 return "org.apache.maven.surefire.testng.conf.TestNG52Configurator";
             }
-            range = VersionRange.createFromVersionSpec( "[5.3,6.4]" );
+            range = VersionRange.createFromVersionSpec( "[5.3,5.9]" );
             if ( range.containsVersion( version ) )
             {
                 return "org.apache.maven.surefire.testng.conf.TestNGMapConfigurator";
             }
+            range = VersionRange.createFromVersionSpec( "[5.10,6.4]" );
+            if ( range.containsVersion( version ) )
+            {
+                return "org.apache.maven.surefire.testng.conf.TestNG510Configurator";
+            }
             range = VersionRange.createFromVersionSpec( "[6.5,)" );
             if ( range.containsVersion( version ) )
             {

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ec64bd56/surefire-providers/surefire-testng/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml
index 78ac427..4a23cd6 100644
--- a/surefire-providers/surefire-testng/pom.xml
+++ b/surefire-providers/surefire-testng/pom.xml
@@ -51,7 +51,7 @@
     <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
-      <version>5.7</version>
+      <version>5.10</version>
       <classifier>jdk15</classifier>
       <scope>provided</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ec64bd56/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
new file mode 100644
index 0000000..2bb2577
--- /dev/null
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG510Configurator.java
@@ -0,0 +1,47 @@
+package org.apache.maven.surefire.testng.conf;
+
+/*
+ * 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.testset.TestSetFailedException;
+import org.testng.xml.XmlSuite;
+
+import java.util.Map;
+
+/**
+ * TestNG 5.10 configurator. Add support of dataproviderthreadcount
+ *
+ * @since 2.19
+ */
+public class TestNG510Configurator
+    extends TestNGMapConfigurator
+{
+
+  @Override
+  public void configure( XmlSuite suite, Map<String, String> options ) throws TestSetFailedException
+  {
+    super.configure( suite, options );
+
+    String dataProviderThreadCount = options.get( "dataproviderthreadcount" );
+    if ( dataProviderThreadCount != null )
+    {
+      suite.setDataProviderThreadCount( Integer.parseInt( dataProviderThreadCount ) );
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ec64bd56/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG652Configurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG652Configurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG652Configurator.java
index a14dcaf..e963659 100644
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG652Configurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG652Configurator.java
@@ -30,7 +30,7 @@ import org.apache.maven.surefire.testset.TestSetFailedException;
  * @since 2.13
  */
 public class TestNG652Configurator
-    extends TestNGMapConfigurator
+    extends TestNG510Configurator
 {
 
     Map<String, Object> getConvertedOptions( Map<String, String> options )


[6/7] maven-surefire git commit: Some IT should be added for suitethreadpoolsize

Posted by ti...@apache.org.
Some IT should be added for suitethreadpoolsize


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

Branch: refs/heads/master
Commit: dcf925ef170cbed1c929e122a7d2ec05456e17b4
Parents: 80a5df7
Author: Julien Herr <ju...@alcatel-lucent.com>
Authored: Tue Sep 29 11:51:59 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Wed Sep 30 00:53:56 2015 +0200

----------------------------------------------------------------------
 .../apache/maven/surefire/testng/conf/TestNGMapConfigurator.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/dcf925ef/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
index 1ffcba1..0ce0868 100755
--- a/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
+++ b/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNGMapConfigurator.java
@@ -113,6 +113,10 @@ public class TestNGMapConfigurator
             {
                 val = convert ( val, String.class );
             }
+            // TODO Add some integration tests
+            // Related issues:
+            // https://issues.apache.org/jira/browse/SUREFIRE-1177
+            // https://issues.apache.org/jira/browse/SUREFIRE-1179
             else if ( "suitethreadpoolsize".equals( key ) )
             {
                 val = convert( val, Integer.class );