示例#1
0
  @Test
  public void testNoAlarmData() throws Exception {
    EventBuilder bldr = new EventBuilder("testNoAlarmData", "AlarmdTest");
    bldr.setLogMessage(null);

    m_alarmd.getPersister().persist(bldr.getEvent());
  }
示例#2
0
 @Test
 public void testNullEvent() throws Exception {
   ThrowableAnticipator ta = new ThrowableAnticipator();
   ta.anticipate(new IllegalArgumentException("event argument must not be null"));
   try {
     m_alarmd.getPersister().persist(null);
   } catch (Throwable t) {
     ta.throwableReceived(t);
   }
   ta.verifyAnticipated();
 }
示例#3
0
  @Test
  public void testNoLogmsg() throws Exception {
    EventBuilder bldr = new EventBuilder("testNoLogmsg", "AlarmdTest");
    bldr.setAlarmData(new AlarmData());

    ThrowableAnticipator ta = new ThrowableAnticipator();
    ta.anticipate(new IllegalArgumentException("Incoming event has an illegal dbid (0), aborting"));
    try {
      m_alarmd.getPersister().persist(bldr.getEvent());
    } catch (Throwable t) {
      ta.throwableReceived(t);
    }
    ta.verifyAnticipated();
  }
示例#4
0
 @After
 public void tearDown() throws Exception {
   m_alarmd.destroy();
 }