mercredi 29 avril 2015

getRequests() must return an Iterable of arrays

my code:

@RunWith(Parameterized.class)                                                                              
public class FreshResultCompareRunner2 {                                                                   


    //This is called before @BeforeClass !                                                                 
    @Parameterized.Parameters                                                                              
    public static Collection getRequests() throws IOException {                                            
        injector = Guice.createInjector(new MainModule());                                                 
        initStaticFromInjector();                                                                          
        initTestInput();                                                                                   
        return OrganizeTestParameterizedInput();                                                           
    }                                                                                                      


    private static void initTestInput() throws IOException {                                               

    }                                                                                                      

    private static Collection OrganizeTestParameterizedInput() {                                           

        Object[] objectMatrix = new Object[100];                                                
        for (int i = 0; i < 100; i++) {                                                         
            objectMatrix[i] = i;                                                                           
        }                                                                                                  
        return Arrays.asList(objectMatrix);                                                                
    }                                                                                                      

returns the following exception:

getRequests() must return an Iterable of arrays

how can i run the parameterized junit with increasing int only as input param?

say run the same test for i=0 ...100 ?

Aucun commentaire:

Enregistrer un commentaire