Eclipse中的JUnit测试时序 [英] JUnit test timing in Eclipse

查看:95
本文介绍了Eclipse中的JUnit测试时序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse Helios上安装了JUnit 3.我创建了一个测试案例,以通过Web服务添加100万用户并测试结果.

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.

我不太了解JUnite计时,结果(在JUnit输出上):

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>

时间在JUnit显示屏上显示:8,880.946 s.那是什么意思?可以显示秒数(而在XML中为time="8880.946")吗?

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")?

8880.946(在XML中)是毫秒吗?如果没有,我将如何配置Eclipse JUnit以允许时间以毫秒为单位显示(我问的原因是因为我最初添加了1000个用户,结果来到了13.593s).

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).

推荐答案

时间总是以秒为单位.不知道如何更改它,为什么这么多,为什么要更改?

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.

这篇关于Eclipse中的JUnit测试时序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆