[BLUEJ-364] Parameterized unit tests don't work properly
Parameterized unit tests don't run properly; they fail with:
{noformat} java.lang.Exception: No tests found matching Method {noformat}
Example parameterized test:
{noformat} import java.util.Arrays; import java.util.Collection;
import static org.junit.Assert.*; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class) public class SimpleTest { private int expected; private int input1; private int input2;
public SimpleTest(Integer expected, Integer input1, Integer input2)
{
this.expected = expected;
this.input1 = input1;
this.input2 = input2;
}
@Parameters
public static Collection<Integer[]> data() {
return Arrays.asList(new Integer[][] {
{1, 1, 0},
{2, 1, 1}
});
}
@Test
public void testAddInts()
{
assertEquals(expected, input1 + input2);
}
} {noformat}
Issue metadata
- Issue type: Bug
- Priority: Low