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/10/13 23:45:56 UTC
[4/4] maven-surefire git commit: [SUREFIRE-622] The TestNG command
line option '-testrunfactory' should be supported.
[SUREFIRE-622] The TestNG command line option '-testrunfactory' should be supported.
Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/14ab8a34
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/14ab8a34
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/14ab8a34
Branch: refs/heads/master
Commit: 14ab8a3487110cac5df11991a08ee4982e556c34
Parents: f180096
Author: Tibor17 <ti...@lycos.com>
Authored: Tue Oct 13 23:41:20 2015 +0200
Committer: Tibor17 <ti...@lycos.com>
Committed: Tue Oct 13 23:41:20 2015 +0200
----------------------------------------------------------------------
.../src/site/apt/examples/testng.apt.vm | 56 ++++++++++++++
.../its/CheckTestNgCustomObjectFactoryIT.java | 58 +++++++++++++++
.../CheckTestNgCustomTestRunnerFactoryIT.java | 59 +++++++++++++++
.../test/resources/testng-objectFactory/pom.xml | 74 +++++++++++++++++++
.../java/testng/objectfactory/FileHelper.java | 25 +++++++
.../TestNGCustomObjectFactory.java | 22 ++++++
.../testng/objectfactory/TestNGSuiteTest.java | 11 +++
.../resources/testng-testRunnerFactory/pom.xml | 78 ++++++++++++++++++++
.../testng/testrunnerfactory/FileHelper.java | 25 +++++++
.../TestNGCustomTestRunnerFactory.java | 22 ++++++
.../testrunnerfactory/TestNGSuiteTest.java | 11 +++
.../testng/conf/TestNGMapConfigurator.java | 4 +
12 files changed, 445 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/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 11bf3be..903d338 100644
--- a/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm
@@ -307,6 +307,62 @@ Using TestNG
</plugins>
+---+
+* Customizing TestNG Object Factory
+
+ Since the plugin version 2.19 and TestNG 5.7 or higher you can customize
+ TestNG object factory by implementing <<<org.testng.IObjectFactory>>> and
+ binding the class name to the key <<<objectfactory>>> in provider properties:
+
++---+
+</plugins>
+ [...]
+ <plugin>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ [...]
+ <properties>
+ <property>
+ <name>objectfactory</name>
+ <value>testng.objectfactory.TestNGCustomObjectFactory</value>
+ </property>
+ </properties>
+ [...]
+ </configuration>
+ </plugin>
+ [...]
+</plugins>
++---+
+
+* Customizing TestNG Test Runner Factory
+
+ Since the plugin version 2.19 and TestNG 5.9 or higher you can customize
+ TestNG runner factory by implementing <<<org.testng.ITestRunnerFactory>>> and
+ binding the class name to the key <<<testrunfactory>>> in provider properties:
+
++---+
+</plugins>
+ [...]
+ <plugin>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ [...]
+ <properties>
+ <property>
+ <name>testrunfactory</name>
+ <value>testng.testrunnerfactory.TestNGCustomTestRunnerFactory</value>
+ </property>
+ </properties>
+ [...]
+ </configuration>
+ </plugin>
+ [...]
+</plugins>
++---+
+
* Running TestNG and JUnit Tests
TestNG 6.5.1 and higher provides support to run TestNG and JUnit 4.x in current Maven project. All you need
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java
new file mode 100644
index 0000000..2e2b646
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java
@@ -0,0 +1,58 @@
+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;
+
+import java.io.File;
+
+import static org.fest.assertions.Assertions.assertThat;
+
+/**
+ * Test TestNG with custom object factory defined.
+ *
+ * @author <a href="mailto:orien@codehaus.org">Orien Madgwick</a>
+ */
+public class CheckTestNgCustomObjectFactoryIT
+ extends SurefireJUnit4IntegrationTestCase
+{
+ @Test
+ public void testTestNgListenerReporter()
+ throws Exception
+ {
+ File baseDir = unpack()
+ .executeTest()
+ .verifyErrorFreeLog()
+ .assertTestSuiteResults( 1, 0, 0, 0 )
+ .getBaseDir();
+
+ baseDir = baseDir.getCanonicalFile();
+
+ File targetDir = new File( baseDir, "target" );
+ assertThat( targetDir ).isDirectory();
+ assertThat( new File( targetDir, "objectFactory-output.txt" ) ).isFile();
+ }
+
+ private SurefireLauncher unpack()
+ {
+ return unpack( "/testng-objectFactory" );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java
new file mode 100644
index 0000000..4cf5afa
--- /dev/null
+++ b/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java
@@ -0,0 +1,59 @@
+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;
+
+import java.io.File;
+
+import static org.fest.assertions.Assertions.assertThat;
+
+/**
+ * Test TestNG with custom test runner factory defined.
+ *
+ * @author <a href="mailto:orien@codehaus.org">Orien Madgwick</a>
+ */
+public class CheckTestNgCustomTestRunnerFactoryIT
+ extends SurefireJUnit4IntegrationTestCase
+{
+ @Test
+ public void testTestNgListenerReporter()
+ throws Exception
+ {
+ File baseDir = unpack()
+ .executeTest()
+ .verifyErrorFreeLog()
+ .assertTestSuiteResults( 1, 0, 0, 0 )
+ .getBaseDir();
+
+ baseDir = baseDir.getCanonicalFile();
+
+ File targetDir = new File( baseDir, "target" );
+ assertThat( targetDir ).isDirectory();
+ assertThat( new File( targetDir, "testrunnerfactory-output.txt" ) ).isFile();
+ }
+
+ private SurefireLauncher unpack()
+ {
+ return unpack( "/testng-testRunnerFactory" );
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-objectFactory/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-objectFactory/pom.xml b/surefire-integration-tests/src/test/resources/testng-objectFactory/pom.xml
new file mode 100644
index 0000000..9019a07
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-objectFactory/pom.xml
@@ -0,0 +1,74 @@
+<?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/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>testng-testobjectfactory</artifactId>
+ <version>1.0</version>
+ <name>TestNG using custom object factory.</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.7</version>
+ <classifier>jdk15</classifier>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <properties>
+ <property>
+ <name>objectfactory</name>
+ <value>testng.objectfactory.TestNGCustomObjectFactory</value>
+ </property>
+ </properties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/FileHelper.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/FileHelper.java b/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/FileHelper.java
new file mode 100644
index 0000000..3b27106
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/FileHelper.java
@@ -0,0 +1,25 @@
+package testng.objectfactory;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class FileHelper
+{
+ public static void writeFile( String fileName, String content )
+ {
+ try
+ {
+ File target = new File( "./target" ).getCanonicalFile();
+ File listenerOutput = new File( target, fileName );
+ FileWriter out = new FileWriter( listenerOutput, true );
+ out.write( content );
+ out.flush();
+ out.close();
+ }
+ catch ( IOException exception )
+ {
+ throw new RuntimeException( exception );
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGCustomObjectFactory.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGCustomObjectFactory.java b/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGCustomObjectFactory.java
new file mode 100644
index 0000000..74feb33
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGCustomObjectFactory.java
@@ -0,0 +1,22 @@
+package testng.objectfactory;
+
+import java.lang.reflect.Constructor;
+import org.testng.IObjectFactory;
+
+public class TestNGCustomObjectFactory implements IObjectFactory
+{
+ public Object newInstance( Constructor constructor, Object... params )
+ {
+ String testClassName = constructor.getDeclaringClass().getName();
+ FileHelper.writeFile( "objectFactory-output.txt", "Instantiated Test: " + testClassName + "\n" );
+ try
+ {
+ return constructor.newInstance( params );
+ }
+ catch ( Exception exception )
+ {
+ throw new RuntimeException( exception );
+ }
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGSuiteTest.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGSuiteTest.java b/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGSuiteTest.java
new file mode 100644
index 0000000..1dcc7ed
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactory/TestNGSuiteTest.java
@@ -0,0 +1,11 @@
+package testng.objectfactory;
+
+import org.testng.annotations.Test;
+
+public class TestNGSuiteTest
+{
+ @Test
+ public void doNothing()
+ {
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/pom.xml b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/pom.xml
new file mode 100644
index 0000000..efe3286
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/pom.xml
@@ -0,0 +1,78 @@
+<?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/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>testng-testrunnerfactory</artifactId>
+ <version>1.0</version>
+ <name>TestNG using custom test runner factory</name>
+
+ <dependencies>
+ <dependency>
+ <!--
+ TestNG 5.9 is the earliest version to expose the testrunfactory flag.
+ -testrunfactory parameter is buggy in 5.13.1 because expects String instead of Class
+ -testrunfactory works in 5.10 but fails on missing testng.css because not generated by TestNG itself.
+ Every next version changed API.
+ -->
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.12.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <properties>
+ <property>
+ <name>testrunfactory</name>
+ <value>testng.testrunnerfactory.TestNGCustomTestRunnerFactory</value>
+ </property>
+ </properties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/FileHelper.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/FileHelper.java b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/FileHelper.java
new file mode 100644
index 0000000..22063e3
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/FileHelper.java
@@ -0,0 +1,25 @@
+package testng.testrunnerfactory;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class FileHelper
+{
+ public static void writeFile( String fileName, String content )
+ {
+ try
+ {
+ File target = new File( "./target" ).getCanonicalFile();
+ File listenerOutput = new File( target, fileName );
+ FileWriter out = new FileWriter( listenerOutput, true );
+ out.write( content );
+ out.flush();
+ out.close();
+ }
+ catch ( IOException exception )
+ {
+ throw new RuntimeException( exception );
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGCustomTestRunnerFactory.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGCustomTestRunnerFactory.java b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGCustomTestRunnerFactory.java
new file mode 100644
index 0000000..7d3cdcd
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGCustomTestRunnerFactory.java
@@ -0,0 +1,22 @@
+package testng.testrunnerfactory;
+
+import org.testng.ISuite;
+import org.testng.ITestRunnerFactory;
+import org.testng.TestRunner;
+import org.testng.xml.XmlTest;
+import org.testng.IInvokedMethodListener;
+
+import java.util.List;
+
+public class TestNGCustomTestRunnerFactory
+ implements ITestRunnerFactory
+{
+
+ public TestRunner newTestRunner( ISuite suite, XmlTest test, List<IInvokedMethodListener> listeners )
+ {
+ FileHelper.writeFile( "testrunnerfactory-output.txt",
+ "Instantiated Test Runner for suite:\n\t" + suite
+ + "\nand test:\n\t" + test +"\n\n" );
+ return new TestRunner( suite, test, test.skipFailedInvocationCounts(), listeners );
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGSuiteTest.java
----------------------------------------------------------------------
diff --git a/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGSuiteTest.java b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGSuiteTest.java
new file mode 100644
index 0000000..6ad173d
--- /dev/null
+++ b/surefire-integration-tests/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactory/TestNGSuiteTest.java
@@ -0,0 +1,11 @@
+package testng.testrunnerfactory;
+
+import org.testng.annotations.Test;
+
+public class TestNGSuiteTest
+{
+ @Test
+ public void doNothing()
+ {
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/14ab8a34/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 1fa2485..5dd4e58 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
@@ -83,6 +83,10 @@ public class TestNGMapConfigurator
{
val = AbstractDirectConfigurator.loadClass( entry.getValue() );
}
+ else if ( "testrunfactory".equals( key ) )
+ {
+ val = AbstractDirectConfigurator.loadClass( entry.getValue() );
+ }
else if ( "reporter".equals( key ) )
{
// TODO support multiple reporters?