如何使用参数化构造函数运行 junit
我必须从命令行运行 junit 测试,团队中的一个人创建了如下所示的 junit 类:
public Test extends TestCore
{
String some;
public Test(String some)
{
this.some = some;
}
//some test here
}
这项工作在 eclipse 中进行,但不是从命令行进行。 执行此类文件的结果给了我如下错误:
Test class should have exactly one public zero-argument constructor.
有人可以帮助我吗?
雅罗斯瓦夫干杯。
I have to run junit test from command line and one of the guy in the team created junit classes like below:
public Test extends TestCore
{
String some;
public Test(String some)
{
this.some = some;
}
//some test here
}
this work from the eclipse but doesn't from command line.
The result of execution this kind of file gave me error like below:
Test class should have exactly one public zero-argument constructor.
Anyone could help me?
Cheers Jaroslaw.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Eclipse 使用不同的测试运行器。也许参数化构造函数是由
TestCore
作为参数化测试引起的,例如:那么您使用的是哪个版本的 junit?
Eclipse uses a different testrunner. Maybe the parameterized constructors are caused by
TestCore
being a parameterized test, e.g. like this:So which version of junit are you using?