To Whom It May Concern:
This is the first time, I am using Junit.
I have question.
I ran the following code:
public class MailSortServicePerfTest
{
public static final long toleranceInMillis = 60*1000;
public static Test performanceTestSuite() {
long maxElapsedTimeInMillis = 1000 +
toleranceInMillis;
MailSortBatchServiceTest testCase = new
MailSortBatchServiceTest("testMailSortBatchService");
//the variable maxElapsedTimeInMillis gives the max
time the test cannot be over.
//If it's over the maxElapsedTimeInMillis time than
the test fails
Test timedTest = new TimedTest(testCase,
maxElapsedTimeInMillis);
return timedTest;
}
public static Test loadTestSuite()
{
// users=20 means 20 concurrent users at the same
time
int users = 4;
// iterations=10 means run 10 times. Means run 200
times
int iterations = 1;
// timer = ConstantTimer(1000) means between the
interval between the iterations is 1 seconds.
Timer timer = new ConstantTimer(1000);
long maxElapsedTimeInMillis = 1000;
Test factory = new TestMethodFactory
(MailSortBatchServiceTest.class,"testMailSortBatchService");
Test timedTest = new TimedTest
(factory,maxElapsedTimeInMillis);
LoadTest loadTest = new LoadTest
(timedTest,users,iterations);
loadTest.setEnforceTestAtomicity(true);
return loadTest;
}
public static void main(String args[]) {
// junit.textui.TestRunner.run(performanceTestSuite
());
junit.textui.TestRunner.run(loadTestSuite());
}
}
When I ran the above with 4 users, it gave me a result of 10.359
seconds. When I changed to 100 users, and ran the result it gave me
10.282 seconds. I don't understand why would running 100 users would
actually decrease the time from 10.359 to 10.282 seconds. Is this
10.282 seconds means each user only takes 10.282 seconds or the total
number of seconds for 100 users running this is 10.282 seconds. Can
someone please tell me what the 10.282 seconds means, please.
Any help would be greatly appreciated it.
Thank You.
Yours,
Albert Lam