}
}
public void testSearchByIds() throws Throwable {
List<Integer> list = null;
Voter voter1 = this.getFakeVoter();
Voter voter2 = this.getFakeVoter();
Voter voter3 = this.getFakeVoter();
Date date=new Date();
try {
voter1.setIpaddress("192.168.10.1");
voter2.setIpaddress("192.168.10.2");
voter3.setIpaddress("192.168.10.3");
voter1.setSex('F');
voter2.setSex('f');
voter3.setSex('M');
voter1.setCountry("jp");
voter2.setCountry("it");
voter3.setCountry("is");
voter1.setAge(Integer.valueOf(31).shortValue());
voter2.setAge(Integer.valueOf(32).shortValue());
voter3.setAge(Integer.valueOf(31).shortValue());
date.setTime(Long.valueOf("11111111111"));
voter3.setDate(date);
this.getVoterManager().saveVoter(voter1);
this.getVoterManager().saveVoter(voter2);
this.getVoterManager().saveVoter(voter3);
list=this.getVoterManager().searchVotersByIds(null, null, null, null, null, null, null);
assertNotNull(list);
assertEquals(4, list.size());
list=this.getVoterManager().searchVotersByIds(-1, null, null, null, null, null, null);
assertNull(list);
list=this.getVoterManager().searchVotersByIds(null, 31, null, null, null, null, null);
assertNotNull(list);
assertEquals(2, list.size());
list=this.getVoterManager().searchVotersByIds(null, null, "is", null, null, null, null);
assertNotNull(list);
assertEquals(1, list.size());
list=this.getVoterManager().searchVotersByIds(null, null, null, 'f', null, null, null);
assertNotNull(list);
assertEquals(2, list.size());
list=this.getVoterManager().searchVotersByIds(null, null, null, null, voter2.getDate(), null, null);
assertNotNull(list);
assertEquals(2, list.size());
list=this.getVoterManager().searchVotersByIds(null, null, null, null, null, 1, null);
assertNotNull(list);
assertEquals(3, list.size());
list=this.getVoterManager().searchVotersByIds(null, null, null, null, null, null, "192.168.10.2");
assertNotNull(list);
assertEquals(1, list.size());
assertEquals((int) voter2.getId(), (int)list.get(0));
list=this.getVoterManager().searchVotersByIds(voter2.getId(), 32, "IT", 'F', voter2.getDate(), 1, "192.168.10.2");
assertNotNull(list);
assertEquals(1, list.size());
} catch (Throwable t) {
throw t;
} finally {
this.getVoterManager().deleteVoterById(voter1.getId());
this.getVoterManager().deleteVoterById(voter2.getId());
this.getVoterManager().deleteVoterById(voter3.getId());
}
}