Bug 62918 - [JUnit] Connect console output to source code line/JUnit test case
Summary: [JUnit] Connect console output to source code line/JUnit test case
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P4 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
: 543550 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-19 10:12 EDT by Aaron Digulla CLA
Modified: 2019-01-24 13:19 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Digulla CLA 2004-05-19 10:12:22 EDT
While running big JUnit tests, I would like to see which test produces which 
output to the console (especially: if line A still belongs to test 1 or already 
to test 2).

I see these possible solutions:

1. Eclipse remembers for every line of output in the console where System.out 
was called (similar to the "go to source line of stack trace"). This would be a 
very nice feature when I wonder "where did this output came from!?" but 
somewhat expensive (memory/runtime).

2. When I select a test case in the JUnit frame, eclipse either scrolls to the 
first line of output, highlights the output printed during that test or hides 
the output of all other tests.

3. Solution #1 can be enabled with an option in the context menu of the console 
and/or the preferences. Solution #2 is always active when JUnit tests are run.

Solution #1 would be expensive (lots of stack-traces to analyze and a lot of 
pointers to the source) but very comfortable.

Solution #2 would be much more simple (basically, the JUnit test runner could 
copy the output of the console or add markers to the output) but limited to 
JUnit runs.

Of course, I would prefer #3 :-)
Comment 1 Dirk Baeumer CLA 2004-05-19 11:27:39 EDT
Not for 3.0.
Comment 2 Aaron Digulla CLA 2006-03-14 08:57:28 EST
Since there was some work on JUnit 4.0, I wanted to ask if this feature can be reconsidered.
Comment 3 Martin Aeschlimann CLA 2006-03-21 01:52:31 EST
sorry, we won't have time for such a feature
Comment 4 Aaron Digulla CLA 2006-09-18 11:05:35 EDT
Can this be considered for 3.3?

IntelliJ IDEA automatically cuts the test outputs in their console which is really neat.

Another solution might be to have a "redirect" option in the prefs so output of tests can be logged somewhere without having to build custom IO handlers. Clicking on the tests could then offer to open these logs in an editor.
Comment 5 Martin Aeschlimann CLA 2006-09-20 09:50:50 EDT
We still have no plans for this feature. Help is welcome. Please do not reopen bugs, just add comments, and we will reopen if the situation changes.
Comment 6 Eclipse Webmaster CLA 2009-08-30 02:38:37 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.
Comment 7 Dani Megert CLA 2019-01-18 06:06:00 EST
Reopening as we got another request for this.
Comment 8 Dani Megert CLA 2019-01-18 06:06:41 EST
*** Bug 543550 has been marked as a duplicate of this bug. ***
Comment 9 Mickael Istria CLA 2019-01-18 06:11:13 EST
Making the JUnit listener keep track of current line number in console when test start and stop could be enough here; then we could have an action (right click or link) to "show related console log".
Comment 10 Mickael Istria CLA 2019-01-18 08:24:55 EST
A fun thing is that Jenkins manages to to it. The XML reports generated by JUnit do contain the standard output/error and Jenkins renders them.