use of org.opennms.web.svclayer.model.DistributedStatusDetailsCommand in project opennms by OpenNMS.
the class DefaultDistributedStatusServiceTest method runTestCreateStatus.
public void runTestCreateStatus() {
DistributedStatusDetailsCommand command = new DistributedStatusDetailsCommand();
Errors errors = new BindException(command, "command");
command.setLocation(m_locationDefinition1.getLocationName());
command.setApplication(m_application1.getName());
expectEverything();
expect(m_monitoredServiceDao.findByApplication(m_application1)).andReturn(m_applicationServices1);
m_easyMockUtils.replayAll();
SimpleWebTable table = m_service.createStatusTable(command, errors);
m_easyMockUtils.verifyAll();
SimpleWebTable expectedTable = new SimpleWebTable();
expectedTable.setTitle("Distributed status view for Application 1 from Raleigh location");
expectedTable.addColumn("Node", "");
expectedTable.addColumn("Monitor", "");
expectedTable.addColumn("Service", "");
expectedTable.addColumn("Status", "");
expectedTable.addColumn("Response", "");
expectedTable.addColumn("Last Status Change", "");
expectedTable.addColumn("Last Update", "");
expectedTable.newRow();
expectedTable.addCell("Node 1", "Normal", "element/node.jsp?node=1");
expectedTable.addCell("Raleigh-" + LOCATION_MONITOR_ID_A, "", "distributed/locationMonitorDetails.htm?monitorId=" + LOCATION_MONITOR_ID_A);
expectedTable.addCell("HTTP", "", "element/service.jsp?ifserviceid=null");
expectedTable.addCell("Up", "bright");
expectedTable.addCell("", "");
expectedTable.addCell(IGNORE_MATCH, "");
expectedTable.addCell(IGNORE_MATCH, "");
expectedTable.newRow();
expectedTable.addCell("Node 1", "Indeterminate", "element/node.jsp?node=1");
expectedTable.addCell("Raleigh-" + LOCATION_MONITOR_ID_A, "", "distributed/locationMonitorDetails.htm?monitorId=" + LOCATION_MONITOR_ID_A);
expectedTable.addCell("HTTPS", "", "element/service.jsp?ifserviceid=null");
expectedTable.addCell("Unknown", "bright");
expectedTable.addCell("No status recorded for this service from this location", "");
expectedTable.addCell(IGNORE_MATCH, "");
expectedTable.addCell(IGNORE_MATCH, "");
assertTableEquals(expectedTable, table);
}
use of org.opennms.web.svclayer.model.DistributedStatusDetailsCommand in project opennms by OpenNMS.
the class DefaultDistributedStatusServiceTest method testFindLocationSpecificStatusNullLocation.
public void testFindLocationSpecificStatusNullLocation() {
DistributedStatusDetailsCommand command = new DistributedStatusDetailsCommand();
Errors errors = new BindException(command, "command");
command.setApplication(m_application1.getName());
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("location cannot be null"));
try {
m_service.findLocationSpecificStatus(command, errors);
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.web.svclayer.model.DistributedStatusDetailsCommand in project opennms by OpenNMS.
the class DefaultDistributedStatusServiceTest method testFindLocationSpecificStatusNullApplication.
public void testFindLocationSpecificStatusNullApplication() {
DistributedStatusDetailsCommand command = new DistributedStatusDetailsCommand();
Errors errors = new BindException(command, "command");
command.setLocation(m_locationDefinition1.getLocationName());
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("application cannot be null"));
try {
m_service.findLocationSpecificStatus(command, errors);
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
Aggregations