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 211374 - "Go to source" does nothing for unit test results when run from aggregator
Summary: "Go to source" does nothing for unit test results when run from aggregator
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-18 08:56 UTC by mienamoo
Modified: 2012-04-23 06:19 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mienamoo 2012-04-18 08:56:22 UTC
NetBeans IDE Dev (Build 201204150400)
JDK 7u3 32-bit

I am working on a Maven-based NetBeans platform application. I executed the unit tests for all the modules in the app by invoking the Test context action on the Parent project. The tests all executed as expected and the results are shown in the Test Results window. However, double clicking (as well as right-click, Go To Source) on one of the test results (both successful and unsuccessful) does nothing.

Extra info: The projects where the tests live are open in the IDE. And the tests are a mixture of JUnit and TestNG tests.
Comment 1 mienamoo 2012-04-18 08:58:02 UTC
More related info: When executing the tests for a specific module only, the Go To Source action works perfectly.
Comment 2 Milos Kleint 2012-04-20 11:27:20 UTC
not only having problem with go to source, the rerun options on popup menu are missing as well.
Comment 3 Milos Kleint 2012-04-20 11:54:22 UTC
the junit apis seem to count only with case where one project is tested at a time. so a org.netbeans.modules.gsf.testrunner.api.TestSession is associated with a single project. When I create a new session each time I encounter test execution in maven build output, I get multiple tabs in the Junit window. That's workable but obviously the last tab covers the possible failures in the other sessions and users can miss them
Comment 4 Milos Kleint 2012-04-20 13:19:50 UTC
http://hg.netbeans.org/core-main/rev/eb1650294eff

we now only create a new test session when we encountered tests being executed in the output, we associate it with the project where the tests are running, not the root as we did before.

Jump to action seems to work again and also Rerun options are also visible.

one drawback I've noticed is that with global settings --fail-at-end (which executes all projects in the root project's reactor and therefore executes all tests in multiple projects) we get multiple tabs in the Junit window, one per session (therefore per project usually)

maybe if someone has multiple surefire executions in a project like when unit tests are executed and then integration tests within the same project.
Comment 5 Jesse Glick 2012-04-20 15:05:36 UTC
(In reply to comment #4)
> we get multiple tabs in the Junit window, one per
> session (therefore per project usually)

Probably not a big deal, assuming the content of each tab is in fact correct (including hyperlinks).

JUnitOutputProcessorFactory probably need not check project != null any more.
Comment 6 Jesse Glick 2012-04-20 15:09:11 UTC
BTW try to avoid reindenting/reformatting large blocks of code, as it makes diffs hard to follow, merge conflicts more likely, and annotate useless. 'hg di -c eb1650294eff --ignore-all-space' solves the first problem in the case of reindentation, but not other kinds of reformatting:

-                public @Override void rerun(Set<Testcase> tests) {
+
+                            public @Override
+                            void rerun(Set<Testcase> tests) {
Comment 7 Quality Engineering 2012-04-21 09:57:47 UTC
Integrated into 'main-golden', will be available in build *201204210400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/eb1650294eff
User: Milos Kleint <mkleint@netbeans.org>
Log: #211374 test session instance is to be created for project that actually executes the tests, not the one where execution started
Comment 8 mienamoo 2012-04-23 06:19:07 UTC
Verified with NetBeans build 201204220400.

The multiple test result windows are IMHO a bit inconvenient when you have a lot of modules with tests. But it is better than the 'go to source' not working. :)