use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class AbstractAegisTest method createBus.
@Override
protected Bus createBus() throws BusException {
ExtensionManagerBus bus = new ExtensionManagerBus();
BusFactory.setDefaultBus(bus);
return bus;
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class ClientCapture method main.
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.err.println("please provide wsdl and classes dump location");
System.exit(0);
}
final Bus bus = new ExtensionManagerBus();
BusFactory.setDefaultBus(bus);
final DumpingClassLoaderCapturer capturer = new DumpingClassLoaderCapturer();
bus.setExtension(capturer, GeneratedClassClassLoaderCapture.class);
Client.run(args, bus);
capturer.dumpTo(new File(args[1]));
System.exit(0);
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class ASMHelperTest method testLoader.
@Test
public void testLoader() throws Exception {
CustomLoader cl = new CustomLoader(new ExtensionManagerBus());
Class<?> clz = cl.createCustom();
assertNotNull(clz);
assertTrue(cl.isFound());
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class CXFBusImplTest method testBusID.
@Test
public void testBusID() {
Bus bus = new ExtensionManagerBus();
String id = bus.getId();
assertEquals("The bus id should be cxf", id, Bus.DEFAULT_BUS_ID + Math.abs(bus.hashCode()));
bus.setId("test");
assertEquals("The bus id should be changed", "test", bus.getId());
bus.shutdown(true);
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class CXFBusImplTest method testShutdownWithBusLifecycle.
@Test
public void testShutdownWithBusLifecycle() {
final Bus bus = new ExtensionManagerBus();
BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
EasyMock.reset(listener);
listener.preShutdown();
EasyMock.expectLastCall();
listener.postShutdown();
EasyMock.expectLastCall();
EasyMock.replay(listener);
lifeCycleManager.registerLifeCycleListener(listener);
bus.shutdown(true);
EasyMock.verify(listener);
bus.shutdown(true);
}
Aggregations