use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class JettyWebSocketDestinationTest method testRegisteration.
@Test
public void testRegisteration() throws Exception {
Bus bus = new ExtensionManagerBus();
DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
EndpointInfo endpoint = new EndpointInfo();
endpoint.setAddress(ENDPOINT_ADDRESS);
endpoint.setName(ENDPOINT_NAME);
JettyHTTPServerEngine engine = EasyMock.createMock(JettyHTTPServerEngine.class);
control.replay();
TestJettyWebSocketDestination dest = new TestJettyWebSocketDestination(bus, registry, endpoint, null, engine);
dest.activate();
assertNotNull(registry.getDestinationForPath(ENDPOINT_ADDRESS));
dest.deactivate();
assertNull(registry.getDestinationForPath(ENDPOINT_ADDRESS));
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class AtmosphereWebSocketJettyDestinationTest method testUseCustomAtmoosphereInterceptors.
@Test
public void testUseCustomAtmoosphereInterceptors() throws Exception {
Bus bus = new ExtensionManagerBus();
bus.setProperty("atmosphere.interceptors", Arrays.asList(new CustomInterceptor1(), new CustomInterceptor2()));
DestinationRegistry registry = new HTTPTransportFactory().getRegistry();
EndpointInfo endpoint = new EndpointInfo();
endpoint.setAddress(ENDPOINT_ADDRESS);
endpoint.setName(ENDPOINT_NAME);
AtmosphereWebSocketServletDestination dest = new AtmosphereWebSocketServletDestination(bus, registry, endpoint, ENDPOINT_ADDRESS);
List<AtmosphereInterceptor> ais = dest.getAtmosphereFramework().interceptors();
int added = 0;
for (AtmosphereInterceptor a : ais) {
if (CustomInterceptor1.class.equals(a.getClass())) {
added++;
} else if (CustomInterceptor2.class.equals(a.getClass())) {
added++;
break;
}
}
assertEquals(2, added);
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class BusExtensionLoadingTest method testDefaultBusConstruction.
/**
* Test for checking the ExtensionManagerBus is built using the TCCL by default
*
* @throws Exception
*/
@Test
public void testDefaultBusConstruction() throws Exception {
BusFactory factory = new CXFBusFactory();
Bus bus = factory.createBus();
assertNotNullExtensions(bus);
bus.shutdown(true);
}
use of org.apache.cxf.bus.extension.ExtensionManagerBus in project cxf by apache.
the class JAXBExtensionHelperTest method setUp.
@Before
public void setUp() throws Exception {
wsdlFactory = WSDLFactory.newInstance();
wsdlReader = wsdlFactory.newWSDLReader();
wsdlReader.setFeature("javax.wsdl.verbose", false);
registry = wsdlReader.getExtensionRegistry();
if (registry == null) {
registry = wsdlFactory.newPopulatedExtensionRegistry();
}
bus = new ExtensionManagerBus();
bus.setExtension(new ASMHelperImpl(), ASMHelper.class);
ExtensionClassCreator extr = new ExtensionClassGenerator(bus);
bus.setExtension(extr, ExtensionClassCreator.class);
}
Aggregations