Passing information between test methods in a junit testcase
- by Jijoy
Hi,
Currently I am creating a TestCase for one work flow and a workflow have different steps.
The results of one step is important since , second step needs to know value of step1's execution.
class TestCaseWorkFlow1 extends TestCase {
private static String resultOfStep1 = null;
public void testStep1(){
if(failed){
resultOfStep1 = "failed";
}
}
public void testStep2(){
if(resultOfStep1 != null ) {
//First test failed.
}else {
}
}
}
Currently we are using static variable to pass information between testmethods .
What is the best solution for this scenario ?
Please help.
Thanks
J