Package org.apache.geronimo.calculator

Examples of org.apache.geronimo.calculator.Calculator


        W3CEndpointReferenceBuilder builder = createERPBuilder();
        Document refParam = TestUtils.createDocument(REF_PARAM);
        builder.referenceParameter(refParam.getDocumentElement());
        EndpointReference epr = builder.build();
       
        Calculator calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(36, calc.multiply(6, 6));
    }
View Full Code Here


        response = dispatch.invoke(request);
        testAddResponse(response, 40, true);
    }
  
    public void testPort() throws Exception {
        Calculator calc = null;
       
        // make a call without AddressingFeature
        calc = service.getPort(Calculator.class);
        try {
            calc.add(1, 1);
            throw new ServletException("Did not throw exception");
        } catch (SOAPFaultException e) {
            // that's what we expect
        }

        // make a call with AddressingFeature disabled
        calc = service.getPort(Calculator.class, new AddressingFeature(false, false));
        try {
            calc.add(1, 1);
            throw new ServletException("Did not throw exception");
        } catch (SOAPFaultException e) {
            // that's what we expect
        }
               
        // make a call with AddressingFeature enabled
        calc = service.getPort(Calculator.class, new AddressingFeature());
        Assert.assertEquals(4, calc.add(2, 2));
      
        // make a call with AddressingFeature enabled and port       
        calc = service.getPort(PORT, Calculator.class, new AddressingFeature());
        Assert.assertEquals(6, calc.add(3, 3));
               
        EndpointReference epr = null;
       
        // make a call using EPR from Binding
        epr = ((BindingProvider)calc).getEndpointReference();
       
        calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(8, calc.add(4, 4));
       
        // make a call using EPR from Service
        epr = calc.getEPR();
       
        calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(10, calc.add(5, 5));
       
        // make a call using created EPR
        epr = createEPR();
       
        calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(12, calc.add(6, 6));
    }
View Full Code Here

    private EndpointReference createEPR() {      
        return createERPBuilder().build();
    }
   
    protected void updateAddress() {
        Calculator calc = service.getPort(Calculator.class);
        BindingProvider binding = (BindingProvider)calc;
        this.address = (String)binding.getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
        System.out.println("Set address: " + this.address);
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.calculator.Calculator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.