问题标签 [citrus-framework]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
205 浏览

java - 为柑橘环境变量分配特定值后是否可以更改它们

我有这样的代码

我想在加载上下文文件和属性文件后更改文件名模式是否可以通过此代码

在这个测试用例之后我有另一个这样的测试用例

我正在尝试这段代码,但 citrus 并没有影响下一个测试用例中更改的系统属性,它正在执行开始加载的文件名模式是否有任何方法可以在运行时更改 citrus 的系统属性。任何人都可以帮助解决这个问题。

0 投票
1 回答
326 浏览

citrus-framework - 同时发送和接收

我正在尝试向 JMS 主题发送和接收消息。

这些操作似乎一个接一个。问题是我的应用程序运行得非常快,当我向第一个主题发送消息时,它几乎立即出现在“toEndpoint”上。因此接收操作无法捕获适当的消息,因为它已经被处理过。

有没有办法同时进行这些操作?

问候

0 投票
1 回答
239 浏览

java - Citrus 框架:BeforeTest 实现中的类型混淆

我从 citrus 文档中获取并修改了这个示例,以创建一个测试前任务。

当我开始测试时,Spring 抛出一个 Exception 并表示它找不到 type 的 Bean javax.jms.Queue

没错,Qualifier 中的 bean id 是一个 Citrus JmsEndpoint,它是用

但是将 JmsEndpoint bean 重新定义为 Queue bean 是多余的。另一方面,不允许编译器将其定义injectedQueue为 JmsEndpoint。

显然我在这里做错了什么。柑橘样品中有完整的例子吗?还是其他地方?

谢谢

0 投票
1 回答
356 浏览

jms - Citrus:在验证之前转换 JMS 二进制消息

我想在 Citrus 测试用例中验证之前转换 JMS 二进制消息。

我发现我可以收到这样的二进制消息

但是,我必须提供自己的验证器实现(这里BinaryMessageValidator),并且我失去了 Citrus 中可用的消息验证的全部功能。

相反,我想将消息转换为 String ,然后使用Citrus 的正常验证功能

消息负载是一个普通的 XML。消息作为 JMS 二进制消息发送只是 SUT 的一个实现细节。

谢谢

0 投票
1 回答
144 浏览

simulation - Citrus-Framework:可以使用 Java DSL 从服务器模拟发送 SOAP 附件吗?

对于使用Citrus Framework进行的组件测试,我模拟了一个通过SOAP调用的后端系统。

我从组件获取 SOAP 请求并发回响应。

但现在我必须使用MTOM 附件响应来回答请求。.attachment我找到了在 a上使用的 citrus 示例soap().client(),但.attachment不适用于我的服务器模拟。

这对 Java DSL 是否可行,或者我是否在 XML DSL 中重新编写测试用例来实现这一点?

0 投票
2 回答
573 浏览

soap - Attachment missing in MTOM response from Citrus SOAP server simulation

I have built a sample Citrus testcase to simulate a SOAP server that responds with an MTOM attachment.

When I run this test and call the Citrus simulation with SoapUI, I see the contents of myAttachment.pdf in the debug logs. So at least it looks like Citrus tries to send the attachment.

However, in SoapUI I do not get an attachment. There is a XOP element in the SOAP response, but no attachment. The RAW view of SoapUI of the Citrus response looks like this.

In an MTOM response with attachment the attachment starts where this RAW view ends. It should continue like this

I am using Citrus 2.7.2 release.

Update

Still no success on this. Wireshark shows the same picture as SoapUI: the attachment is missing in the response.

However, when I debug into the code on the server (Citrus) side, I see the attachment in the response message until I get lost somewhere in a MessageSendingTemplate. Same on the console log. The message has the attachment.

There is an inline MTOM variant in the Citrus documentation, but I can't find a way to set this mtom-inline on the attachment in Java config.

Any hints, where to set a breakpoint to find where the attachment get lost? Or any other suggestions/examples on the Citrus side?

0 投票
1 回答
126 浏览

soap - 设置场景端点

我在 Citrus Simulator 场景中设置端点 URI 时遇到问题。这是我尝试构建场景的方式:

但是当我尝试发送肥皂消息时,我不断收到此消息:

osws.server.EndpointNotFound : 没有找到 [SaajSoapMessage { http://www.sikorsoftware.com/lov/schemas }LOVRequest]的端点映射

我究竟做错了什么。我应该以不同的方式设置端点吗?

谢谢,迈克尔

0 投票
1 回答
476 浏览

xml - 如果模式没有目标命名空间,Citrus 的 XML 模式验证是否可用?

我试图在 Citrus 中设置一个XsdSchemaRepository包含一些 XML 模式的内容。因为这些模式没有目标命名空间(它们不是我的,我无法解决这个问题),所以我还配置了一个RootQNameSchemaMappingStrategy,因为映射命名空间的默认策略显然不起作用。

但是,由于 Spring 类中的以下异常,我失败了:

如果模式没有目标命名空间,是否可以使用 Citrus 进行 XML 模式验证?

0 投票
2 回答
555 浏览

xpath - 用 XPath 替换元素

我尝试在 Citrus 框架中替换我输入 XML 的一些元素。

我的 Spring 上下文包含:

我的输入文件以:

我的端点是这样配置的:

我有以下错误:

这个错误的可能原因是什么?

此致

0 投票
1 回答
128 浏览

citrus-framework - 是否可以在 JAVA DSL Runner 中应用 xml 模板

我们的项目中有很多旧的 citrus xml 测试用例和模板。升级到较新版本后,我决定切换到 Java DSL。是否可以继续使用旧模板?如果我尝试这样做,我会得到一个“没有定义 .. 的 bean”异常。

我尝试通过@ImportResource 导入模板文件,但没有成功。