I was able to parameterize a test suite and use its data in a test class member of the suite as follows:
In JUTsuite:
@RunWith(Suite.class)
@Suite.SuiteClasses({
JUT_test1.class,
})
public class JUTSuite{
// Declare all variables/objects you want to share with the test classes, e.g.
protected static List globalFxs;
// This is the data list we'll use as parameters
protected static List globalDxs;
@Parameters
public static Collection
Next, in test class:
@RunWith(Parameterized.class)
public class JUT_test1 {
// declare local names (if desired) for suite-wide variable/objects
// e.g.
private static List globalFxs;
// This is the test parameter:
private Dx d;
public JUT_test1(Dx d){
this.d=d;
}
@Parameters
public static Collection data(){
// Note: we're calling the suite's data() method which has already executed.
return JUTSuite.data();
}
@BeforeClass
public static void setUpBeforeClass() throws Exception {
// (If desired)initialize local variables by referencing suite variables.
// e.g.globalFxs=JUTSuite.globalFxs;
}
}