-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JUnit test cannot write to the Output window #126
Comments
stdout and stderr are aggregated in JUnit's output xml for all tests in the same class. So the best I could probably do is to display the same output for each test (in the same class) in the right pane. The output window only contains what Gradle writes to the stdout (and stderr). Probably the best you could do for this is to "prinln" yourself this info in the Gradle script. As is now, it is not possible to print this info reliably when a test task has been executed from the NB plugin (for example, when running a task which depends on a test task). The test results window just guesses that if you run the test command (and similar) then the test xmls should have been created. |
Yes, I know :)
Would be very helpfull. And at the same occasion, couldn't you just append this test result text to the Output window too, as it is done in Ant and Maven project types?
That's probably not feasible, because the output may depend on the computation done in the test method. |
It is technically possible when the test results window is displayed but not in general. That is, if you for example run a task which depends on test, then it isn't.
I meant, you parsing the output xml after the test task completes. This should be done in a I'll most likely add the output to the test results window for the next version but I'm not sure about printing extra info to the end of the output window. |
FWIW -- I just tripped over this issue too. I would love to see output in the right-hand portion of the Test Results Tab -- I don't care if STDERR and STDOUT are mixed (but maybe some visual clue like a color differnce would be great). Our primary use case for this is Run Focused Method or Test File. Our team uses these features often during the DEV cycle. Related -- I added test.testLogging.showStandardStreams = true To top of my build.gradle and at least on the output window I get the output. |
This is a simple request, so you can most likely see this in the next version. Though, probably color coding is not possible because as far as I can see, the API only allows me to set a single string. So I'll probably go with: stderr first then stdout (clearly separatig them, like with a bunch of stars in a line). |
Thank you for test.testLogging.showStandardStreams = true That works for the output window! On Thu, Apr 3, 2014 at 8:55 PM, Fred Welland notifications@github.comwrote:
|
This should be fixed in master. Stderr and stdout are printed in the right pane of the test results window. Stderr is printed before stdout and they are color coded. If you plan to build the plugin from the sources using NB 8.0, please note that tests must be skipped for now because there seems to be a bug in NB when running unit tests. |
As it turned out, the problem is not the version of NB you build with but the JDK. So, tests won't run with JDK 8 for now. |
Great, thank you! On Sat, Apr 5, 2014 at 2:55 AM, Attila Kelemen notifications@github.comwrote:
|
Hi, Just tested this (1.3.0.0.1) and it works nicely. Thanks for all your work! BTW: |
I use NetBeans 8.0RC1 and G4NB 1.3.0
I realized that, if you have any System.out.println() in your JUnit test cases the output doesn't make it neither to the Output window nor to the right pane of the Test Results window. It simply disapears.
Furthermore test statistics output from JUnit like
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0,05 sec
is missing from the Output window too.
The text was updated successfully, but these errors were encountered: