Tibor17 commented on pull request #339:
URL: https://github.com/apache/maven-surefire/pull/339#issuecomment-789514427


   I think we can avoid also `ClassNotFoundException` using this code. Can you 
please chceck it out?
   
   ```
   import static 
org.apache.maven.surefire.api.util.ReflectionUtils.tryLoadClass;
   import static 
org.apache.maven.surefire.api.util.ReflectionUtils.invokeGetter;
   import static org.apache.maven.surefire.api.util.invokeSetter;
   
   Class<?> enumClass = tryLoadClass( XmlSuite.class.getClassLoader(), 
"org.testng.xml.XmlSuite$ParallelMode" );
   Enum<?> parallelEnum = invokeGetter( enumClass, null, "getValidParallel", 
parallel );
   invokeSetter( suite, "setParallel", enumClass, parallelEnum );
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to