2010-11-12 85 views
0

我在Eclipse Helios上安裝了JUnit 3。我創建了一個測試用例,通過Web服務添加100萬用戶並測試結果。Eclipse中的JUnit測試時序

我不太明白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)。

回答

1

時間總是以秒爲單位。不知道如何改變它,並用這麼大的數字,爲什麼你想?

如果您希望以毫秒爲單位的時間,您當然可以將小數點後3位移到右側。

+0

加毫秒,我們要計算方法來計算'延遲以毫秒爲單位。 – 2010-11-12 14:56:52

0

這是其中的時間存在於XML格式:

seconds.ms 

所以你的情況是8880秒和946米利斯