public static void main(String[] args) {
junit.textui.TestRunner.run(BeanContextServiceRevokedEventTest.class);
}
public void testBeanContextServiceRevokedEvent_NullParam() {
BeanContextServices services = new MockBeanContextServices();
try {
new MockBeanContextServiceRevokedEvent(null, BeanContext.class,
true);
fail("IAE expected");
} catch (IllegalArgumentException e) {
// expected
}
BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
services, null, true);
assertNull(event.getServiceClass());
assertSame(services, event.getSource());
assertSame(services, event.getSourceAsBeanContextServices());
assertTrue(event.isCurrentServiceInvalidNow());
try {
event.isServiceClass(Integer.class);
fail("NPE expected");
} catch (NullPointerException e) {
// expected
}
try {
event.isServiceClass(null);
fail("NPE expected");
} catch (NullPointerException e) {
// expected
}
event = new MockBeanContextServiceRevokedEvent(services, services
.getClass(), true);
assertFalse(event.isServiceClass(null));
}