检查应用程序是否在 Maven 预集成测试阶段启动?

时间:2021-07-20 08:08:37

标签: maven integration-testing maven-failsafe-plugin exec-maven-plugin maven-antrun-plugin

我正在预集成测试阶段构建我的应用程序,然后使用故障安全插件运行集成测试用例。 我想在执行集成测试用例之前确保我的应用程序在预集成测试阶段启动并运行。

我有两种可能的方法来实现这一点:

  1. Maven-antrun-plugin
<waitfor maxwait="100" maxwaitunit="second" checkevery="500">
    <http url="https://localhost/myapp/index.html"/>
</waitfor>
  1. exec-maven-plugin
            
          <execution>
            <id>wait</id>
            <phase>pre-integration-test</phase>
            <configuration>
              <executable>sleep</executable>
              <arguments>
                <argument>100</argument>
              </arguments>
            </configuration>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>

是否有其他方法可以实现此功能或任何其他 Maven 插件可以实现相同的功能?

0 个答案:

没有答案