|
From: Luke B. <lb...@gm...> - 2004-11-22 19:41:10
|
That's not supported in the current implementation, but if you want to
add that class, it should be very simple to write.
Just extend TestCase and change the routine that calls each method so
that it only calls setup and teardown outside of the for..in loop.
I haven't tested this, but here's what I was thinking:
import com.asunit.framework.*;
class TestSetup extends TestCase {
private function runMethod(method:String)
{
setCurrentMethod(method);
this[method]();
}
private function run()
{
var mList:Array = getMethods();
setUp();
for(var i=0; i<mList.length; i++) {
runMethod(mList[i]);
}
tearDown();
}
}
Now your concrete Test class should extend TestSetup rather than TestCase.
If someone is interested in this, let me know if it works.
I think it's important to mention two things here:
1) This is actually a relatively unsafe operation because now your
test methods will be operating on a configuration serially and may
alter the configuration for the next test method.
2) This is NOT asynchronous, so it won't allow you to perform some
asynchronous operation like loading XML for your tests to consume.
Let me know how it goes.
lb.
www.asunit.com
|