this.getVoterManager().deleteVoterById(voter3.getId());
}
}
public void testDeleteVoterBySurveyId() throws Throwable {
Voter v1 = this.getFakeVoter();
Voter v2 = this.getFakeVoter();
Survey survey=null;
List<Integer> list=null;
try {
survey = this.getFakeActiveSurvey();
this.getSurveyManager().saveSurvey(survey);
list = this.getVoterManager().searchVotersByIds(null, null, null, null, null, survey.getId(), null);
assertNull(list);
v1.setSurveyid(survey.getId());
v2.setSurveyid(survey.getId());
this.getVoterManager().saveVoter(v1);
this.getVoterManager().saveVoter(v2);
list = this.getVoterManager().searchVotersByIds(null, null, null, null, null, survey.getId(), null);
assertNotNull(list);
assertEquals(2, list.size());
this.getVoterManager().deleteVoterBySurveyId(survey.getId());
list = this.getVoterManager().searchVotersByIds(null, null, null, null, null, survey.getId(), null);
assertNull(list);
} catch (Throwable t) {
throw t;
} finally {
this.getVoterManager().deleteVoterById(v1.getId());
this.getVoterManager().deleteVoterById(v2.getId());
this.getSurveyManager().deleteSurvey(survey.getId());
}
}