Issue trying to run unit and integration tests with Clover


#1

atlas-clover runs old version of clover (3.1.7), which does not support java 8. I’ve figured that there is a new version of clover available and ran it manually the way that atlas-clover does. It clover’s my plugin classes correctly, compiles everything, runs unit tests - everything good so far. But then it runs integration tests, and that fails

$ /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1/bin/mvn -Djava.awt.headless=true com.atlassian.maven.plugins:clover-maven-plugin:4.1.2:setup verify com.atlassian.maven.plugins:clover-maven-plugin:4.1.2:clover com.atlassian.maven.plugins:clover-maven-plugin:4.1.2:log -gs /usr/share/atlassian-plugin-sdk-6.3.10/apache-maven-3.2.1/conf/settings.xml -Dmaven.clover.jdk=1.8


T E S T S

Running it.com.example.MyComponentWiredTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.059 sec <<< FAILURE! initializationError(it.com.example.MyComponentWiredTest) Time elapsed: 0.01 sec <<< ERROR! java.lang.NoClassDefFoundError: org/junit/internal/runners/rules/RuleFieldValidator at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.collectInitializationErrors(AtlassianPluginsTestRunner.java:156) at org.junit.runners.ParentRunner.validate(ParentRunner.java:416) at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84) at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65) at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.<init>(AtlassianPluginsTestRunner.java:57) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: java.lang.ClassNotFoundException: org.junit.internal.runners.rules.RuleFieldValidator at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 27 more

Results :

Tests in error:
initializationError(it.com.example.MyComponentWiredTest): org/junit/internal/runners/rules/RuleFieldValidator`