Hi,
Im just playing with threaded tests. I try to simulate 5 users each running in a special thread.
But I don't see the result I think I should see :-)
The graphical UI tells me, that we had 7 runs, sometimes 6, sometimes 0.
The textui states that 2 Tests are ok. I want to see 10, because there are 5 tests for each user.
So the question is: What do I have to do, running correct threaded tests and seeing the expected results?
Thanks for your help
Frank
This is the test I run:
************************************************************************************
import com.clarkware.junitperf.*;
import junit.framework.*;
public class Example extends TestCase {
static int pointerToArray = 0;
private String[] letterArray = {"a","b","c","d","e","f"};
public Example(String name) {
super(name);
}
public static Test suite() {
int maxUsers = 5;
Test loadTest = new LoadTest(new TestSuite(Example.class), maxUsers);
Test threadTest = new ThreadedTest( loadTest );
TestSuite suite = new TestSuite();
suite.addTest( threadTest );
return suite;
}
public void testSeitenaufbau() throws Exception
{
String letter = this.letterArray[pointerToArray];
pointerToArray++;
System.out.println( this.toString() + ": " + "Letter: " + letter );
String title;
assertEquals( "wrong title", "ok", "ok" );
}
public void testEingabeKorrekterName() throws Exception
{
System.out.println( this.toString() + ": " + this.letterArray[pointerToArray] );
assertEquals( "wrong title", "ok", "ok" );
}
}
*************************************************************************************************