application tests fail unless I exclude one specific file from clover instrumentation: why?

 

It was necessary to exclude src/groovy/org/eso/phase3/rm/utils/DbHelper.groovy from Clover instrumentation. If this file is instrumented, tests using the DbHelper class fail with an error like this:

grails test-app -clover.on

 

Failure:  |
test change batch status for operator(org.eso.phase3.rm.TestBatchServiceIntegrationSpec)
 |
java.lang.NoClassDefFoundError: Could not initialize class org.eso.phase3.rm.utils.DbHelper
	at java.lang.Class.forName(Class.java:348)
	at org.eso.phase3.rm.BatchService.$tt__changeBatchStatus(BatchService.groovy:525)
	at org.eso.phase3.rm.TestBatchServiceIntegrationSpec.test change batch status for operator_closure208(TestBatchServiceIntegrationSpec.groovy:2270)
	at org.eso.phase3.rm.TestBatchServiceIntegrationSpec.test change batch status for operator(TestBatchServiceIntegrationSpec.groovy:2269)

We are using clover 4.1.1

Grails version 2.5.3

 

can you help?

thanks,

 

Michele

1 answer

0 vote

Hi Michele,

Please create a ticket on support.atlassian.com, attach source code of the DbHelper class as well as one test class using it. Please also run your build with debug logging and attach log produced.

I suspect that either tests are trying to load this DbHelper class in a specific way (for instance Clover's classes are missing in the test class path) or there was some bug during instrumentation (for instance groovyc produced invalid bytecode for DbHelper), but we need more data to investigate it.

Thanks in advance!

Cheers
Marek 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

429 views 5 6
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