Пример #1
0
 @After
 public void tearDown() throws Exception {
   m_eventMgr.finishProcessingEvents();
   stopDaemons();
   sleep(200);
   if (m_assertLevel != null) {
     MockLogAppender.assertNotGreaterOrEqual(m_assertLevel);
   }
   m_db.drop();
   MockUtil.println("------------ End Test  --------------------------");
 }
Пример #2
0
 private void verifyAnticipated(long millis, boolean checkUnanticipated) {
   // make sure the down events are received
   MockEventUtil.printEvents(
       "Events we're still waiting for: ", m_anticipator.waitForAnticipated(millis));
   assertTrue("Expected events not forthcoming", m_anticipator.waitForAnticipated(0).isEmpty());
   if (checkUnanticipated) {
     sleep(2000);
     MockEventUtil.printEvents("Unanticipated: ", m_anticipator.unanticipatedEvents());
     assertEquals("Received unexpected events", 0, m_anticipator.unanticipatedEvents().size());
   }
   sleep(1000);
   m_eventMgr.finishProcessingEvents();
   assertEquals(
       "Wrong number of outages opened",
       m_outageAnticipator.getExpectedOpens(),
       m_outageAnticipator.getActualOpens());
   assertEquals(
       "Wrong number of outages in outage table",
       m_outageAnticipator.getExpectedOutages(),
       m_outageAnticipator.getActualOutages());
   assertTrue(
       "Created outages don't match the expected outages", m_outageAnticipator.checkAnticipated());
 }