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);
AbstractRefreshableApplicationContext context =
(AbstractRefreshableApplicationContext)factory.getApplicationContext();
context.close();