I am trying to use JUnit 4.11 to set execution order.
I have tried running the Parameterized test example on this link (Changing names of parameterized tests) within Ecipse IDE and I see no change to the displayed test name in Eclipse IDE. I expect to see test names displayed like test[1: fib(1)=1] and test[4: fib(4)=3], but instead they are displayed like test[0] and test[1]
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
The following example running in Eclipse IDE results in the following execution order (b,a,d,c) instead of the expected (a,b,c,d)
package com.org;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ExecutionOrderTestName {
@Test
public void bTest() {
System.out.println("b");
}
@Test
public void aTest() {
System.out.println("a");
}
@Test
public void dTest() {
System.out.println("d");
}
@Test
public void cTest() {
System.out.println("c");
}
}
The ordering of tests is not happening, what am I doing wrong?