通过 Junit Tests 从 Hudson 作业读取参数

发布于 2024-12-29 07:35:46 字数 129 浏览 1 评论 0原文

在我的 Maven 项目中,我进行了一些 JUnit 测试。 该 Maven 项目是通过使用参数的 Hudson Job 构建的。

有没有办法让 Junit 选择 Hudson Job 中传递的参数并在执行测试时将它们用作变量?

In my Maven project, I had some JUnit Tests.
That maven project was build through a Hudson Job which uses Parameters.

Is there a way which Junit pick those Parameters passed in Hudson Job and use them as variables while executing the tests?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绳情 2025-01-05 07:35:46

您可以访问像java参数这样的参数..当使用 -Dblubb=xyz 输入参数时,您可以在使用 System.getProperty("blubb", "abc"); 运行的 junit 中访问它如果您输入参数“blubb”,它将获取字符串 xyz。

you access parameters like java parameters .. when entering parameters with -Dblubb=xyz then you can access it in the junit run with System.getProperty("blubb", "abc"); in case you enter the parameter "blubb" it gets the String xyz.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文