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 213887 - With compile on save disable running a test method switches to output window
Summary: With compile on save disable running a test method switches to output window
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-09 19:56 UTC by everflux
Modified: 2012-11-16 12:17 UTC (History)
0 users

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 everflux 2012-06-09 19:56:36 UTC
[ BUILD # : 201206080001 ]
[ JDK VERSION : 1.7.4 ]

I have a test class with failing tests. When compile on save is disabled and I
run a single test method or test class from the output of a previous run, the
test is run correctly, but when finished the view switches to the Output
window, showing something like

Testcase: testDoSomethingDifferent(classtypes.AbstractClazzTest):	FAILED
The test case is a prototype.
junit.framework.AssertionFailedError: The test case is a prototype.
	at
classtypes.AbstractClazzTest.testDoSomethingDifferent(AbstractClazzTest.java:74)



Test classtypes.AbstractClazzTest FAILED
/home/tkruse/NetCat/JUnitSampleProject/nbproject/build-impl.xml:1241: Some
tests failed; see details above.
BUILD FAILED (total time: 0 seconds)

Expected behaviour is that the test-results window keeps open, like when using
the compile on save feature.

Project type: Java project
Comment 1 everflux 2012-06-09 20:00:35 UTC
It does not happen when there is no test failure when re-running a single test or the re-run button/re-run failed button is used.
Comment 2 Theofanis Oikonomou 2012-06-13 11:48:20 UTC
This should be fixed by http://hg.netbeans.org/core-main/rev/1b7d123e1bc8
Please try with latest build and reopen if this is not fixed for you. Thank you
Comment 3 everflux 2012-06-14 21:04:52 UTC
Steps to reproduce:
Disable compile on save
clean project
on test case file with a failing test make a right click and select "test file"

Netbeans will switch to the maven output window, at the end

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 16.075s
Finished at: Thu Jun 14 23:03:50 CEST 2012
Final Memory: 48M/686M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-cli) on project foobar: There are test failures.

But will not show the test results window.

On second execution it will work.
Comment 4 everflux 2012-11-02 16:39:18 UTC
Still occurs with Netbeans build 201211020001
In contrast to my original report I observed different behaviour, though.

CoS enabled, maven based project, test results window closed

Expected behaviour:
- project clean
- ctrl-f6 in a test case runs testcase, opens test result window after tests are complete, or while tests are progressing

Actual behaviour:
- project clean
- running a test case shows only maven console output. switching to test results window manually works. though
- on second run of any testcase, switching works automatically.

CoS disabled, maven based project, test results window closed

After project clean, running a test case just shows output window.
On second run a notifcation appears, suggesting to open the test results window.
Third run shows test results window automatically.
Comment 5 Theofanis Oikonomou 2012-11-16 12:17:38 UTC
I am sorry but I cannot reproduce in NetBeans IDE Dev (Build 20121116-18f2a08af9ac)

(In reply to comment #4)
> Still occurs with Netbeans build 201211020001
> In contrast to my original report I observed different behaviour, though.
> 
> CoS enabled, maven based project, test results window closed
> 
> Expected behaviour:
> - project clean
> - ctrl-f6 in a test case runs testcase, opens test result window after tests
> are complete, or while tests are progressing

this is not expected. See bug 210554 for more information

> 
> Actual behaviour:
> - project clean
> - running a test case shows only maven console output. switching to test
> results window manually works. though

if all test passed this is expected

> - on second run of any testcase, switching works automatically.
> 
> CoS disabled, maven based project, test results window closed
> 
> After project clean, running a test case just shows output window.
> On second run a notifcation appears, suggesting to open the test results
> window.
> Third run shows test results window automatically.

I am not seeing this behavior. If all test passed only the notification is presented. If at least one test failed the TRW is opened automatically. Please try a latest build and report back if it does not work for you. Thank you