homberghp opened a new pull request, #8568:
URL: https://github.com/apache/netbeans/pull/8568

   This version works for ant projects. (Including netbeans projects).
   This PR closes #8567
   
   This implementation of finding file object+line number reverses the search 
by starting at the top of the stack and try to find the stack frame that is 
directly related to the test method.
   
   
   It reverses the loop running from bottom to top into running from the top 
stack frame to the bottom one.
   It effectively tries to find the first stack element that matches the 
testMethod involved instead of the first element that is NOT in some (testing) 
framework. For most tests this appears to be the logical choice, in particular 
in the non-optimal practice of having multiple assert or assert-like statements 
in one test method.
   
   For NetBeans developers, in particular those working on refactoring related 
stuff and tests, it is more useful to point to the failing assert or verifyXXX 
call than in some method inside some method inside the test class or a 
superclass thereof that generalizes repetitive work in the tests. 
   
   In the original the goto source landed me in 
   
https://github.com/apache/netbeans/blob/68e420dcd08d0e1a3bb7fc1687dd0722881e9422/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java#L405-L418
   
   instead of say line 118 below, which is the more logical line to choose in 
most cases.
   
   
https://github.com/apache/netbeans/blob/68e420dcd08d0e1a3bb7fc1687dd0722881e9422/java/refactoring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/InnerToOutterTest.java#L117-L118
   
   This PR solves the problem for both maven and ant projects in a similar way.
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to