简体   繁体   中英

Cobertura issue with jdk1.7

My unit tests generate very good Cobertura code coverage reports. However on up-gradation from Java 1.6 to Java 1.7 and using Cobertura 2.0.3, I have started to get the below error. I looked into this Cobertura Mailing list entry about classpath issues, Java 7, upgrading the version and instrumentation, but I am still getting the issue. Any suggestions?

[testng] Exception in thread "Thread-1" java.lang.ExceptionInInitializerError
   [testng]     at org.my.code.MyFile.__cobertura_init(MyFile.java)
   [testng]     at org.my.code.MyFile.<clinit>(MyFile.java)
   [testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   [testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   [testng]     at java.lang.reflect.Method.invoke(Method.java:601)
   [testng]     at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesToSingleClassOnProjectData(TouchCollector.java:121)
   [testng]     at net.sourceforge.cobertura.coveragedata.TouchCollector.applyTouchesOnProjectData(TouchCollector.java:107)
   [testng]     at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:272)
   [testng]     at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:33)
   [testng]     at java.lang.Thread.run(Thread.java:722)
   [testng] Caused by: java.lang.IllegalStateException: Shutdown in progress
   [testng]     at java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
   [testng]     at java.lang.Runtime.addShutdownHook(Runtime.java:209)
   [testng]     at net.sourceforge.cobertura.coveragedata.ProjectData.initialize(ProjectData.java:239)
   [testng]     at net.sourceforge.cobertura.coveragedata.ProjectData.getGlobalProjectData(ProjectData.java:209)
   [testng]     at net.sourceforge.cobertura.coveragedata.TouchCollector.<clinit>(TouchCollector.java:46)
   [testng]     ... 11 more
cb.html:
[cobertura-report] The jvmargs attribute is deprecated. Please use nested jvmarg elements.

不确定是什么导致了这个问题,但这是一个知道的cobertura问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM