use of org.apache.cxf.transport.http.DestinationRegistry in project cxf by apache.
the class AtmosphereWebSocketJettyDestinationTest method testUseCXFDefaultAtmoosphereInterceptor.
@Test
public void testUseCXFDefaultAtmoosphereInterceptor() throws Exception {
Bus bus = new ExtensionManagerBus();
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 (DefaultProtocolInterceptor.class.equals(a.getClass())) {
added++;
break;
}
}
assertEquals(1, added);
}
use of org.apache.cxf.transport.http.DestinationRegistry in project cxf by apache.
the class AtmosphereWebSocketJettyDestinationTest method testUseCustomAtmoosphereInterceptor.
@Test
public void testUseCustomAtmoosphereInterceptor() throws Exception {
Bus bus = new ExtensionManagerBus();
bus.setProperty("atmosphere.interceptors", new CustomInterceptor1());
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++;
break;
}
}
assertEquals(1, added);
}
use of org.apache.cxf.transport.http.DestinationRegistry in project cxf by apache.
the class AtmosphereWebSocketServletDestinationTest method testUseCXFDefaultAtmoosphereInterceptor.
@Test
public void testUseCXFDefaultAtmoosphereInterceptor() throws Exception {
Bus bus = new ExtensionManagerBus();
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 (DefaultProtocolInterceptor.class.equals(a.getClass())) {
added++;
break;
}
}
assertEquals(1, added);
}
use of org.apache.cxf.transport.http.DestinationRegistry in project cxf by apache.
the class AtmosphereWebSocketServletDestinationTest method testUseCustomAtmoosphereInterceptor.
@Test
public void testUseCustomAtmoosphereInterceptor() throws Exception {
Bus bus = new ExtensionManagerBus();
bus.setProperty("atmosphere.interceptors", new CustomInterceptor1());
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++;
break;
}
}
assertEquals(1, added);
}
use of org.apache.cxf.transport.http.DestinationRegistry in project cxf by apache.
the class AtmosphereWebSocketServletDestinationTest 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);
TestAtmosphereWebSocketServletDestination dest = new TestAtmosphereWebSocketServletDestination(bus, registry, endpoint, ENDPOINT_ADDRESS);
dest.activate();
assertNotNull(registry.getDestinationForPath(ENDPOINT_ADDRESS));
dest.deactivate();
assertNull(registry.getDestinationForPath(ENDPOINT_ADDRESS));
}
Aggregations