use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class DaoWebEventRepositoryIT method testCountMatchingBySeverity.
@Test
@Transactional
public void testCountMatchingBySeverity() {
int[] matchingEventCount = m_daoEventRepo.countMatchingEventsBySeverity(new EventCriteria(new SeverityFilter(3)));
assertNotNull(matchingEventCount);
assertEquals(8, matchingEventCount.length);
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class DaoWebEventRepositoryIT method testAcknowledgeUnacknowledgeAllAlarms.
@Test
@Transactional
public void testAcknowledgeUnacknowledgeAllAlarms() {
m_daoEventRepo.acknowledgeAll("TestUser", new Date());
int matchingEventCount = m_daoEventRepo.countMatchingEvents(new EventCriteria(new AcknowledgedByFilter("TestUser")));
assertEquals(2, matchingEventCount);
m_daoEventRepo.unacknowledgeAll();
matchingEventCount = m_daoEventRepo.countMatchingEvents(new EventCriteria(new AcknowledgedByFilter("TestUser")));
assertEquals(0, matchingEventCount);
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class DaoWebEventRepositoryIT method testCountMatchingEvents.
@Test
@Transactional
public void testCountMatchingEvents() {
EventCriteria criteria = new EventCriteria();
int event = m_daoEventRepo.countMatchingEvents(criteria);
assertEquals(2, event);
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class DaoWebEventRepositoryIT method testCountMatchingEventsBySeverity.
@Test
@Transactional
public void testCountMatchingEventsBySeverity() {
EventCriteria criteria = new EventCriteria();
int[] matchingEvents = m_daoEventRepo.countMatchingEventsBySeverity(criteria);
assertNotNull(matchingEvents);
assertEquals(8, matchingEvents.length);
assertEquals(1, matchingEvents[OnmsSeverity.CLEARED.getId()]);
assertEquals(0, matchingEvents[OnmsSeverity.CRITICAL.getId()]);
assertEquals(1, matchingEvents[OnmsSeverity.INDETERMINATE.getId()]);
assertEquals(0, matchingEvents[OnmsSeverity.MAJOR.getId()]);
assertEquals(0, matchingEvents[OnmsSeverity.MINOR.getId()]);
assertEquals(0, matchingEvents[OnmsSeverity.NORMAL.getId()]);
assertEquals(0, matchingEvents[OnmsSeverity.WARNING.getId()]);
}
use of org.springframework.transaction.annotation.Transactional in project opennms by OpenNMS.
the class WebNotificationRepositoryFilterIT method testInterfaceFilter.
@Test
@Transactional
public void testInterfaceFilter() {
InterfaceFilter filter = new InterfaceFilter("192.168.1.1");
assert1Result(filter);
}
Aggregations