public void testGetTicketActionsClosed() throws Exception { TracTicket ticket = harness.createTicket("getTicketActionsClosed"); ticket.putBuiltinValue(Key.STATUS, "closed"); ticket.putBuiltinValue(Key.RESOLUTION, "fixed"); client.updateTicket(ticket, "", null); ticket = client.getTicket(ticket.getId(), null); TracAction[] actions = ticket.getActions(); assertNotNull(actions); assertEquals(2, actions.length); assertEquals("leave", actions[0].getId()); assertEquals("reopen", actions[1].getId()); }
public void testGetTicketActions() throws Exception { TracTicket ticket = harness.createTicket("getTicketActions"); TracAction[] actions = ticket.getActions(); assertNotNull(actions); assertEquals(4, actions.length); assertEquals("leave", actions[0].getId()); assertEquals("resolve", actions[1].getId()); assertEquals("resolve", actions[1].getLabel()); assertNotNull(actions[1].getHint()); List<TracTicketField> fields = actions[1].getFields(); assertEquals(1, fields.size()); assertEquals(5, fields.get(0).getOptions().length); assertEquals("fixed", fields.get(0).getOptions()[0]); assertEquals("reassign", actions[2].getId()); fields = actions[2].getFields(); assertEquals(1, fields.size()); assertNull(fields.get(0).getOptions()); assertEquals("accept", actions[3].getId()); }