【问题标题】:Mule Munit test with maven : mule-domain-config.xml file not found?使用 maven 进行 Mule Munit 测试:找不到 mule-domain-config.xml 文件?
【发布时间】:2017-12-18 07:30:56
【问题描述】:

使用 maven 进行 Mule Munit 测试:找不到 mule-domain-config.xml 文件

我在尝试使用 Maven 运行 Munit 时遇到错误。这是一个领域项目,我的 Munit 测试用例在 mule 项目中可用。当我运行 maven 时,它给了我文件未找到异常(mule-domain-config.xml)。我通过检查此站点尝试了所有可能的方法,但没有运气。下面是堆栈跟踪。

INFO 2017-01-06 01:15:01,226 [main] org.mule.munit.runner.MuleContextManager: Loading mule-app.properties ... INFO 2017-01-06 01:15:01,319 [main] org.mule.munit.runner.domain.MunitDomainContextBuilder: Loading mule-deploy.properties ... java.lang.RuntimeException: org.mule.api.config.ConfigurationException: mule-domain-config.xml (java.io.FileNotFoundException)

我已经检查了我的 pom 配置,并且我还使用了 AnypointStudio.exe clean。

【问题讨论】:

    标签: maven testing mule pom.xml munit


    【解决方案1】:

    请将具有测试范围的域项目依赖添加到您的 pom 文件中,例如

    <dependency>
        <groupId>domain project group id</groupId>
        <artifactId>domain project name</artifactId>
        <version>domain version</version>
        <scope>test</scope>
    </dependency>
    

    希望这会有所帮助。

    【讨论】:

      【解决方案2】:

      你能检查一下你是否在你的 munit 设置中加载你的 mule 域配置 xml。

      比如……

      <munit:config name="munit" doc:name="MUnit configuration"/>
      <spring:beans>
          <spring:import resource="classpath:my-munit-test.xml"/>
          <spring:import resource="mule-domain-config.xml"/>
      </spring:beans>
      <munit:test name="tesad-test-suite-FlowTest"...
      

      检查spring:import

      另外,正如@anupambhusari 所说,请检查您是否正确导入了域配置

      【讨论】:

      • 您好,仅供参考,添加域依赖项就足够了。无需在 MUnit 测试套件中导入文件
      【解决方案3】:

      我不确定您是否找到了这个问题的解决方案,但我通过在构建路径中添加 Mule 域项目(从配置构建路径选项)来解决这个问题。

      【讨论】:

        猜你喜欢
        • 2016-05-02
        • 2016-01-25
        • 1970-01-01
        • 2020-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-10-12
        • 1970-01-01
        相关资源
        最近更新 更多