Search in sources :

Example 31 with Ticket

use of org.opennms.api.integration.ticketing.Ticket in project opennms by OpenNMS.

the class Otrs31TicketerPluginTest method testCreate.

@Test
public void testCreate() throws PluginException {
    otrsPlugin.saveOrUpdate(s_ticket);
    Ticket otrsTicket = otrsPlugin.get(s_ticket.getId());
    assertTicketEquals(s_ticket, otrsTicket);
}
Also used : Ticket(org.opennms.api.integration.ticketing.Ticket) Test(org.junit.Test)

Example 32 with Ticket

use of org.opennms.api.integration.ticketing.Ticket in project opennms by OpenNMS.

the class JiraTicketerPluginTest method get.

private void get(String ticketId) throws PluginException {
    Ticket newTicket = m_ticketer.get(ticketId);
    assertNotNull(newTicket);
    assertEquals(ticketId, newTicket.getId());
    assertEquals(Ticket.State.OPEN, newTicket.getState());
    assertTrue("Unexpected summary: " + newTicket.getSummary(), newTicket.getSummary().contains("This is the summary"));
    assertTrue("Unexpected description: " + newTicket.getDetails(), newTicket.getDetails().contains("details"));
}
Also used : Ticket(org.opennms.api.integration.ticketing.Ticket)

Example 33 with Ticket

use of org.opennms.api.integration.ticketing.Ticket in project opennms by OpenNMS.

the class JiraTicketerPluginTest method verifyTooManyFiles.

@Test
@Ignore
public void verifyTooManyFiles() throws PluginException {
    JiraTicketerPlugin plugin = new JiraTicketerPlugin();
    for (int i = 0; i < 500; i++) {
        System.out.print(i + ": ");
        Ticket ticket = plugin.get("NMS-8947");
        System.out.print(ticket.getSummary() + "\n");
    }
}
Also used : Ticket(org.opennms.api.integration.ticketing.Ticket) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 34 with Ticket

use of org.opennms.api.integration.ticketing.Ticket in project opennms by OpenNMS.

the class RemedyTicketerPluginTest method setUp.

@Override
protected void setUp() throws Exception {
    System.setProperty("opennms.home", "src" + File.separatorChar + "test" + File.separatorChar + "opennms-home");
    m_ticketer = new RemedyTicketerPlugin();
    m_ticket = new Ticket();
    m_ticket.setState(Ticket.State.OPEN);
    m_ticket.setSummary("Test OpenNMS Integration");
    m_ticket.setDetails("Created by Axis java client. Date: " + new Date());
    m_ticket.setUser("antonio@opennms.it");
}
Also used : Ticket(org.opennms.api.integration.ticketing.Ticket) Date(java.util.Date)

Example 35 with Ticket

use of org.opennms.api.integration.ticketing.Ticket in project opennms by OpenNMS.

the class RemedyTicketerPluginTest method testSaveAndGet.

public void testSaveAndGet() {
    try {
        m_ticketer.saveOrUpdate(m_ticket);
        m_ticketId = m_ticket.getId();
        Ticket ticket = m_ticketer.get(m_ticketId);
        assertEquals(m_ticketId, ticket.getId());
        assertEquals(State.OPEN, ticket.getState());
    } catch (PluginException e) {
        e.printStackTrace();
    }
}
Also used : Ticket(org.opennms.api.integration.ticketing.Ticket) PluginException(org.opennms.api.integration.ticketing.PluginException)

Aggregations

Ticket (org.opennms.api.integration.ticketing.Ticket)46 PluginException (org.opennms.api.integration.ticketing.PluginException)15 Date (java.util.Date)9 Test (org.junit.Test)7 OnmsAlarm (org.opennms.netmgt.model.OnmsAlarm)4 MXStringType (com.ibm.maximo.MXStringType)3 Properties (java.util.Properties)3 Plugin (org.opennms.api.integration.ticketing.Plugin)3 DataRetrievalFailureException (org.springframework.dao.DataRetrievalFailureException)3 BasicIssue (com.atlassian.jira.rest.client.api.domain.BasicIssue)2 Issue (com.atlassian.jira.rest.client.api.domain.Issue)2 QuerySHSIMPINCResponseType (com.ibm.maximo.QuerySHSIMPINCResponseType)2 QuerySHSIMPINCType (com.ibm.maximo.QuerySHSIMPINCType)2 SHSIMPINCINCIDENTType (com.ibm.maximo.SHSIMPINCINCIDENTType)2 File (java.io.File)2 IOException (java.io.IOException)2 BigInteger (java.math.BigInteger)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Ignore (org.junit.Ignore)2