--- In junitperf@y..., Mike Clark <mike@c...> wrote:
> Please explain what you mean by running it as a simple JUnit test class,
> as opposed to the way that doesn't seem to work.
>
> Mike
>
> --
> Mike Clark
> http://clarkware.com
> (720) 851-2014
Hello again, and thank you for your interest,
I will try to explain my problem, not in english but in "java" ;-)
To do so, I've uploaded a zip file (JUnitPerfTestAll.zip) with the example of
what I'm meaning. You'll best use your time examining the code than keeping on
reading... but I will try to expose the problem again anyway.
There is a boundle of java source files, a couple of jar (junit 3.7 and
junitperf 1.8) and a build.xml file to be run with ant. The build.xml file has a
couple of interesint targets:
- test-junit: it will run JUnitTestAll as a classic JUnit test bundle (in fact,
JUnitTestAll import a couple of dummy tests from TestClass_1 ant TestClass_2).
- test-junitperf: it will run JUnitPerfLoadTest ant it has the makeLoadTest()
method to be inspected...
. protected static Test makeLoadTest() {
. int users = 1;
. int iterations = 1;
. Test factory = new TestFactory(JUnitTestAll.class);
.// Test factory = new TestFactory(TestClass_1.class);
.
. Test loadTest = new LoadTest(factory, users, iterations);
. return loadTest;
. }
If we uncomment the line (and uncomment the previous one), the tests in
TestClass_1 will be run, but if we run the ant target test-junitperf with
JUnitTestAll.class as the parameter for the TestFactory creation, the JVM will
complain that JUnitTestAll doesn't have any test at all (but it had when we ran
the test-junit ant tag).
The target for me is to be able of run all my unitary tests in several threads
and with several iterations... in the same sense I'm able of running all my
unitary tests with a single JUnit test class that imports all the other tests
(JUnitTestAll).
I hope that, despite of my english is not good enough, the example will show my
problem clearly enough :-)
BR.
P.S.: my environment...
- JVM: 1.2.2
- JUnit: 3.7
- JUnitPerf: 1.8
- Ant: 1.4.1