File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes Junit and Emma Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Junit and Emma" Watch "Junit and Emma" New topic
Author

Junit and Emma

ashu Suri
Greenhorn

Joined: Oct 22, 2008
Posts: 18
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

Joined: Sep 29, 2008
Posts: 12617

Use the Emma Ant task.
ashu Suri
Greenhorn

Joined: Oct 22, 2008
Posts: 18
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 22, 2008
Posts: 18
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Junit and Emma
 
Similar Threads
Need help to understand!
Integrating JUnit with Ant
how to run tests in junit graphical interface
Ant with JUnit and Emma: Req Urgent Help
Forking doesn't impact static variables