• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant with JUnit and Emma: Req Urgent Help

 
Sujai Kaarthik
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I have an assignment in which I need to club JUnit and Emma with Ant. I have created a small library management application using Struts framework. I have also written JUnit testcases for the same. My guide does not allow me to test and analyze code coverage within Eclipse. He wants me to start from the basic.

I don't know where to place the JUnit test codes and the required JAR files in Ant's installation directory. I placed all the JAR files (junit.jar, emma.jar, emma_ant.jar, ant-junit.jar) in the root (C:\Ant) directory. My build file is located in C:\Ant\docs\manual. The Ant's installation was successful. And I also need some help in creating tasks in build file.


PS: I have to complete this assignment by today.
 
Sujai Kaarthik
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is this in a wrong forum?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sujai,

If you're in a real rush, you need to place those libraries in the $ANT_HOME/lib directory. But I'd recommend hosting them elsewhere and referencing them inside your build.xml file as you need them.
 
Sujai Kaarthik
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Martijn

I don't know whether I have added Emma and Junit successfully or not!
I put junit.jar, emma.jar, emma_ant.jar, ant-junit.jar in the root (C:\Ant) directory. Are these the only required JAR's to run JUnit and Emma? or I need something else. I have my build.xml file at the location C:\Ant\docs\manual. I copied that too to the root directory. Have I installed Emma and Junit correctly?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sujai,

In short no ,

1.) Ant already has JUnit (see your c:/ant/lib directory)
2.) Emma is a library you add on a _per project_ basis, so it should be added to your project's source tree
3.) Your build.xml should be a _per_ project_ as well, it does not need to be in the c:\Ant directory structure at all

A guide to help you is here

 
Sujai Kaarthik
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a ton Martijn..

I'll try my fortune
 
Bharat Sinha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, This may be a bit late but i do have a nice link which clearly describes the Ant JUnit integration with Emma...

http://wiki.metawerx.net/wiki/UsingEMMAWithANTForJUnitTestCoverageReporting
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic