gpt4 book ai didi

testing - Citrus 航类预订样本执行?

转载 作者:行者123 更新时间:2023-11-28 21:23:58 25 4
gpt4 key购买 nike

我是 Citrus 的新手,所以我尝试执行

航类预订示例,但我遇到了一些问题。首先,我认为有一点

自述文件错误(https://github.com/christophd/citrus-samples/tree/master/sample-flightbooking 上的 readme.md)。 “转到该文件夹​​并在 Web 容器中启动 BookStore WebService 应用程序。执行此操作的最简单方法是执行”它似乎是另一个示例自述文件的一部分。

当我执行 mvn jetty:run 时,jetty 服务器启动但我收到了这些消息:

  • retrying using FixedBackOff{interval=5000, currentAttempts=4, maxAttempts=unlimited}. Cause: Could not connect to broker URL:tcp://localhost:61616. Reason: java.net.ConnectException: Connectionrefused: connect 11:18:22,197 ERROR ageListenerContainer| Could notrefresh JMS Connection for destination 'Travel.Agency.Request.Queue'

此外,当我尝试 mvn integration-test(码头服务器运行时)时,测试失败并收到以下消息:

[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Timeelapsed: 4.575 s <<< FAILURE! - incom.consol.citrus.samples.flightbooking.FlightBookingIT [ERROR]FlightBookingIT(com.consol.citrus.samples.flightbooking.FlightBookingIT)Time elapsed: 1.514 s <<< FAILURE!com.consol.citrus.exceptions.TestCaseFailedException: Test case failedCaused by: org.springframework.jms.UncategorizedJmsException:Uncategorized exception occurred during JMS processing; nestedexception is javax.jms.JMSException: Could not connect to broker URL:tcp://localhost:61616. Reason: java.net.ConnectException: Connectionrefused: connect Caused by: javax.jms.JMSException: Could not connectto broker URL: tcp://localhost:61616. Reason:java.net.ConnectException: Connection refused: connect Caused by:java.net.ConnectException: Connection refused: connect

在 localhost:61616 上似乎缺少某些东西(我想是 JMS 代理?)。

能否请您指导我如何成功执行示例?

(我正在运行 Windows 10)

最佳答案

简答

很抱歉您对 Citrus 的第一印象不好。您对 README 文件的看法是正确的,这似乎是一个复制粘贴错误。如果会在 repo 中修复它。

要执行的正确 maven 命令是:

mvn clean verify -Dembedded

长答案

embedded 参数将激活 POM 中的两个配置文件,activemq-embeddedjetty-embedded。正如他们的名字所暗示的那样,这将启动一个内存中的 ActiveMQ 代理,以及一个 Jetty 服务器,在集成测试运行之前部署了被测系统。

请注意,在其他示例中,例如sample-databind,README 建议运行 mvn clean install -Dembedded=true。这几乎是一样的,但我更喜欢 verify 生命周期,因为它不会将工件复制到本地 maven 存储库。此外,配置文件激活的 =true 部分不是必需的,因为一旦属性存在(与其实际值无关)就会激活相应的配置文件,请参阅

<activation>
<property>
<name>embedded</name>
</property>
</activation>

关于testing - Citrus 航类预订样本执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45564128/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com