<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      1. 參考資料

      https://juejin.cn/post/6844903999473188877
      http://www.rzrgm.cn/fnlingnzb-learner/p/10637802.html
      https://maven.apache.org/surefire/maven-failsafe-plugin/examples/skipping-tests.html#

      2. 利用Spring initializr生成代碼并添加Unit test及Integraiton test類

      https://github.com/hivsuper/study/tree/master/study-java11

      3. 添加maven-surefire-plugin,maven-failsafe-plugin及jacoco-maven-plugin配置

      點擊查看代碼
      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="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.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
      	<modelVersion>4.0.0</modelVersion>
      	<parent>
      		<groupId>org.springframework.boot</groupId>
      		<artifactId>spring-boot-starter-parent</artifactId>
      		<version>2.7.7</version>
      		<relativePath/> <!-- lookup parent from repository -->
      	</parent>
      	<groupId>org.lxp</groupId>
      	<artifactId>study-java11</artifactId>
      	<version>0.0.1-SNAPSHOT</version>
      	<name>study-java11</name>
      	<description>Demo project for Java 11</description>
      	<dependencies>
      		<dependency>
      			<groupId>org.springframework.boot</groupId>
      			<artifactId>spring-boot-starter-web</artifactId>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.boot</groupId>
      			<artifactId>spring-boot-starter-test</artifactId>
      			<scope>test</scope>
      		</dependency>
      	</dependencies>
          <properties>
              <java.version>11</java.version>
              <maven.compiler.release>${java.version}</maven.compiler.release>
              <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
          </properties>
      
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>3.10.1</version>
                  </plugin>
                  <plugin>
                      <groupId>org.springframework.boot</groupId>
                      <artifactId>spring-boot-maven-plugin</artifactId>
                      <executions>
                          <execution>
                              <goals>
                                  <goal>repackage</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
                  <!-- Unit test with Maven Surefire plugin -->
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-surefire-plugin</artifactId>
                      <version>${maven-surefire-plugin.version}</version>
                      <configuration>
                          <parallel>method</parallel>
                          <threadCountMethods>10</threadCountMethods>
                          <excludes>
                              <exclude>**/*IT.java</exclude>
                              <exclude>**/IT*.java</exclude>
                          </excludes>
                          <systemPropertyVariables>
                              <listener>org.sonar.java.jacoco.JUnitListener</listener>
                          </systemPropertyVariables>
                      </configuration>
                  </plugin>
                  <!-- Integration test with Maven failsafe plugin -->
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-failsafe-plugin</artifactId>
                      <version>${maven-failsafe-plugin.version}</version>
                      <executions>
                          <execution>
                              <id>integration-tests</id>
                              <goals>
                                  <goal>integration-test</goal>
                                  <goal>verify</goal>
                              </goals>
                              <configuration>
                                  <excludes>
                                      <exclude>**/Test*.java</exclude>
                                      <exclude>**/*Test.java</exclude>
                                  </excludes>
                                  <additionalClasspathElements>
                                      <additionalClasspathElement>
                                          ${project.build.directory}/${project.artifactId}-${project.version}.jar.original
                                      </additionalClasspathElement>
                                  </additionalClasspathElements>
                                  <systemPropertyVariables>
                                      <listener>org.sonar.java.jacoco.JUnitListener</listener>
                                  </systemPropertyVariables>
                              </configuration>
                          </execution>
                      </executions>
                  </plugin>
              </plugins>
          </build>
      
          <profiles>
              <profile>
                  <id>coverage</id>
                  <activation>
                      <property>
                          <name>coverage</name>
                          <value>true</value>
                      </property>
                  </activation>
                  <properties>
                      <test.listeners>org.sonar.java.jacoco.JUnitListener</test.listeners>
                  </properties>
                  <build>
                      <plugins>
                          <plugin>
                              <groupId>org.jacoco</groupId>
                              <artifactId>jacoco-maven-plugin</artifactId>
                              <version>${jacoco-maven-plugin.version}</version>
                              <executions>
                                  <execution>
                                      <id>pre-unit-test</id>
                                      <goals>
                                          <goal>prepare-agent</goal>
                                      </goals>
                                  </execution>
                                  <execution>
                                      <id>report</id>
                                      <goals>
                                          <goal>report</goal>
                                      </goals>
                                      <configuration>
                                          <dataFile>target/jacoco.exec</dataFile>
                                          <outputDirectory>target/jacoco-ut</outputDirectory>
                                      </configuration>
                                  </execution>
                                  <execution>
                                      <id>pre-integration-test</id>
                                      <phase>pre-integration-test</phase>
                                      <goals>
                                          <goal>prepare-agent-integration</goal>
                                      </goals>
                                  </execution>
                              </executions>
                          </plugin>
                      </plugins>
                  </build>
              </profile>
          </profiles>
      </project>
      
      

      3.1 使用mvn verify + Unit test生成代碼覆蓋率

      Maven命令及輸出如下
      mvn clean verify -P coverage -DskipITs=true -Dmaven.test.skip=false -Dskip.repackage=true -f pom.xml

      如下圖所示,Integration test都被跳過

      打開target/jacoco-ut中的報告

      3.2 使用mvn verify + Integration test生成代碼覆蓋率

      修改jacoco-maven-plugin配置
      <dataFile>target/jacoco-it.exec</dataFile>
      Maven命令及輸出如下
      mvn clean verify -P coverage -DskipITs=false -Dmaven.test.skip=false -Dskip.repackage=true -f pom.xml

      如下圖所示,Integration test都包括

      3.3 使用mvn test + Unit test生成代碼覆蓋率

      修改jacoco-maven-plugin配置

                          <plugin>
                              <groupId>org.jacoco</groupId>
                              <artifactId>jacoco-maven-plugin</artifactId>
                              <version>${jacoco-maven-plugin.version}</version>
                              <executions>
                                  <execution>
                                      <id>pre-unit-test</id>
                                      <goals>
                                          <goal>prepare-agent</goal>
                                      </goals>
                                  </execution>
                                  <execution>
                                      <id>report</id>
                                      <goals>
                                          <goal>report</goal>
                                      </goals>
                                      <configuration>
                                          <dataFile>target/jacoco.exec</dataFile>
                                          <outputDirectory>target/jacoco-ut</outputDirectory>
                                      </configuration>
                                  </execution>
                              </executions>
                          </plugin>
      

      Maven命令及輸出如下
      clean test -P coverage org.jacoco:jacoco-maven-plugin:report -Dmaven.test.skip=false -Dskip.repackage=true -f pom.xml

      在target\site\jacoco中打開報告

       posted on 2023-01-05 18:39  hiv  閱讀(947)  評論(0)    收藏  舉報
      主站蜘蛛池模板: h无码精品3d动漫在线观看| 国产午夜亚洲精品不卡下载| 另类国产精品一区二区| 夜夜躁狠狠躁日日躁视频| 国产乱子伦视频在线播放| 国产成人无码AV片在线观看不卡| 麻豆国产传媒精品视频| 通海县| 少妇无套内谢免费视频| 国产精品青草久久久久福利99| 18禁无遮挡啪啪无码网站破解版| 丰满熟妇人妻av无码区 | 丰满岳乱妇久久久| 国产av一区二区三区精品| 亚洲aⅴ男人的天堂在线观看 | 日本免费人成视频在线观看| 国产乱码日韩亚洲精品成人| 九九热视频在线播放| 国内精品久久久久影院薰衣草| 亚洲成人高清av在线| 夜爽8888视频在线观看| 久久久这里只有精品10| 免费国产拍久久受拍久久| 日本不卡的一区二区三区| 成人毛片一区二区| 美女内射福利大全在线看| 国产美女久久久亚洲综合| 亚洲一区二区三区四区三级视频 | 性一交一乱一乱一视频| 无码国产偷倩在线播放| 2021最新国产精品网站| 熟妇人妻任你躁在线视频| 国产精品成人中文字幕| 4hu亚洲人成人无码网www电影首页| 日韩精品一区二区三区vr| 亚洲 小说区 图片区 都市| 福利一区二区在线播放| 大桥未久亚洲无av码在线| 蜜臀av日韩精品一区二区| 免费看欧美全黄成人片| 台前县|