Question
Run multiple Test Suite in a order
If you want to run many test suite class in an order , you can use the following way which i found it useful for my test cases.
my main master suite looks like this
package com.tt.vl.testcase.svc1.testsuite
{
[Suite]
[RunWith("org.flexunit.runners.Suite")]
public class MasterSuite
{
public var t1:TestSuite1;
public var t2:TestSuite2;
public var t3:TestSuite3;
}
}
The changes i made in child suite is that i included the order tag in all my child suite in a orderly way i want it to execute
package com.tt.vl.testcase.svc1.testsuite
{
import com.tt.vl.testcase.svc1.cases.*;
[Suite(order=1)]
[RunWith("org.flexunit.runners.Suite")]
public class TestSuite1
{
public var a:Test1;
}
}
package com.tt.vl.testcase.svc1.testsuite
{
import com.tt.vl.testcase.svc1.cases.*;
[Suite(order=2)]
[RunWith("org.flexunit.runners.Suite")]
public class TestSuite2
{
public var a:Test2;
}
}
package com.tt.vl.testcase.svc1.testsuite
{
import com.tt.vl.testcase.svc1.cases.*;
[Suite(order=3)]
[RunWith("org.flexunit.runners.Suite")]
public class TestSuite3
{
public var a:Test3;
}
}
so on and so forth
It seems that this order test suite is working.
But you will notice that if you have more than one variable inside a child test suite, it will take those test class in random order. what i mean to say is this for example
package com.tt.vl.testcase.svc1.testsuite
{
import com.tt.vl.testcase.svc1.cases.*;
[Suite(order=4)]
[RunWith("org.flexunit.runners.Suite")]
public class TestSuite4
{
public var a:Test4;
public var b:Test5;
public var c:Test6;
}
}
Now in this case when it runs the TestSuite 4, inside the testsuite4 it has three Test classes to be run i,e. Test4, Test5 & Tes6. You cant have a control on this classes , it will take random classes in any Test Suite if it has more than 1. So, The only possible way to run a Test class in an order is to have one single Test class inside a Test Suite. I know by definition Unit Testing is not supposed to be dependent but if you want it to be done this is what i found.
Regards,
Rupam
