use of org.apache.cxf.greeter_control.ControlImpl in project cxf by apache.
the class LifeCycleTest method testGetActiveFeatures.
@Test
public void testGetActiveFeatures() {
assertNotNull("unexpected non-null ServerLifeCycleManager", manager);
manager.registerListener(new ServerLifeCycleListener() {
public void startServer(Server server) {
org.apache.cxf.endpoint.Endpoint endpoint = server.getEndpoint();
updateMap(startNotificationMap, endpoint.getEndpointInfo().getAddress());
String portName = endpoint.getEndpointInfo().getName().getLocalPart();
if ("SoapPort".equals(portName)) {
List<Feature> active = endpoint.getActiveFeatures();
assertNotNull(active);
assertEquals(1, active.size());
assertTrue(active.get(0) instanceof WSAddressingFeature);
assertSame(active.get(0), AbstractFeature.getActive(active, WSAddressingFeature.class));
} else {
List<Feature> active = endpoint.getActiveFeatures();
assertNotNull(active);
assertEquals(0, active.size());
assertNull(AbstractFeature.getActive(active, WSAddressingFeature.class));
}
}
public void stopServer(Server server) {
updateMap(stopNotificationMap, server.getEndpoint().getEndpointInfo().getAddress());
}
});
Endpoint greeter = Endpoint.publish(ADDRESSES[0], new GreeterImpl());
Endpoint control = Endpoint.publish(ADDRESSES[1], new ControlImpl());
greeter.stop();
control.stop();
for (int i = 0; i < 2; i++) {
verifyNotification(startNotificationMap, ADDRESSES[i], 1);
verifyNotification(stopNotificationMap, ADDRESSES[i], 1);
}
}
Aggregations