Maven?Cobertura Maven Plugin
???????????? ???????[ 2016/3/11 15:02:55 ] ?????????????????? ???????
????cobertura-maven-plugin?????У?鵥??????????????????????????????????????????棬??????????????????д???ο?.
????helloword
????cobertura-maven-plugin????????????????????????????ж????????д????????????pom.xml????????cobertura-maven-plugin???????????????.
?????????????????????????????:
???????????????
????packagecom.qyf404.learn.maven;
????publicclassApp{
????publicintadd(inta??intb){
????returna+b;
????}
????publicintsubtract(inta??intb){
????returna-b;
????}
????}
????????????????
????packagecom.qyf404.learn.maven;
????importorg.junit.After;
????importorg.junit.Assert;
????importorg.junit.Before;
????importorg.junit.Test;
????importorg.junit.experimental.categories.Category;
????publicclassAppTest{
????privateAppapp;
????@Before
????publicvoidsetUp(){
????app=newApp();
????}
????@Test
????publicvoidtestAdd()throwsInterruptedException{
????inta=1;
????intb=2;
????intresult=app.add(a??b);
????Assert.assertEquals(a+b??result);
????}
????@Test()
????publicvoidtestSubtract()throwsInterruptedException{
????inta=1;
????intb=2;
????intresult=app.subtract(a??b);
????Assert.assertEquals(a-b??result);
????}
????@After
????publicvoidtearDown()throwsException{
????}
????}
????pom.xml????????:
????<?xmlversion="1.0"encoding="UTF-8"?>
????<projectxmlns="http://maven.apache.org/POM/4.0.0"
????xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
????xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">
????<modelVersion>4.0.0</modelVersion>
????<groupId>com.qyf404</groupId>
????<artifactId>learn-maven</artifactId>
????<version>1.0-SNAPSHOT</version>
????<build>
????<plugins>
????<plugin>
????<groupId>org.codehaus.mojo</groupId>
????<artifactId>cobertura-maven-plugin</artifactId>
????<version>2.7</version>
????</plugin>
????</plugins>
????</build>
????<dependencies>
????<dependency>
????<groupId>junit</groupId>
????<artifactId>junit</artifactId>
????<version>4.12</version>
????<scope>test</scope>
????</dependency>
????</dependencies>
????</project>
????????????????????????????maven????mvncobertura:cobertura???????????target???????site??????????????????index.html???????????????????cobertura-maven-plugin?ó???????????.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11