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 <[email protected]> Authored: Mon Sep 28 15:12:57 2015 +0200 Committer: Tibor17 <[email protected]> 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 )
