Mule FunctionalTestCase-是否为每个测试加载Mule服务器? [英] Mule FunctionalTestCase - does it load mule server for every test?

查看:67
本文介绍了Mule FunctionalTestCase-是否为每个测试加载Mule服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如果说10个测试,那么每个扩展的Mule中的FunctionalTestCase-它实际上是否在测试的生命周期中加载了Mule服务器,并且在每次运行的测试中都将其拆除? 对我来说,这似乎是个开销-但是轻量级的Mule可能就是这样.

I am wondering, If I have say 10 tests, each extending FunctionalTestCase in Mule - does it actually load a Mule server in the life cycle of the test and tears it down for every test it runs? That seems to be an overhead to me - however lightweight Mule may be.

仅供参考-我所有的测试都扩展了AbstractMuleTest,而后者又扩展了FunctionalTestCase并实现了getConfigResoures()方法.

FYI - I all my Tests extend an AbstractMuleTest which in turn extends FunctionalTestCase and implements the getConfigResoures() method.

推荐答案

是的,原因是:保证每个测试都与其他测试隔离开来,以确保事情不会进行,仅仅是因为之前在Mule中发生了其他事情在另一项测试中.

Yes it does and for a reason: to guarantee that each test is isolated from the others thus that things don't work just because something else happened before in Mule in another test.

这就是说,您可以通过在测试用例类构造函数中添加以下内容来关闭此功能:

This said, you can turn this feature off by adding the following in your test case class constructor:

setDisposeContextPerClass(true);

这篇关于Mule FunctionalTestCase-是否为每个测试加载Mule服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆