我需要为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 errorsIs 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
更多推荐
发布评论