use of org.opennms.core.test.db.annotations.JUnitTemporaryDatabase in project opennms by OpenNMS.
the class WebNotificationRepositoryFilterIT method testNodeFilter.
@Test
// Relies on specific IDs so we need a fresh database
@JUnitTemporaryDatabase
public void testNodeFilter() {
NodeFilter filter = new NodeFilter(1);
assert1Result(filter);
}
use of org.opennms.core.test.db.annotations.JUnitTemporaryDatabase in project opennms by OpenNMS.
the class WebNotificationRepositoryFilterIT method testNotificationIdListFilter.
@Test
// Relies on specific IDs so we need a fresh database
@JUnitTemporaryDatabase
public void testNotificationIdListFilter() {
int[] ids = { 1 };
NotificationIdListFilter filter = new NotificationIdListFilter(ids);
assert1Result(filter);
}
use of org.opennms.core.test.db.annotations.JUnitTemporaryDatabase in project opennms by OpenNMS.
the class WebNotificationRepositoryFilterIT method testServiceFilter.
@Test
// Relies on specific IDs so we need a fresh database
@JUnitTemporaryDatabase
public void testServiceFilter() {
Notification[] notifs = m_daoNotificationRepo.getMatchingNotifications(new NotificationCriteria());
System.out.println(notifs[0].getServiceId());
ServiceFilter filter = new ServiceFilter(1, null);
assert1Result(filter);
}
use of org.opennms.core.test.db.annotations.JUnitTemporaryDatabase in project opennms by OpenNMS.
the class WebEventRepositoryFilterIT method testAcknowledgeByFilter.
@Test
// Relies on specific IDs so we need a fresh database
@JUnitTemporaryDatabase
public void testAcknowledgeByFilter() {
AcknowledgedByFilter filter = new AcknowledgedByFilter("TestUser");
EventCriteria criteria = new EventCriteria(filter);
Event[] events = m_daoEventRepo.getMatchingEvents(criteria);
assertEquals(0, events.length);
m_daoEventRepo.acknowledgeMatchingEvents("TestUser", new Date(), new EventCriteria(new EventIdFilter(1)));
events = m_daoEventRepo.getMatchingEvents(criteria);
assertEquals(1, events.length);
assertEquals("TestUser", events[0].getAcknowledgeUser());
m_daoEventRepo.unacknowledgeAll();
}
use of org.opennms.core.test.db.annotations.JUnitTemporaryDatabase in project opennms by OpenNMS.
the class WebEventRepositoryFilterIT method testAlarmIdFilter.
@Test
// Relies on specific IDs so we need a fresh database
@JUnitTemporaryDatabase
public void testAlarmIdFilter() {
AlarmIdFilter filter = new AlarmIdFilter(1);
Event[] events = getMatchingDaoEvents(filter);
assertEquals(1, events.length);
}
Aggregations