Hi Team,
We are using TestNg 6.14.3 -Allure framework for automation.
We found that retry analyzer is repeating the test cycle 3 time for each failure, so decided to move to later version.
I updated to TestNG 7.5 and maven compile is failing.
Observed we need to upgrade Allure version to 2.13.2 and added beanshell dependency in the POM.
Now the compile is not happening due to script in beanshell.
<method-selectors>
<method-selector>
<script language="beanshell">
<![CDATA[
String groupsToRun = System.getProperty("groupsToRun");
String groupsNotToRun = System.getProperty("groupsNotToRun");
// System.out.println("Trimble API Group to run: " + groupsToRun );
if (( groupsToRun == null ) {
return true;
}
else {
StringTokenizer groupsToRunList = new StringTokenizer(groupsToRun, ",");
while (groupsToRunList.hasMoreTokens()) {
if (groups.containsKey(groupsToRunList.nextToken())) {
return true;
}
}
// If we made it here, we didn't find a match
return false;
}
Error:
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] javax.script.ScriptException: In file: inline evaluation of: ``String groupsToRun = System.getProperty("groupsToRun"); Stri . . . '' Encountered "<" at line 4, column 1.
[ERROR] in inline evaluation of: ``String groupsToRun = System.getProperty("groupsToRun"); Stri . . . '' at line number 4
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] javax.script.ScriptException: In file: inline evaluation of: ``String groupsToRun = System.getProperty("groupsToRun"); Stri . . . '' Encountered "<" at line 4, column 1.
[ERROR] in inline evaluation of: ``String groupsToRun = System.getProperty("groupsToRun"); Stri . . . '' at line number 4
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
]]>
Kindly suggest.
Thanks,
Vigi