use of org.opennms.netmgt.config.vacuumd.Trigger in project opennms by OpenNMS.
the class VacuumdIT method testRunTrigger.
/**
* Simple test running a trigger.
*/
@Test
@JUnitTemporaryDatabase(tempDbClass = MockDatabase.class)
public final void testRunTrigger() throws InterruptedException {
Trigger trigger = VacuumdConfigFactory.getInstance().getTrigger("selectAll");
String triggerSql = trigger.getStatement().getContent();
MockUtil.println("Running trigger query: " + triggerSql);
int count = m_jdbcTemplate.queryForList(triggerSql).size();
AutomationProcessor ap = new AutomationProcessor(VacuumdConfigFactory.getInstance().getAutomation("cosmicClear"));
assertFalse("Testing the result rows:" + count + " with the trigger operator " + trigger.getOperator() + " against the required rows:" + trigger.getRowCount(), ap.getTrigger().triggerRowCheck(trigger.getRowCount(), trigger.getOperator(), count));
assertEquals(0, count);
}
Aggregations