This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270129

Summary: 'no tests executed' error when re-running a test from the 'Test Results' view
Product: projects Reporter: uwe_pachler <uwe_pachler>
Component: MavenAssignee: Tomas Stupka <tstupka>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: Macintosh (x86)   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description uwe_pachler 2017-03-20 10:30:32 UTC
Hello,

After running the 'test' goal on my Maven project in the Project explorer, I want to re-run a single failed test from the 'Test Results' view by right clicking a single test method in the tree view there and selecting 'Run Again'.

The resulting Maven test run fails with the message:


Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-cli) on project myproj-bizimpl: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]


I noticed that the command line generated by NetBeans to run Maven looks like this:


cd /Users/uwe_pachler/myproj-bizimpl; JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home "/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/java/maven/bin/mvn" -Dtest=de.mycompany.MyClass#de.mycompany.MyClass.test test-compile surefire:test


Executing the command line in the terminal produces the same error. However, when I change it to 


cd /Users/uwe_pachler/myproj-bizimpl; JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home "/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/java/maven/bin/mvn" -Dtest=de.mycompany.MyClass#test test-compile surefire:test


it works fine. Notice that the difference is the -Dtest=.. option:

I changed it from:

-Dtest=de.mycompany.MyClass#test

to

-Dtest=de.mycompany.MyClass#test=de.mycompany.MyClass.test

So in essence, it appears that the method/test name is generated the wrong way.


Cheers,

Uwe