Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junit and Emma

 
ashu Suri
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I call my Junit Test case from my Own class using TestRunner .dorun() method.
How can I call EMMA also to generate the coverage report.

like this
TestRunner runner=new TestRunner();
TestResult trs=runner.doRun(new TestSuite(TestFramework.class));

Thanks,
Gagan
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the Emma Ant task.
 
ashu Suri
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.
But the problem is that I want to execute the test cases from my class and also
generate the report from my class.
Thanks,
Gagan
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I'd suggest either (a) looking at the source code and seeing how the command line interface works, or (b) call the Ant task from Java.

Why would you want to do this?
 
ashu Suri
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I actually want to call all the methods of all the classes using one single method in the TestFramework class.
My TestFramework class would call all the methods of the classes with given input and expected output using reflection.
And I want to generate the coverage report of this as well.
Thanks,
Gagan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic