Bus bus = (Bus) ctx.getBean(Bus.DEFAULT_BUS_ID);
bus.setExtension(cfg, Configurer.class);
DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
DestinationFactory factory = dfm.getDestinationFactory("http://cxf.apache.org/transports/http");
Destination d = factory.getDestination(info);
assertTrue(d instanceof JettyHTTPDestination);
JettyHTTPDestination jd = (JettyHTTPDestination) d;
assertEquals("foobar", jd.getServer().getContentEncoding());
JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
assertEquals(111, engine.getThreadingParameters().getMinThreads());
assertEquals(120, engine.getThreadingParameters().getMaxThreads());
ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
ConduitInitiator ci = cim.getConduitInitiator("http://cxf.apache.org/transports/http");
HTTPConduit conduit = (HTTPConduit) ci.getConduit(info);
assertEquals(97, conduit.getClient().getConnectionTimeout());
info.setName(new QName("urn:test:ns", "Bar"));
conduit = (HTTPConduit) ci.getConduit(info);
assertEquals(79, conduit.getClient().getConnectionTimeout());
JettyHTTPDestination jd2 =
(JettyHTTPDestination)factory.getDestination(
getEndpointInfo("foo", "bar", "http://localhost:9001"));
engine = (JettyHTTPServerEngine)jd2.getEngine();
assertEquals(40000, engine.getMaxIdleTime());
assertEquals(99, engine.getThreadingParameters().getMinThreads());
assertEquals(777, engine.getThreadingParameters().getMaxThreads());
assertTrue("The engine should support session manager", engine.isSessionSupport());
assertNotNull("The handlers should not be null", engine.getHandlers());
assertEquals(1, engine.getHandlers().size());
assertTrue("The connector should be instance of org.eclipse.jetty.server.bio.SocketConnector",
engine.getConnector() instanceof org.eclipse.jetty.server.bio.SocketConnector);
JettyHTTPDestination jd3 =
(JettyHTTPDestination)factory.getDestination(
getEndpointInfo("sna", "foo", "https://localhost:9002"));
engine = (JettyHTTPServerEngine)jd3.getEngine();
assertEquals(111, engine.getThreadingParameters().getMinThreads());
assertEquals(120, engine.getThreadingParameters().getMaxThreads());
assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
JettyHTTPDestination jd4 =
(JettyHTTPDestination)factory.getDestination(
getEndpointInfo("sna", "foo2", "https://localhost:9003"));
engine = (JettyHTTPServerEngine)jd4.getEngine();
assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);
JettyHTTPDestination jd5 =
(JettyHTTPDestination)factory.getDestination(
getEndpointInfo("sna", "foo", "http://localhost:9100"));
engine = (JettyHTTPServerEngine)jd5.getEngine();
String r = "expected fallback thread parameters configured for port 0";
assertNotNull(r, engine.getThreadingParameters());