| The ExampleStatefulTestCase is an example
stateful TestCase .
If the testState() test is run without a
TestMethodFactory , then all threads of a
LoadTest will share the objects in the
test fixture and may cause some tests to fail.
To ensure that each thread running the test method has a
thread-local test fixture, use:
Test factory =
new TestMethodFactory(ExampleStatefulTestCase.class, "testState");
LoadTest test = new LoadTest(factory, numberOfUsers, ...);
...
author: Mike Clark author: Clarkware Consulting, Inc. |