}
public void testSearchTicketIds() throws Throwable {
try {
assertEquals(0, this._ticketManager.searchTicketIds(null).size());
Ticket t1 = this._helper.createTicket("code1", new Date(), null, "message1", "mainEditor",
0, 0, "pageManagerCustomers", null, Ticket.STATES_OPENED, null, false);
this._ticketManager.addTicket(t1);
Ticket t2 = this._helper.createTicket("code2", new Date(), null, "message2", "editorCustomers",
1, 1, "mainEditor", null, Ticket.STATES_ASSIGNED, new Date(), false);
this._ticketManager.addTicket(t2);
Ticket t3 = this._helper.createTicket("code3", new Date(), null, "message3", "mainEditor",
2, 2, "editorCustomers", null, Ticket.STATES_CLOSED, null, false);
this._ticketManager.addTicket(t3);
Ticket t4 = this._helper.createTicket("code4", new Date(), null, "message4", "pageManagerCustomers",
1, 0, "editorCustomers", null, Ticket.STATES_WORKING, new Date(), true);
this._ticketManager.addTicket(t4);
// subject = 'subject2'
TicketSearchBean searchBean = this._helper.createSearchBean("message2", null, null, null, null, null, null, null, null);
List<String> ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t2.getCode() }, ticketIds);
// Tutti i subject
searchBean.setMessage("ess");
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t1.getCode(), t2.getCode(), t3.getCode(), t4.getCode() }, ticketIds);
// author = 'mainEditor'
searchBean.setAuthor("mainEditor");
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t1.getCode(), t3.getCode() }, ticketIds);
// author = 'mainEditor', operator = 'editorCustomers'
searchBean.setOperator("editorCustomers");
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t3.getCode() }, ticketIds);
// operator = 'editorCustomers', priority = 0, status = RESOLVED
searchBean.setAuthor(null);
searchBean.setPriority(0);
searchBean.setStates(new int[] { Ticket.STATES_WORKING });
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);
// operator = 'editorCustomers', priority = 0
searchBean.setStates(null);
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);
// priority = 0
searchBean.setOperator(null);
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t1.getCode(), t4.getCode() }, ticketIds);
// priority = 0, interventionType = 1
searchBean.setUserInterventionType(1);
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);
// interventionType = 1
searchBean.setPriority(null);
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t2.getCode(), t4.getCode() }, ticketIds);
// interventionType = 1, resolved = true
searchBean.setResolved(new Boolean(true));
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t4.getCode() }, ticketIds);
// interventionType = 1, resolved = false
searchBean.setResolved(new Boolean(false));
ticketIds = this._ticketManager.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { t2.getCode() }, ticketIds);