use of org.apache.cxf.factory_pattern.Number in project cxf by apache.
the class MultiplexHttpAddressClientServerTest method testWithGetPortExtensionHttp.
@Test
public void testWithGetPortExtensionHttp() throws Exception {
NumberFactoryService service = new NumberFactoryService();
NumberFactory factory = service.getNumberFactoryPort();
updateAddressPort(factory, PORT);
NumberService numService = new NumberService();
ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);
W3CEndpointReference numberTwoRef = factory.create("20");
assertNotNull("reference", numberTwoRef);
Number num = serviceImpl.getPort(numberTwoRef, Number.class);
assertTrue("20 is even", num.isEven().isEven());
W3CEndpointReference numberTwentyThreeRef = factory.create("23");
num = serviceImpl.getPort(numberTwentyThreeRef, Number.class);
assertTrue("23 is not even", !num.isEven().isEven());
}
Aggregations