Ticket t4 = this._helper.createTicket("code4", new Date(), null, "message4", "pageManagerCustomers",
1, 0, "editorCustomers", null, Ticket.STATES_WORKING, new Date(), true);
this._ticketDAO.addTicket(t4);
// message = 'message2'
TicketSearchBean searchBean = this._helper.createSearchBean("message2", null, null, null, null, null, null, null, null);
List<String> ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code2" }, ticketIds);
// Tutti i message
searchBean.setMessage("ess");
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code1", "code2", "code3", "code4" }, ticketIds);
// author = 'mainEditor'
searchBean.setAuthor("mainEditor");
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code1", "code3" }, ticketIds);
// author = 'mainEditor', operator = 'editorCustomers'
searchBean.setOperator("editorCustomers");
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code3" }, ticketIds);
// operator = 'editorCustomers', priority = 0, status = { DISPATCHED, OPENED }
searchBean.setAuthor(null);
searchBean.setPriority(0);
searchBean.setStates(new int[] { Ticket.STATES_WORKING, Ticket.STATES_OPENED });
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code4" }, ticketIds);
// operator = 'editorCustomers', priority = 0
searchBean.setStates(null);
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code4" }, ticketIds);
// priority = 0, wttRoles = { }
searchBean.setOperator(null);
searchBean.setWttRoles(new String[] { "pageManager" });
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code1" }, ticketIds);
// priority = 0
searchBean.setOperator(null);
searchBean.setWttRoles(new String[] { });
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code1", "code4" }, ticketIds);
// priority = 0, userInterventionType = 0, assignedInterventionType = 1
searchBean.setUserInterventionType(0);
searchBean.setAssignedInterventionType(1);
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code1" }, ticketIds);
// userInterventionType = 1
searchBean.setPriority(null);
searchBean.setUserInterventionType(1);
searchBean.setAssignedInterventionType(null);
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code2", "code4" }, ticketIds);
// userInterventionType = 1, resolved = true
searchBean.setResolved(new Boolean(true));
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code4" }, ticketIds);
// userInterventionType = 1, resolved = false
searchBean.setResolved(new Boolean(false));
ticketIds = this._ticketDAO.searchTicketIds(searchBean);
this.verifyTicketIds(new String[] { "code2" }, ticketIds);
} catch (Throwable t) {
throw t;
} finally {