5 Replies Latest reply on May 19, 2014 5:47 PM by pinky shah

    jacoco wildfly setup

    pinky shah Newbie

      I am getting test code coverage 0%.

      How shoud jacoco setup in wildfly.


      I followed this documentation. WildFly Integration Testsuite User Guide - WildFly 8 - Project Documentation Editor

      How to pass the arquillan jvm argument.


      Please help.

        • 1. Re: jacoco wildfly setup
          Tomaž Cerar Master

          what exactly do you want to do?


          inspect wildfly codebase or your application's code that run in wildfly?

          • 2. Re: jacoco wildfly setup
            pinky shah Newbie


            setup jacoco with wildfly

            I am passing this option -javaagent:[yourpath/]jacocoagent.jar=[option1]=[value1],[option2]=[value2] in wildfly standalone.bat

            Still getting code coverage as 0%.

            Not sure if I am missing Any other setting for wildfly?

            • 3. Re: jacoco wildfly setup
              pinky shah Newbie

              I see that i get coverage if i run client side

              but once i run server side its gives 0%

              • 4. Re: jacoco wildfly setup
                Richard DiCroce Novice

                The Arquillian Jacoco Extension might help you: http://arquillian.org/modules/jacoco-extension/


                Beware: development of that extension is VERY sporadic, documentation is poor, and it's effectively unusable for large deployments due to ARQ-1684.

                • 5. Re: jacoco wildfly setup
                  pinky shah Newbie

                  I already have junit framework.


                  Please find my below configuration for jacoco.


                  I am using

                  1. ant
                  2. junit
                  3. jcoco
                  4. cactus all junit test extend servertest from cactus.




                  set "JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS% -javaagent:{myhome.dir}/jacocoagent.jar=destfile={myhome.dir}/jacoco.exec,excludes=${jboss.home.dir}/modules/**/*,classdumpdir={myhome.dir}/dump,dumponexit=false,append=false"



                  ant tasks:


                  <target name="test">

                          <delete file="jacoco.exec" />

                          <delete dir="${project.dir}/junit" />

                          <mkdir dir="${project.dir}/junit/result" />

                          <mkdir dir="${project.dir}/junit/report" />


                              <junit fork="true" maxmemory="512M" printsummary="true" haltonerror="false" haltonfailure="false" showoutput="yes">

                                  <jvmarg line="${cactus.args}" />


                                      <path refid="build.classpath1" />


                                  <formatter type="xml" />

                                  <batchtest todir="${project.dir}/junit/result">

                                      <fileset dir="{JBOSS.HOME}\standalone\deployments\flexnet.ear\flexnet.war\WEB-INF\classes" includes="**/DumyTest*" excludes="${test.exclude.files}" />




                          <junitreport tofile="TestResults.xml" todir="${project.dir}/junit/result">

                              <fileset dir="${project.dir}/junit/result" />

                              <report format="frames" todir="${project.dir}/junit/report" />




                      <target name="test-coverage-report">

                          <delete dir="${project.dir}/code-coverage" />



                                  <file file="jacoco.exec" />


                              <structure name="Code Coverage Results">

                                  <group name="FNO">


                                          <fileset dir="{JBOSS.HOME}\standalone\deployments\flexnet.ear\flexnet.war\WEB-INF\classes" />


                                      <sourcefiles encoding="UTF-8">

                                          <fileset dir="${src.dir}" />

                                          <fileset dir="${testsrc.dir}" />




                              <html destdir="${project.dir}/code-coverage" />