use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerFactoryTest method testSetIpcManagerNull.
public void testSetIpcManagerNull() {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("argument ipcManager must not be null"));
try {
EventIpcManagerFactory.setIpcManager(null);
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerDefaultImplTest method testInitWithNoHandlerPoolSize.
public void testInitWithNoHandlerPoolSize() {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalStateException("handlerPoolSize not set"));
EventIpcManagerDefaultImpl manager = new EventIpcManagerDefaultImpl(m_registry);
manager.setEventHandler(m_eventHandler);
try {
manager.afterPropertiesSet();
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerDefaultImplTest method testInitWithNoEventHandler.
public void testInitWithNoEventHandler() {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalStateException("eventHandler not set"));
EventIpcManagerDefaultImpl manager = new EventIpcManagerDefaultImpl(m_registry);
manager.setHandlerPoolSize(5);
try {
manager.afterPropertiesSet();
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class AbstractJaxbConfigDaoTest method testAfterPropertiesSetWithNoConfigSet.
public void testAfterPropertiesSetWithNoConfigSet() {
TestJaxbConfigDao dao = new TestJaxbConfigDao();
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalStateException("property configResource must be set and be non-null"));
try {
dao.afterPropertiesSet();
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class JdbcFilterDaoIT method testAfterPropertiesSetNoDataSource.
@Test
public void testAfterPropertiesSetNoDataSource() throws Exception {
ThrowableAnticipator ta = new ThrowableAnticipator();
JdbcFilterDao dao = new JdbcFilterDao();
InputStream is = ConfigurationTestUtils.getInputStreamForConfigFile("database-schema.xml");
dao.setDatabaseSchemaConfigFactory(new DatabaseSchemaConfigFactory(is));
is.close();
ta.anticipate(new IllegalStateException("property dataSource cannot be null"));
try {
dao.afterPropertiesSet();
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
Aggregations