Setting Jacoco coverage in a Linux environment

Source: Internet
Author: User

Cd/alidata1/admin/za-themispkill-9-F za-themis#catalina_home=/root/za-tomcat#catalina_base=/root/ Za-tomcatexport java_opts= "-server-xms2g-xmx2g-xx:newsize=1g-xx:maxnewsize=1g-xx:permsize=512m-xx:maxpermsize= 512m-xx:+useconcmarksweepgc-xx:cmsfullgcsbeforecompaction=5-xx:+usecmscompactatfullcollection-xx:+ cmsparallelremarkenabled-xx:+cmspermgensweepingenabled-xx:+cmsclassunloadingenabled-xx:+ Usecmsinitiatingoccupancyonly-xx:cmsinitiatingoccupancyfraction=70-xx:+disableexplicitgc-xx:+usecompressedoops -xx:+doescapeanalysis-xx:maxtenuringthreshold=10-dhsf.http.enable=true-dhsf.server.ip=10.253.104.74- Dpandora.qos.port=8081-dcom.sun.management.jmxremote.ssl=false-dcom.sun.management.jmxremote.authenticate= false-dcom.sun.management.jmxremote.port=7092-djava.rmi.server.hostname=10.253.104.74-javaagent:./jacoco-0.8.0 /lib/jacocoagent.jar=includes=*,output=tcpserver,port=17297,address=10.253.104.74-dhsf.server.port=8082- Dhsf.http.port=8083-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8184-dproject.name=za-themis "./bin/ Startup.shtail./logs/catalina.out


Ant build.xml File:

<?xml version= "1.0"?>

-<project default= "Jacoco" xmlns:jacoco= "antlib:org.jacoco.ant" name= "Ppauto" >

<!--Jacoco Installation path--


<property name= "Jacocoantpath" value= "./jacoco-0.8.0/lib/jacocoant.jar"/>

<!--eventually generate the path to the. exec file, and Jacoco is the final report generated based on this file--


<property name= "Jacocoexecpath" value= "./jacoco.exec"/>

<!--the path to generate coverage reports--


<property name= "Reportfolderpath" value= "./report/"/>

<!--the IP address of the remote Tomcat service--


<property name= "server_ip" value= "10.253.104.74"/>

<!--the port opened by the remote Tomcat service configured earlier, as configured above


<property name= "Server_port" value= "17297"/>

<!--za-themis. Source code Path--


<property name= "Za-themispath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis/"/>

<property name= "Za-themisbizpath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-biz/"/>

<property name= "Za-themiscommonpath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-common/"/ >

<property name= "Za-themisenginepath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-engine/"/ >

<property name= "Za-themisdaopath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-dao/"/>

<!--za-themis.class file path--


<property name= "Za-themisclasspath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis/target/ Classes/com/zhongan/themis "/>

<property name= "Za-themisbizclasspath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-biz/ Target/classes/com/zhongan/themis "/>

<property name= "Za-themiscommonclasspath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-common /target/classes/com/zhongan/themis "/>

<property name= "Za-themisdaoclasspath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-dao/ Target/classes/com/zhongan/themis "/>

<property name= "Za-themisengineclasspath" value= "/root/.jenkins/workspace/za-qa-jacocothemis/za-themis-engine /target/classes/com/zhongan/themis "/>

<!--let Ant know where to find jacoco-->.

-<taskdef resource= "Org/jacoco/ant/antlib.xml" uri= "Antlib:org.jacoco.ant" >

<classpath path= "${jacocoantpath}"/>

</taskdef>

<!--dump Task: Access the target Tomcat service and generate an. exec file based on the previously configured IP address, and port number. -

-<target name= "Dump" >

<jacoco:dump append= "true" port= "${server_port}" destfile= "${jacocoexecpath}" reset= "false" address= "${server_ip } "/>

</target>

<!--Jacoco Task: Generate the final HTML coverage report based on the source path and the. class file path that you configured earlier, according to the generated. exec file after dump. -

-<target name= "Report" >

<delete dir= "${reportfolderpath}"/>

<mkdir dir= "${reportfolderpath}"/>


-<jacoco:report>


-<executiondata>

<file file= "${jacocoexecpath}"/>

</executiondata>


-<structure name= "Jacoco report" >


-<group name= "Za-themis" >


-<classfiles>

<fileset dir= "${za-themisclasspath}"/>

</classfiles>


-<sourcefiles encoding= "Utf-8" >

<fileset dir= "${za-themispath}"/>

</sourcefiles>

</group>


-<group name= "Za-themis-biz" >


-<classfiles>

<fileset dir= "${za-themisbizclasspath}"/>

</classfiles>


-<sourcefiles encoding= "Utf-8" >

<fileset dir= "${za-themisbizpath}"/>

</sourcefiles>

</group>


-<group name= "Za-themis-common" >


-<classfiles>

<fileset dir= "${za-themiscommonclasspath}"/>

</classfiles>


-<sourcefiles encoding= "Utf-8" >

<fileset dir= "${za-themiscommonpath}"/>

</sourcefiles>

</group>


-<group name= "Za-themis-engine" >


-<classfiles>

<fileset dir= "${za-themisengineclasspath}"/>

</classfiles>


-<sourcefiles encoding= "Utf-8" >

<fileset dir= "${za-themisenginepath}"/>

</sourcefiles>

</group>


-<group name= "Za-themis-dao" >


-<classfiles>

<fileset dir= "${za-themisdaoclasspath}"/>

</classfiles>


-<sourcefiles encoding= "Utf-8" >

<fileset dir= "${za-themisdaopath}"/>

</sourcefiles>

</group>

</structure>

</jacoco:report>

</target>

</project>

Setting Jacoco coverage in a Linux environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.