• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JUnit - List of test methods through TestRunner

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic