Eclipse 中的 JUnit 测试计时
我在 Eclipse Helios 上设置了 JUnit 3。我创建了一个测试用例,通过 Web 服务添加 100 万用户并测试结果。
我不太明白 JUnite 计时,结果(在 JUnit 输出上):
<?xml version="1.0" encoding="UTF-8"?>
<testrun name="UserRegistrationTestCase" project="TestCases" tests="1" started="1" failures="0" errors="0" ignored="0">
<testsuite name="testcases.UserRegistrationTestCase" time="8880.946">
<testcase name="testCreateUser" classname="testcases.UserRegistrationTestCase" time="8880.946"/>
</testsuite>
</testrun>
JUnit 显示上的时间为:8,880.946 s
。这意味着什么?是否以秒为单位显示(而在 XML 中为 time="8880.946"
)?
8880.946
(在 XML 中)以毫秒为单位吗?如果没有,我将如何配置 Eclipse JUnit 以允许以毫秒为单位显示时间(我问的原因是因为我最初添加了 1000 个用户,结果为 13.593s)。
I have JUnit 3 setup on Eclipse Helios. I created a test case to add 1 million users through a web service and test the result.
I don't quite understand JUnite timing, the result (on JUnit output):
<?xml version="1.0" encoding="UTF-8"?>
<testrun name="UserRegistrationTestCase" project="TestCases" tests="1" started="1" failures="0" errors="0" ignored="0">
<testsuite name="testcases.UserRegistrationTestCase" time="8880.946">
<testcase name="testCreateUser" classname="testcases.UserRegistrationTestCase" time="8880.946"/>
</testsuite>
</testrun>
The time says on the JUnit display: 8,880.946 s
. What does that mean? Does that display in seconds (whereas in the XML the time="8880.946"
)?
Is 8880.946
(in XML) in milliseconds? If not, how would I configure Eclipse JUnit to allow time to display in milliseconds (The reason I ask is because I initially added 1000 users and the result came to 13.593s
).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
时间总是以秒为单位。不知道如何改变它,而且有这么大的数字,你为什么要改变呢?
如果你想要以毫秒为单位的时间,你当然可以将小数点向右移动 3 位。
The timing is always in seconds. Not sure how to change it, and with that large a number, why would you want to?
If you want the time in milliseconds, you can of course move the decimal 3 places to the right.
这是 xml 中时间的格式:
因此,在您的情况下,它是 8880 秒和 946 毫秒
This is the format in which the time is present in xml:
So in your case it is 8880 seconds and 946 millis