Clover for Eclipse

Hi,

I installed clover plugin for eclipse.I am trying to get per test coverage details for Testng testcases.Clover is not detecting my testcases.But when change the name of my testcase to Testdemo,it works.I guess it is looking for substring "Test" in the testcase name. Can you please help me,what setting do i have to make ,inorder it to work for other tetscases as well.

Thanks.

1 answer

1 accepted

1 votes

In the Project Properties dialog > Clover page > Test Classes it's possible to configure file patterns (in an Ant-style syntax) or select test source folders.

Clover will use these patterns/source folders together with it's built-in test detection algorithms to determine whether given class is a test class or not. Test class must match both the pattern/source folder and this test detection algorithm.

Clover's test detector is looking for classes having:

  • one of annotations: @org.testng.annotations.Test, @Testor
  • a "@testng.test" JavaDoc tag or
  • a class containing "test" (case insensitive) substring in its name or
  • a class extending the TestCase / junit.framework.TestCase or
  • a class who's superclass contains "test" in its name

It means that in order to have your test class instrumetned correctly (and get per-test coverage) you have to ensure that:

  • the test class matches the file pattern or is located inside a test folder
  • the test class has proper annotation, javadoc tag, name or a superclass

References:

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

426 views 1 14
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot