有谁知道如何关闭MUnit Coverage分析?

时间:2016-07-29 18:06:31

标签: maven munit

在我的模拟测试完成并成功之后,Maven插件启动了这个:

[org.mule.munit.remote.CoverageManager]计算资源的应用程序覆盖率:app-config.xml

我删除了POM中的配置,其中coverage设置为" true"。我改为" false"覆盖率分析仍在继续。

有谁知道如何关闭它?

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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   http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.dlw</groupId>
    <artifactId>billing-api</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>mule</packaging>
    <name>Acme Billing API Application</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <mule.version>3.8.0</mule.version>
    <mule.tools.version>1.1</mule.tools.version>
    <munit.version>1.2.0</munit.version>
    <mule.munit.support.version>3.8.0</mule.munit.support.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.mule.tools.maven</groupId>
            <artifactId>mule-app-maven-plugin</artifactId>
            <version>${mule.tools.version}</version>
            <extensions>true</extensions>
            <configuration>
                <copyToAppsDirectory>true</copyToAppsDirectory>
            <inclusions>
                    <inclusion>
                        <groupId>org.mule.modules</groupId>
                        <artifactId>mule-module-apikit</artifactId>
                    </inclusion>
                </inclusions>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2.1</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>project</descriptorRef>
                </descriptorRefs>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <id>add-resource</id>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>add-resource</goal>
                    </goals>
                    <configuration>
                        <resources>
                            <resource>
                                <directory>src/main/app/</directory>
                            </resource>
                            <resource>
                                <directory>mappings/</directory>
                            </resource>
                        <resource>
                                <directory>src/main/api/</directory>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    <plugin>
            <groupId>com.mulesoft.munit.tools</groupId>
            <artifactId>munit-maven-plugin</artifactId>
            <version>${munit.version}</version>
            <executions>
                <execution>
                    <id>test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <testResources>
        <testResource>
            <directory>src/test/munit</directory>
        </testResource>
    <testResource>
            <directory>src/test/resources</directory>
        </testResource>
    <testResource>
            <directory>src/main/app</directory>
        </testResource>
    </testResources>
</build>

<!-- Mule Dependencies -->
<dependencies>
    <!-- Xml configuration -->
    <dependency>
        <groupId>com.mulesoft.muleesb</groupId>
        <artifactId>mule-core-ee</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <!-- Xml configuration -->
    <dependency>
        <groupId>com.mulesoft.muleesb.modules</groupId>
        <artifactId>mule-module-spring-config-ee</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <!-- Mule Transports -->
    <dependency>
        <groupId>org.mule.transports</groupId>
        <artifactId>mule-transport-file</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.mule.transports</groupId>
        <artifactId>mule-transport-http</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.mulesoft.muleesb.transports</groupId>
        <artifactId>mule-transport-jdbc-ee</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.mulesoft.muleesb.transports</groupId>
        <artifactId>mule-transport-jms-ee</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.mule.transports</groupId>
        <artifactId>mule-transport-vm</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <!-- Mule Modules -->
    <dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-scripting</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-xml</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <!-- for testing -->
    <dependency>
        <groupId>org.mule.tests</groupId>
        <artifactId>mule-tests-functional</artifactId>
        <version>${mule.version}</version>
        <scope>test</scope>
    </dependency>
<dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-apikit</artifactId>
        <version>1.7.3</version>
    </dependency>
<dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-http</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
<dependency>
        <groupId>org.hoeggsoftware</groupId>
        <artifactId>acme-mule-domain</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <scope>test</scope>
        <type>zip</type>
    </dependency>
<dependency>
        <groupId>com.mulesoft.weave</groupId>
        <artifactId>mule-plugin-weave_2.11</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>3.2.2</version>
        <scope>provided</scope>
    </dependency>
<dependency>
        <groupId>com.mulesoft.munit</groupId>
        <artifactId>mule-munit-support</artifactId>
        <version>${mule.munit.support.version}</version>
        <scope>test</scope>
    </dependency>
<dependency>
        <groupId>com.mulesoft.munit</groupId>
        <artifactId>munit-runner</artifactId>
        <version>${munit.version}</version>
        <scope>test</scope>
    </dependency>

</dependencies>

<repositories>
    <repository>
        <id>Hoegg</id>
        <name>Hoegg Software</name>
        <url>http://maven.hoegg.software:8081/nexus/content/repositories/MuleRepository/</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>Central</id>
        <name>Central</name>
        <url>http://repo1.maven.org/maven2/</url>
        <layout>default</layout>
    </repository>
    <repository>
        <id>mulesoft-releases</id>
        <name>MuleSoft Releases Repository</name>
        <url>http://repository.mulesoft.org/releases/</url>
        <layout>default</layout>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>Hoegg</id>
        <name>Hoegg Software</name>
        <url>http://maven.hoegg.software:8081/nexus/content/repositories/MuleRepository/</url>
        <layout>default</layout>
    </pluginRepository>    
    <pluginRepository>
        <id>mulesoft-release</id>
        <name>mulesoft release repository</name>
        <layout>default</layout>
        <url>http://repository.mulesoft.org/releases/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

1 个答案:

答案 0 :(得分:3)

运行MUnit时,有两种方法可以关闭覆盖率分析:

  1. 不要在
  2. 中的MUnit插件部分中提供任何配置
  3. 将运行覆盖率设置为false,如下所示:

    <configuration>
      <coverage>
        <runCoverage>false</runCoverage>
        <formats>
          <format>html</format>
        </formats>
      </coverage>
    </configuration>
    
  4. 注意:此配置不会影响Anypoint Studio 6.0.3中MUnit的行为。如果选择MUnit测试配置(XML)和右键/ Run / MUnit

    ,覆盖率分析仍将运行