Have junitperf jar in your compile and runtime classpath http://www.clarkware.com/software/junitperf-1.9.1.zip
2.
add following code in a main method in ur junit class
public static void main(..) {
int users = 4;
int iterations = 5;
JUnit4TestAdapter testCase = new JUnit4TestAdapter(MyOwnJunit.class);
junit.framework.Test loadTest = new LoadTest(testCase, users, iterations);
junit.textui.TestRunner.run(loadTest);
}
3.
run junit as java program instead of junit
similar decorators can be used for performance testing just as for multi-threaded testing. This can be huge time saver to quickly test any code for concurrent access issues, that get reported. You can make these concurrent access unit tests as part of your CI as well.
No comments:
Post a Comment