use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class DataCollectionConfigFactoryTest method testInvalidResourceType.
@Test
public void testInvalidResourceType() throws IOException {
String modifiedXml = m_xml.replaceFirst("ifIndex", "brocadeIndex");
ThrowableAnticipator ta = new ThrowableAnticipator();
// ta.anticipate(new DataAccessResourceFailureException("Instance 'brocadeIndex' invalid in mibObj definition for OID '.1.3.6.1.2.1.2.2.1.10' for group 'mib2-interfaces'. Allowable instance values: any positive number, 'ifIndex', or any of the custom resourceTypes."));
ta.anticipate(new IllegalArgumentException("instance 'brocadeIndex' invalid in mibObj definition for OID '.1.3.6.1.2.1.2.2.1.10' in collection 'default' for group 'mib2-interfaces'. Allowable instance values: any positive number, 'ifIndex', or any of the configured resourceTypes: (none)"));
try {
initDataCollectionFactory(modifiedXml);
assertArrayEquals(new String[0], DataCollectionConfigFactory.getInstance().getConfiguredResourceTypes().keySet().toArray(new String[0]));
DataCollectionConfigFactory.getInstance().getConfiguredResourceTypes();
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerDefaultImplTest method testRemoveEventListenerTwoArgumentListNullUeiList.
public void testRemoveEventListenerTwoArgumentListNullUeiList() throws Exception {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("ueilist argument cannot be null"));
try {
m_manager.removeEventListener(m_listener, (List<String>) null);
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerDefaultImplTest method testRemoveEventListenerTwoArgumentListNullListener.
public void testRemoveEventListenerTwoArgumentListNullListener() throws Exception {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("listener argument cannot be null"));
try {
m_manager.removeEventListener((EventListener) null, new ArrayList<String>(0));
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerDefaultImplTest method testAddEventListenerNullListener.
public void testAddEventListenerNullListener() throws Exception {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("listener argument cannot be null"));
try {
m_manager.addEventListener((EventListener) null);
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
use of org.opennms.test.ThrowableAnticipator in project opennms by OpenNMS.
the class EventIpcManagerDefaultImplTest method testAddEventListenerTwoArgumentStringNullListener.
public void testAddEventListenerTwoArgumentStringNullListener() throws Exception {
ThrowableAnticipator ta = new ThrowableAnticipator();
ta.anticipate(new IllegalArgumentException("listener argument cannot be null"));
try {
m_manager.addEventListener((EventListener) null, "");
} catch (Throwable t) {
ta.throwableReceived(t);
}
ta.verifyAnticipated();
}
Aggregations