通过 Junit Tests 从 Hudson 作业读取参数
在我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以访问像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.