use of org.apache.cxf.transport.Destination in project cxf by apache.
the class UndertowHTTPDestinationTest method testRandomPortAllocation.
@Test
public void testRandomPortAllocation() throws Exception {
bus = BusFactory.getDefaultBus(true);
transportFactory = new HTTPTransportFactory();
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setName(new QName("bla", "Service"));
EndpointInfo ei = new EndpointInfo(serviceInfo, "");
ei.setName(new QName("bla", "Port"));
Destination d1 = transportFactory.getDestination(ei, bus);
URL url = new URL(d1.getAddress().getAddress().getValue());
assertTrue("No random port has been allocated", url.getPort() > 0);
}
Aggregations