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.
I just discovered, that 'Rerun failed' button part of Test Results window does not work correctly for Maven projecs. To reproduce: 1.) Download the Java SE project from http://wiki.netbeans.org/wiki/images/c/c0/JUnitSampleProject_TS_68_JUnit.zip 2.) Create empty Maven Java SE project 3.) Copy the 'teststorun' package from 1.) to Maven project 4.) Generate tests for JUnit4 and run them 5.) Click on 'Rerun failed' button from Test Results window => nothing will be executed, the content of Test Results window will contain 'No tests executed'. I think this is really serious bug and probably a showstopper for NetBeans 7.2. NetBeans 7.2 RC1, Java 7u5 32bit
I just tested that with an existing maven based project in NB 7.2rc1 It works as expected for me. Have you turned compile on save on or off? How did you initially run the test?
Created attachment 120957 [details] Maven project to test Ataching Maven project to test...
It does not work for both Compile on Save for tests on and off.
I am able to reproduce with attached project in Product Version: NetBeans IDE 7.2 RC1 (Build 201206141830) Java: 1.7.0_04; Java HotSpot(TM) 64-Bit Server VM 23.0-b21 System: Mac OS X version 10.7.4 running on x86_64; US-ASCII; en_US (nb) User directory: /Users/tomas/Library/Application Support/NetBeans/7.2rc1 Cache directory: /Users/tomas/Library/Caches/NetBeans/7.2rc1
I can only reproduce if I invoke Alt+F6 on the project (2 passed, 8 failed, 1 error). If I then invoke run failed I get the reported status. If I invoke Ctrl+F6 on the test suite I get again (2 passed, 8 failed, 1 error) but now if I invoke run failed I get (0 passed, 8 failed, 1 error). Similar behavior if I test only one file and then rerun failed on the results. I think the problem is somewhere in the implementation of RerunHandler's rerun(Set<Testcase> tests) method in JUnitOutputListenerProvider. Milosi could you evaluate please. Thank you
most likely caused upstream by http://jira.codehaus.org/browse/SUREFIRE-844 when I try on cmd line: mvn -Dtest=teststorun.StatementsTest#testMyOwn test (works!) mvn -Dtest=teststorun.StatementsTest#testMyOwn,teststorun.IfaceTest#testMethodUsingString test (FAILS!) mvn -Dtest=teststorun.StatementsTest,teststorun.IfaceTest test (works!) which sort of aligns with the sample usage in http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html. That page never mentions that running multiple methods from different classes works. I'll file an issue with surefire, hopefully with a patch. However no the netbeans side there's not much we can do here apart from disabling the rerun in this case. I haven't tested with testng.
it seems to be filed under http://jira.codehaus.org/browse/SUREFIRE-745 and fixed in upcoming 2.13 of maven surefire plugin
not sure what can be done in netbeans apart from disabling the failing case and not allow rerunning in this case..
In such case, I will vote for Go for NetBeans 7.2 RC1. Thanks for fast investigation.(In reply to comment #8) > not sure what can be done in netbeans apart from disabling the failing case and > not allow rerunning in this case.. In such case, I will vote for Go for NetBeans 7.2 RC1. Thanks for fast investigation.
Sorry for changing bug details...
Integrated into 'main-golden', will be available in build *201206200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b2109cc6d6d0 User: Milos Kleint <mkleint@netbeans.org> Log: #214334 for rerun failed, check if given combination of surefire and test framework support running single methods
I believe the issue is fixed. What needs t be tested - It's a matrix of these variables: 1. maven surefire plugin version 1a. often surefire version is not defined in pom, then what maven version is used counts.. 2. junit version / testng version 3. one or multiple tests failing (please note that with junit4, only the future 2.13 surefire plugin will work with multiple failing tests, there's no way tell if one or multiple are failing when enabling so it's disabled)
*** Bug 214240 has been marked as a duplicate of this bug. ***
one more patch: http://hg.netbeans.org/core-main/rev/53c2709e6239 surefire plugin 1.12.1 was released and apparently either the syntax for multiple test methods per test file has changed or it never worked or worked by coincidence. Now multiple methods per file work for junit 4 but don't for testng (not implemented). There's no way to distinguish that in our enablement logic for the button though.
http://hg.netbeans.org/releases/rev/0f292d5096b7
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/0f292d5096b7 User: Milos Kleint <mkleint@netbeans.org> Log: #214334 transplant to release72 branch