1

I'm having a setup of an ant project and I wanted to bring the code coverage till 80%. it is now 40%, I wanted to excluded some of the packages and classes so that the code count will be reduce and my coverage ll reach up to some %.. As I'm using Ant (build.xml) and JUnit I find many have a reply to ignore test cases or exclude test cases. But my case is totally different. I want to exclude some packages and classes from JUnit test and code coverage as well. Is there any setting or any tag for build.xml need to be used. thanks in advance.

Let me explain clearly here:

I have source code with different packages. My test cases are in another module (test) with many packages. I have written may test cases for all the classes of many packages. As some of the classes may be POJO / Model classes so these classes don't require any JUNIT test and I don't want to test it for code coverage too. Now the question is, as I didn't write any tests for my source code, the coverage % will be less. I wanted to exclude my source code of a specific package and some of the classes of different packages as well. I have got many answers but it didn't work out.

I use EclEmma, Junit, Ant(build.xml).. Please suggest your ideas

Ratish Bansal
  • 1,982
  • 1
  • 10
  • 19
Bam
  • 79
  • 1
  • 2
  • 11

1 Answers1

0

Have a look here: http://ant.apache.org/manual/Types/fileset.html

Add an exclude tag in in build.xml juit -> batchset-> fileset

<exclude name="Test class pattern" /> 
JineshEP
  • 738
  • 4
  • 7