Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2012

Code coverage does not work for Gradle projects

    XMLWordPrintableJSON

Details

    Description

      For my NB  dev build  I cannot run Unit tests and/or coverage task for gradle project

      Steps to reproduce:
      Product Version: Apache NetBeans IDE Dev (Build 20190125-dc92644eeb90)

      Java: 9.0.1; Java HotSpot(TM) 64-Bit Server VM 9.0.1+11

      Runtime: Java(TM) SE Runtime Environment 9.0.1+11

      System: Windows 10 version 10.0 running on amd64; Cp1251; en_US (nb)

      Create and build new gradle Java Application project

      Invoke Collect And Display code coverage action.

      Exception is thrown:

      java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
          at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
          at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
          at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
          at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:197)
      Caused: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor starting from ModuleCL@6ba0b2d2[org.netbeans.modules.gradle.java] with possible defining loaders [org.netbeans.MainImpl$BootClassLoader@71318ec4, ModuleCL@69791cc2[com.github.alexfalappa.nb.springboot.plugin], ModuleCL@71ebd684[org.netbeans.libs.findbugs]] and declared parents [ModuleCL@18133ed[org.netbeans.modules.extexecution], ModuleCL@6ded7654[org.openide.awt], ModuleCL@4fda8710[org.openide.dialogs], ModuleCL@519b734b[org.netbeans.modules.queries], ModuleCL@4eb3e144[org.netbeans.libs.javacapi], ModuleCL@4379b85c[org.netbeans.modules.java.platform.ui], ModuleCL@59f0154[org.netbeans.api.java], ModuleCL@7368d741[org.netbeans.modules.java.project], ModuleCL@5ccbd2dc[org.netbeans.api.templates], org.netbeans.JarClassLoader@4b38541e, ...19 more]
          at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:199)
          at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
      Caused: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
          at java.base/java.lang.ClassLoader.defineClass1(Native Method)
          at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
          at org.netbeans.JarClassLoader.doLoadClass(JarClassLoader.java:286)
          at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:234)
      Caused: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor while loading org.jacoco.core.internal.flow.ClassProbesVisitor; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound
          at org.netbeans.ProxyClassLoader.selfLoadClass(ProxyClassLoader.java:238)
          at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:192)
          at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
          at org.netbeans.modules.gradle.java.coverage.GradleCoverageProvider.readJacocoExec(GradleCoverageProvider.java:201)
          at org.netbeans.modules.gradle.java.coverage.GradleCoverageProvider.setEnabled(GradleCoverageProvider.java:128)
          at org.netbeans.modules.gsf.codecoverage.CoverageManagerImpl.setEnabled(CoverageManagerImpl.java:105)
          at org.netbeans.modules.gsf.codecoverage.CoverageAction$CoverageItemHandler.actionPerformed(CoverageAction.java:250)

      ....

       

      Try to run tests for project. Another  exception is thrown:

      java.lang.NullPointerException
          at org.netbeans.modules.gradle.api.execute.GradleCommandLine.lambda$combine$0(GradleCommandLine.java:846)
          at java.base/java.lang.Iterable.forEach(Iterable.java:75)
          at org.netbeans.modules.gradle.api.execute.GradleCommandLine.combine(GradleCommandLine.java:835)
          at org.netbeans.modules.gradle.api.execute.RunUtils.createRunConfig(RunUtils.java:123)
          at org.netbeans.modules.gradle.ActionProviderImpl.invokeProjectAction(ActionProviderImpl.java:201)
          at org.netbeans.modules.gradle.ActionProviderImpl.invokeAction(ActionProviderImpl.java:128)
          at org.netbeans.modules.project.ui.actions.ProjectAction$2.run(ProjectAction.java:162)

      ...

       

       

      Attachments

        Issue Links

          Activity

            People

              lkishalmi Laszlo Kishalmi
              Khramov mkhramov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h