使用Citrus Framework执行测试时连续运行模拟(Continuosly running mocks while executing tests with Citrus Framework)

编程入门 行业动态 更新时间:2024-10-24 06:28:11
使用Citrus Framework执行测试时连续运行模拟(Continuosly running mocks while executing tests with Citrus Framework)

我需要为Enterprise Service Bus(ESB)编写自动化测试。 当ESB运行时,它执行不同的调度操作,包括数据库查询,SOAP和TCP调用等。此外,它还会定期检查某些服务是否处于活动状态,如果不是,则会停止流程。

所以在我的情况下会出现一些问题:

一些流程将停止,因为服务没有响应 另一股流将继续在负面情景中产生错误

使用Citrus Framework执行测试时是否可以连续运行模拟?

我怎么能用Citrus克服这个问题呢?

I need to write automated tests for Enterprise Service Bus (ESB). When ESB is running it performs different scheduled operations including DB queries, SOAP and TCP calls, etc. Also it periodically checks whether some services are active and stops flows in case it is not.

So in my case there will be some problems:

some flows will stop because service is not responding another flows will continuously run in negative scenariuos producing errors

Is it possible to have mocks continuosly running while executing tests using Citrus Framework?

How else can I overcome this problems with Citrus?

最满意答案

请注意,Citrus中的所有服务器组件仅在执行测试时才会生效。 这是因为Citrus会在测试套件之前/之后自动启动和停止服务器组件。 当Citrus处于非活动状态时,服务器组件将停止。

如果您想打破这些限制,请查看柑橘模拟器侧项目,该项目是针对不同消息传输类型的完整独立模拟器(尽管仍处于测试阶段)。

如果前面提到的限制对您有效,那么您可以在Citrus项目的服务器组件上使用端点适配器的组合。 您可以拥有一个静态端点适配器,它始终为传入的运行状况检查请求发送肯定响应。

请参阅端点适配器上的文档: http : //www.citrusframework.org/reference/html/endpoint-adapter.html

Please note that all server components in Citrus do only live while tests are executed. This is because Citrus automatically starts and stops the server components before/after the test suite. When Citrus is inactive the server components are stopped.

If you want to break these limitations please have a look at the citrus-simulator side project which is a complete standalone simulator for different message transport types (still in beta phase though).

If the limitation mentioned before is Ok for you then you can use a combination of endpoint adapters on the server components in your Citrus project. You could have a static endpoint adapter that always sends a positive response for incoming health check requests.

Please see the documentation on endpoint adapters: http://www.citrusframework.org/reference/html/endpoint-adapter.html

更多推荐

本文发布于:2023-04-27 23:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329080.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测试   Continuosly   Citrus   Framework   executing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!