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.
Summary: | Patch for: Double-click on a failing testcase method should open the line with the failing assertation within the testfile | ||
---|---|---|---|
Product: | java | Reporter: | markiewb |
Component: | JUnit | Assignee: | Theofanis Oikonomou <theofanis> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | anebuzelsky, markiewb, psomol |
Priority: | P3 | Keywords: | PATCH_AVAILABLE, PLAN |
Version: | 7.2 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
See Also: |
http://netbeans.org/bugzilla/show_bug.cgi?id=163986 http://netbeans.org/bugzilla/show_bug.cgi?id=213935 |
||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
Screenshot with sample
Proposed patch for junit-module / working patch based on main Proposed patch for junit- and maven.junit-module Sample projects for testing patching junit, maven.junit and testng ant/maven junit/testng projects |
Description
markiewb
2012-08-02 20:51:03 UTC
Error is caused by #163986 Created attachment 123631 [details]
Proposed patch for junit-module / working patch based on main
If you double-click on the "testAdd Failed:..." node then you should jump to the start of the test method (line 42). On the other hand if you double-click on the "at de.foo. ... .java:52" node then you should jump to the cause of the failure at line 52. This is the expected behaviour and since it seems to be the case for you I am closing the bug. (In reply to comment #3) > > This is the expected behaviour and since it seems to be the case for you I am > closing the bug. Yes, it is the current behaviour i described. BUT not the requested - more useful - one. I try to explain in more detail. When tests fail then the result list looks like + testA successful + testB failed: expected 5 but was 8 + testC failed: expected true but was false + testD successful When i double-click at the node "testB failed: ..." then ACTUAL: it jumps to the start of the test-method EXPECTED: it jumps to the cause of the failure (where the assertion failure "5 but was 8" comes from and that is the line i want to start my "why does the test fails investigation") I understand what you are saying. I am not sure though if what you are proposing as the expected behaviour is the way to go. Petr any comments on this? Anyway, I believe this is not a defect. Thank you Created attachment 127049 [details] Proposed patch for junit- and maven.junit-module I rewrote the patch. Please review! Details: * When doubleclicking at a failed MethodNode then the stracktrace-analyse-logic (from http://netbeans.org/bugzilla/show_bug.cgi?id=213935) is used to open the correct line (new behaviour). * When doubleclicking at a passed MethodNode then the line of the testMethod will be focused (works as before). * junit and maven.junit have to be patched (TODO: support testng) In the next commit I will attach two sample projects with JUnit3+4 testcases (JavaApp and MavenJavaApp) so you can easily test the behaviour manually. Created attachment 127050 [details]
Sample projects for testing
Created attachment 130936 [details]
patching junit, maven.junit and testng
Created attachment 130937 [details] ant/maven junit/testng projects I think the patch from comment 8 is much simpler. Please apply the proposed patch and verify that it works as expected for you using the supplied projects. Thank you (In reply to comment #9) > Created attachment 130937 [details] > ant/maven junit/testng projects > > I think the patch from comment 8 is much simpler. Please apply the proposed > patch and verify that it works as expected for you using the supplied projects. > Thank you You are right. Your patch looks easier AND works as expected! Thanks. Changeset: 2afa9a1fc443 Author: Theofanis Oikonomou <theofanis@netbeans.org> Date: 2013-02-11 15:57 Message: Issue #216334 - Patch for: Double-click on a failing testcase method should open the line with the failing assertation within the testfile Integrated into 'main-golden', will be available in build *201302122300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2afa9a1fc443 User: Theofanis Oikonomou <theofanis@netbeans.org> Log: Issue #216334 - Patch for: Double-click on a failing testcase method should open the line with the failing assertation within the testfile |