【问题标题】:how to run integration test-case for maven project [duplicate]如何为maven项目运行集成测试用例[重复]
【发布时间】:2017-03-29 00:52:45
【问题描述】:

我写了一个maven project。 我正在使用junitjmockit 编写单元测试和模拟。

我想为同一个项目写Integration test

我应该使用什么plugin 以及我需要做什么configuration

谢谢。

【问题讨论】:

标签: java maven junit integration-testing jmockit


【解决方案1】:

你可以这样做

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <excludes>
      <exclude>**/*IntegrationTest.java</exclude>
    </excludes>
  </configuration>
  <executions>
    <execution>
      <id>integration-test</id>
      <goals>
        <goal>test</goal>
      </goals>
      <phase>integration-test</phase>
      <configuration>
        <excludes>
          <exclude>none</exclude>
        </excludes>
        <includes>
          <include>**/*IntegrationTest.java</include>
        </includes>
      </configuration>
    </execution>
  </executions>
</plugin>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-21
    • 2010-10-28
    • 2014-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-18
    • 1970-01-01
    相关资源
    最近更新 更多