• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JUnit - List of test methods through TestRunner

 
Nitin Pathak
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application running the various test cases by looping through the different Test Classes and instantiating the test suite. TestRunner executes the test cases and TestResult keeps the results in scope.

I am able to retrieve errors() and failures() of the concerned test case and iterating over the enumerations, I am able to get the description and the failure case method names.

I have a requirement to display the names of the successful methods as well - all the test methods executed through the test run. Can this be achieved through TestResult or is there any other alternative?

- Thanks
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there currently is a totally obvious way of doing that, though there probably is a way. You might want to ask this question at http://tech.groups.yahoo.com/group/junit/
 
Nitin Pathak
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ilja! I have posted the message to the group. Also, can you please give a hint as to what work around can be done to gather the required information? One option is to set the VO attribute (preferably an ArrayList) of each of the method names in as the method body is invoked.

However, this is not a resueable solution and as the application gorws, there are high chances of inconsistencies in the test cases. Please do let me know your inputs.

- Thanks
 
Nitin Pathak
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved - I was able to extract the method names through Java Reflection API.

- Thanks
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic