Hi Andreas,

I said before, that if I am running in general, this particular test is skipped.
If I try to run 'Test File' action, it fails not in the test itself, but in 
maven before test is launched.
I did run maven with -e flag and got the following stack trace:

Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-cli) on 
project universal-batch-processor: No tests were executed!  (Set 
-DfailIfNoTests=false to ignore this error.) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-cli) on 
project universal-batch-processor: No tests were executed!  (Set 
-DfailIfNoTests=false to ignore this error.)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:81)
   at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
 (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: No tests were 
executed!  (Set -DfailIfNoTests=false to ignore this error.)
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution 
(SurefireHelper.java:149)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary 
(SurefirePlugin.java:364)
    at 
org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked
 (AbstractSurefireMojo.java:1041)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute 
(AbstractSurefireMojo.java:857)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:81)
    at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
 (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
(Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:347)

Re-run Maven using the -X switch to enable full debug logging.

I tried even with basic template generated by Netbeans. Still this particular 
class cannot be tested and I can't figure why.

Regards,
Gary Greenberg
Staff Software Engineer
Data Product Development, BI-A
E: ggree...@visa.com
M: 650-269-7902

[EmailSig-TaglineVersion]

From: Andreas Reichel <andr...@manticore-projects.com>
Sent: Sunday, December 20, 2020 8:22 PM
To: users@netbeans.apache.org
Subject: Re: One of the unit tests not executed. Why?

Hi Gary.

Now, when the tests are running in general, maybe try to run the particluar 
Test/Method only?
"Run focussed Test Method" or "Debug focussed Test Method". What happens when 
you run this test through the debugger step-by-step?

Best regards
Andreas




On Mon, 2020-12-21 at 03:03 +0000, Greenberg, Gary wrote:
I did try latest surefire plugin (3.0.0-M5) and latest junit  (4.13.1) and 
latest org.junit.jupiter (5.7.0) with the same result.
I did figured out why it failed in the command line. Default JAVA_HOME for the 
terminal window was pointing to older JDK (1.8).
After I changed it to JDK-14.0.2 (the one that NB is running upon), it is no 
longer failing, but does not execute that particular test either.
I.e. behavior on the command line and NB are the same.
I understand that it is not a Netbeans problem, but I am turning every stone.
So far, haven't find any clues on such strange behavior.

Gary Greenberg
Staff Software Engineer
Data Product Development, BI-A
E: ggree...@visa.com<mailto:ggree...@visa.com>
M: 650-269-7902

[EmailSig-TaglineVersion]

From: Jose Ch <pepnes...@gmail.com<mailto:pepnes...@gmail.com>>
Sent: Sunday, December 20, 2020 5:22 PM
To: Greenberg, Gary 
<ggree...@visa.com.invalid<mailto:ggree...@visa.com.invalid>>
Cc: NetBeans Mailing List 
<users@netbeans.apache.org<mailto:users@netbeans.apache.org>>
Subject: Re: One of the unit tests not executed. Why?

Can you try the newest version of surefire plugin?
org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5



El dom, 20 dic 2020 a las 5:03, Greenberg, Gary 
(<ggree...@visa.com.invalid<mailto:ggree...@visa.com.invalid>>) escribió:
I sure did clean and build the project.
During the build all unit tests are executed except this one.
When I am trying to run the test on this very particular class, I was getting 
the previously mentioned error.

I did try to run Maven test from the command line several times and it fails in 
some random unit test. The one that succeed in Netbeans.
I tried to run maven with different JDKs and increased heap size to 2GB, but I 
am still getting something like the following:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:47 min
[INFO] Finished at: 2020-12-19T20:51:16-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on 
project universal-batch-processor: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\ggreenbe\OneDrive - Visa 
Inc\Development\Projects\universal-batch-processor\target\surefire-reports for 
the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, 
[date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or 
System.exit called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk-14.0.2\bin\java" 
-jar 
C:\Users\ggreenbe\AppData\Local\Temp\surefire5797367098824429966\surefirebooter5235882171158911878.jar
 C:\Users\ggreenbe\AppData\Local\Temp\surefire5797367098824429966 
2020-12-19T20-49-39_741-jvmRun1 surefire8349322470433008227tmp 
surefire_018344052671012744992tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.visa.dpd.batch.uni.proc.cfg.BatchConfigTest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The 
forked VM terminated without properly saying goodbye. VM crash or System.exit 
called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk-14.0.2\bin\java" 
-jar 
C:\Users\ggreenbe\AppData\Local\Temp\surefire5797367098824429966\surefirebooter5235882171158911878.jar
 C:\Users\ggreenbe\AppData\Local\Temp\surefire5797367098824429966 
2020-12-19T20-49-39_741-jvmRun1 surefire8349322470433008227tmp 
surefire_018344052671012744992tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.visa.dpd.batch.uni.proc.cfg.BatchConfigTest
[ERROR]         at 
org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR]         at 
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR]         at 
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR]         at 
org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR]         at 
org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR]         at 
org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[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:62)
[ERROR]         at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[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]
[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]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 
1]http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException<https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FMAVEN%2FMojoExecutionException&data=04%7C01%7Cggreenbe%40visa.com%7C90cfbebf77c14deaae3508d8a5682071%7C38305e12e15d4ee888b9c4db1c477d76%7C0%7C0%7C637441213943961448%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UIZgLG1141T46FucjNY29QqLf6nrSyOy8OI1%2FuJVOPE%3D&reserved=0>

And I do not have System.exit() call anywhere.

Gary Greenberg
Staff Software Engineer
Data Product Development, BI-A
E:ggree...@visa.com<mailto:ggree...@visa.com>
M: 650-269-7902

[EmailSig-TaglineVersion]

From: Javier Ortiz Bultron 
<javier.ortiz...@gmail.com<mailto:javier.ortiz...@gmail.com>>
Sent: Saturday, December 19, 2020 8:22 AM
To: Andreas Reichel 
<andr...@manticore-projects.com<mailto:andr...@manticore-projects.com>>
Cc: NetBeans Mailing List 
<users@netbeans.apache.org<mailto:users@netbeans.apache.org>>
Subject: Re: One of the unit tests not executed. Why?

Newly added? Might need to clean and build the project so the annotations are 
processed.

On Fri, Dec 18, 2020, 9:38 PM Andreas Reichel 
<andr...@manticore-projects.com<mailto:andr...@manticore-projects.com>> wrote:
Gary,

unfortunately nobody will be able to answer that without having a look at the 
particular Test file.
Also, I am not sure if that is a Netbeans problem. Are you able to run the 
tests with Maven from the shell?

Best regards
Andreas

On Sat, 2020-12-19 at 03:32 +0000, Greenberg, Gary wrote:
I am working on a pretty large project.
For many of Java classes I have created Junit tests and everything was working 
fine until today.
Today, I finished another class and using Tools->Create/Update Tests generated 
test class for it.
The class has only two public methods but one is not finished yet. So I deleted 
one test template and
updated another one to reflect the method functionality.
Compilation was successful, but when I looked through the build log, I see that 
this newly added test was not executed.
I selected the class in projects and from the context menu clicked on 'Test'.
As a result I got this:
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time:  19.124 s
Finished at: 2020-12-18T19:25:45-08:00
------------------------------------------------------------------------
Failed to execute goal 
org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-cli) on 
project universal-batch-processor: No tests were executed!  (Set 
-DfailIfNoTests=false to ignore this error.) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

I didn't get why the test was not executed? I do not see differences with other 
test. Can anyone give me a hint?
Thanks,
Gary Greenberg
Staff Software Engineer
Data Product Development, BI-A
E:ggree...@visa.com<mailto:ggree...@visa.com>
M: 650-269-7902




Reply via email to