@Test
public void testBusConstructionWithoutTCCL() throws Exception {
ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(new TestClassLoader());
BusFactory factory = new CXFBusFactory() {
public Bus createBus(Map<Class<?>, Object> e, Map<String, Object> properties) {
return new ExtensionManagerBus(e, properties, this.getClass().getClassLoader());
}
};
Bus bus = factory.createBus();
assertNotNullExtensions(bus);
} finally {
Thread.currentThread().setContextClassLoader(origClassLoader);
}
}