Hi Everyone,
I am new to the group so please excuse if I may have overlooked a few norms on
my way in. Let me get to the point:
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.
TestRunner runner = new TestRunner();
TestSuite suite = new TestSuite(testClasses);//classes array
TestResult tr = runner.doRun(suite, false);
Enumeration enumError = tr.errors();
while (enumError != null && enumError.hasMoreElements())
{
logger.info("Reporting the error cases");
error = (TestFailure) enumError.nextElement();
//do something useful with error
}
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