I was trying to understand evaluate() method of Statement class say for example as per the code present in Apply '@Rule' after each '@Test' and before each '@After' in JUnit
The evaluate method actually executes both before and after and then moves ahead.
@Override
public void evaluate() throws Throwable {
// TODO Auto-generated method stub
try{
System.out.println("I am Rule1");
arg0.evaluate();
System.out.println("I am Rule2");
}
The part of the result of the above code is :
I am Rule1
I am before
I am Test1
I am Rule2
So, after "I am Rule1", how does "I am before" and "I am Test1" get displayed when at evaluate method?