【发布时间】:2012-01-13 11:44:00
【问题描述】:
我需要在运行测试之前启动 Mule,并在测试完成后停止它。我不清楚如何改变我的 Maven pom 来实现这一点。到目前为止,我的 pom 中有以下内容:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>org.mule.MuleServer</argument>
<argument>-config</argument>
<argument>my-config.xml</argument>
</arguments>
</configuration>
</plugin>
--- 更新---
在下面的一些回复之后,我决定添加一些额外的细节。
我有几个扩展 Mules FunctionalTestCase 类的单元测试:
public class SomeUnitTest extends FunctionalTestCase
我开始使用 JBehave 编写一些新的客户验收测试,这些测试在 maven 的“集成测试”阶段运行。如果没有运行 mule 的实例,这些测试将无法成功。加载和执行故事的主类已经扩展了 JUnitStories 类:
public class MyStories extends JUnitStories
由于我无法从此类中的 FunctionalTestCase 继承,我需要寻找替代方案,以在我需要这些故事时让 mule 运行和停止。
【问题讨论】: