sbabcoc commented on code in PR #517:
URL: https://github.com/apache/maven-surefire/pull/517#discussion_r854334421


##########
surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/conf/TestNG740Configurator.java:
##########
@@ -37,33 +36,77 @@
  *
  * @since 3.0.0-M6
  */
-public class TestNG740Configurator extends TestNG60Configurator
+public class TestNG740Configurator
+    extends TestNG60Configurator
 {
+    /**
+     * Convert and apply the value of the [threadcount] option.
+     * 
+     * @param suite TestNG {@link XmlSuite} object
+     * @param options Surefire plugin configuration options
+     * @throws TestSetFailedException if unable to convert specified 
[threadcount] setting
+     */
     @Override
-    public void configure( XmlSuite suite, Map<String, String> options )
+    protected void configureThreadCount( XmlSuite suite, Map<String, String> 
options )
         throws TestSetFailedException
     {
-        String threadCountAsString = options.get( THREADCOUNT_PROP );
-        int threadCount = threadCountAsString == null ? 1 : parseInt( 
threadCountAsString );
-        suite.setThreadCount( threadCount );
-
-        String parallel = options.get( PARALLEL_PROP );
-        if ( parallel != null )
+        String threadCount = options.get( THREADCOUNT_PROP );
+        // if [threadcount] spec'd
+        if ( threadCount != null )
         {
-            if ( !"methods".equalsIgnoreCase( parallel ) && 
!"classes".equalsIgnoreCase( parallel ) )
+            try
             {
-                throw new TestSetFailedException( "Unsupported TestNG parallel 
setting: "
-                    + parallel + " ( only METHODS or CLASSES supported )" );
+                // convert and apply [threadcount] setting
+                suite.setThreadCount( Integer.parseInt( threadCount ) );

Review Comment:
   @Tibor17 As you indicated, TestNG provides a default value of 5. As I 
pointed out, the Surefire documentation also specifies 5 as the default value. 
There is no potential for the thread count to have anything other than 5 unless 
an explicit assignment is made.
   I'll remove the code that overrides the default implementation for the 
thread count parameter. I'll open another issue regarding the improper behavior 
of the existing implementation (forcing the thread count to 1 in the absence of 
an explicit assignment).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to