IntelliJ Code Coverage Fails

I get the following problem when I set up IntelliJ Code Coverage for a Maven project, including classes like
com.company.* and excluding classes like Test (as hinted by the inline documentation).  The following errors appear in the build log.  Presumably this is because the patterns I'm usin are wrong - can anybody help?

[com.mycompany.myproject.components:loader] -


[com.mycompany.myproject.components:loader] T E S T S
[com.mycompany.myproject.components:loader] -


[com.mycompany.myproject.components:loader] (Coverage): Failed to load coverage data from file: C:\TEAMCITY\buildAgent\temp\buildTmp\idea8793561678156230443coverage\coverage.ic: java.io.EOFException
[com.mycompany.myproject.components:loader] -


IntelliJ IDEA coverage runner -


[com.mycompany.myproject.components:loader] sampling ...
[com.mycompany.myproject.components:loader] include patterns:
[com.mycompany.myproject.components:loader] com\.mycompany\..*
[com.mycompany.myproject.components:loader] exclude patterns:
[com.mycompany.myproject.components:loader] java.lang.reflect.InvocationTargetException
[com.mycompany.myproject.components:loader] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[com.mycompany.myproject.components:loader] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[com.mycompany.myproject.components:loader] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[com.mycompany.myproject.components:loader] at java.lang.reflect.Method.invoke(Method.java:597)
[com.mycompany.myproject.components:loader] at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
[com.mycompany.myproject.components:loader] at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
[com.mycompany.myproject.components:loader] Caused by: java.lang.reflect.InvocationTargetException
[com.mycompany.myproject.components:loader] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[com.mycompany.myproject.components:loader] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[com.mycompany.myproject.components:loader] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[com.mycompany.myproject.components:loader] at java.lang.reflect.Method.invoke(Method.java:597)
[com.mycompany.myproject.components:loader] at com.intellij.rt.coverage.main.CoveragePremain.premain(CoveragePremain.java:51)
[com.mycompany.myproject.components:loader] ... 6 more
[com.mycompany.myproject.components:loader] Caused by: java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
[com.mycompany.myproject.components:loader] Test
[com.mycompany.myproject.components:loader] ^
[com.mycompany.myproject.components:loader] at java.util.regex.Pattern.error(Pattern.java:1713)
[com.mycompany.myproject.components:loader] at java.util.regex.Pattern.sequence(Pattern.java:1878)
[com.mycompany.myproject.components:loader] at java.util.regex.Pattern.expr(Pattern.java:1752)
[com.mycompany.myproject.components:loader] at java.util.regex.Pattern.compile(Pattern.java:1460)
[com.mycompany.myproject.components:loader] at java.util.regex.Pattern.(Pattern.java:1133)
[com.mycompany.myproject.components:loader] at java.util.regex.Pattern.compile(Pattern.java:823)
[com.mycompany.myproject.components:loader] at com.intellij.rt.coverage.instrumentation.Instrumentator.premain(Instrumentator.java:68)
[com.mycompany.myproject.components:loader] ... 11 more
[com.mycompany.myproject.components:loader] FATAL ERROR in native method: processing of -javaagent failed
[com.mycompany.myproject.components:loader] Exception in thread "main"
[com.mycompany.myproject.components:loader]
[com.mycompany.myproject.components:loader] Results :
[com.mycompany.myproject.components:loader]
[com.mycompany.myproject.components:loader] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

1 comment
Comment actions Permalink

Hello Richard.

Please, reformat your exclude pattern so it does not start with an asteriks. Eg.

com.mycompany.*Test*

0

Please sign in to leave a comment.