lundi 23 mars 2015

AndroidTestCase: Multiple times with different arguments

I have an AndroidTestCase I want to run.


At the moment I create an Array of custom Objects called uploadObjects. Then I send a request to the server and attach the response to the Objects.


Then I want to upload the Objects to the server and assert that the upload has worked.


Fantys code would be something like this:



@MediumTest
public void testForms() {

ArrayList<MyObject> uploadObjects = getMyObjects();
int serverInformation = getSpecialServerInformation();
for (MyObject o : uploadObjects){
o.setServerInformation(serverInformation);
}

for (MyObject o : uploadObjects){
String serverResponse = uploadToServer(o);
assertEquals("upload faild because of reason=" + serverResponse,
serverResponse , "worked");`
}
}


The problem here is that once one response failed the tests abort. I dont want it to abort, I want to get all the reasons. Is that possible?


Aucun commentaire:

Enregistrer un commentaire