@Test public void testNoAlarmData() throws Exception { EventBuilder bldr = new EventBuilder("testNoAlarmData", "AlarmdTest"); bldr.setLogMessage(null); m_alarmd.getPersister().persist(bldr.getEvent()); }
@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(); }
@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(); }
@After public void tearDown() throws Exception { m_alarmd.destroy(); }