Search in sources :

Example 6 with Number

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());
}
Also used : NumberService(org.apache.cxf.factory_pattern.NumberService) NumberFactory(org.apache.cxf.factory_pattern.NumberFactory) Number(org.apache.cxf.factory_pattern.Number) ServiceImpl(org.apache.cxf.jaxws.ServiceImpl) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) NumberFactoryService(org.apache.cxf.factory_pattern.NumberFactoryService) Test(org.junit.Test)

Aggregations

Number (org.apache.cxf.factory_pattern.Number)6 NumberFactoryService (org.apache.cxf.factory_pattern.NumberFactoryService)6 NumberService (org.apache.cxf.factory_pattern.NumberService)6 Test (org.junit.Test)6 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)5 NumberFactory (org.apache.cxf.factory_pattern.NumberFactory)5 ServiceImpl (org.apache.cxf.jaxws.ServiceImpl)4 Service (javax.xml.ws.Service)2 IsEvenResponse (org.apache.cxf.factory_pattern.IsEvenResponse)2 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)2 IOException (java.io.IOException)1 InvocationHandler (java.lang.reflect.InvocationHandler)1 QName (javax.xml.namespace.QName)1 BindingProvider (javax.xml.ws.BindingProvider)1