use of org.springframework.context.support.AbstractRefreshableApplicationContext in project cxf by apache.
the class BusApplicationListenerTest method testParentApplicationEvent.
@Test
public void testParentApplicationEvent() {
AbstractRefreshableApplicationContext parent = new ClassPathXmlApplicationContext();
parent.refresh();
SpringBusFactory factory = new SpringBusFactory(parent);
Bus bus = factory.createBus();
CXFBusLifeCycleManager manager = bus.getExtension(CXFBusLifeCycleManager.class);
BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
manager.registerLifeCycleListener(listener);
EasyMock.reset(listener);
listener.preShutdown();
EasyMock.expectLastCall().times(1);
listener.postShutdown();
EasyMock.expectLastCall().times(1);
EasyMock.replay(listener);
parent.close();
EasyMock.verify(listener);
}
Aggregations