Examples of Number


Examples of org.apache.cxf.factory_pattern.Number

   
    @Test
    public void testWithManualMultiplexEprCreation() throws Exception {
   
        Service numService = Service.create(NumberFactoryImpl.NUMBER_SERVICE_QNAME);
        Number num =  (Number)numService.getPort(Number.class);
       
        InvocationHandler handler  = Proxy.getInvocationHandler(num);
        BindingProvider bp = (BindingProvider)handler;   
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                   NumberFactoryImpl.NUMBER_SERVANT_ADDRESS_ROOT + "103");
           
        IsEvenResponse numResp = num.isEven();
        assertTrue("103 is not even", Boolean.FALSE.equals(numResp.isEven()));
    }
View Full Code Here

Examples of org.apache.cxf.factory_pattern.Number

        ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);
       
        EndpointReferenceType numberTwoRef = factory.create("20");
        assertNotNull("reference", numberTwoRef);
          
        Number num =  (Number)serviceImpl.getPort(numberTwoRef, Number.class);
        assertTrue("20 is even", num.isEven().isEven());
       
        EndpointReferenceType numberTwentyThreeRef = factory.create("23");
        num =  (Number)serviceImpl.getPort(numberTwentyThreeRef, Number.class);
        assertTrue("23 is not even", !num.isEven().isEven());
    }
View Full Code Here

Examples of org.apache.cxf.factory_pattern.Number

       
        // verify it is JMS, 999 for JMS will throw a fault
        EndpointReferenceType ref = factory.create("999");
        assertNotNull("reference", ref);
        ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);   
        Number num =  (Number)serviceImpl.getPort(ref, Number.class);
        try {
            num.isEven().isEven();
            fail("there should be a fault on val 999");
        } catch (Exception expected) {
            assertTrue("match on exception message", expected.getMessage().indexOf("999") != -1);
        }
       
        ref = factory.create("37");
        assertNotNull("reference", ref);
        num =  (Number)serviceImpl.getPort(ref, Number.class);
        assertTrue("37 is not even", !num.isEven().isEven());
    }
View Full Code Here

Examples of org.apache.cxf.factory_pattern.Number

        Service numService = Service.create(serviceName);
       
        String portString = EndpointReferenceUtils.getPortName(epr);
        QName portName = new QName(serviceName.getNamespaceURI(), portString);               
        numService.addPort(portName, SoapBindingFactory.SOAP_11_BINDING, "http://foo");
        Number num = numService.getPort(portName, Number.class);

        setupContextWithEprAddress(epr, num);
       
        IsEvenResponse numResp = num.isEven();
        assertTrue("2 is even", Boolean.TRUE.equals(numResp.isEven()));

        // try again with the address from another epr
        w3cEpr = nfact.create("3");
        epr = ProviderImpl.convertToInternal(w3cEpr);
        setupContextWithEprAddress(epr, num);
        numResp = num.isEven();
        assertTrue("3 is not even", Boolean.FALSE.equals(numResp.isEven()));
       
        // try again with the address from another epr
        w3cEpr = nfact.create("6");
        epr = ProviderImpl.convertToInternal(w3cEpr);
        setupContextWithEprAddress(epr, num);
        numResp = num.isEven();
        assertTrue("6 is even", Boolean.TRUE.equals(numResp.isEven()));
    }
View Full Code Here

Examples of org.apache.cxf.factory_pattern.Number

       
        // use getPort with epr api on service
        NumberService numService = new NumberService();
        ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);
       
        Number num =  serviceImpl.getPort(numberTwoRef, Number.class);
        assertTrue("20 is even", num.isEven().isEven());
        w3cEpr = factory.create("23");
        EndpointReferenceType numberTwentyThreeRef = ProviderImpl.convertToInternal(w3cEpr);
        num =  serviceImpl.getPort(numberTwentyThreeRef, Number.class);
        assertTrue("23 is not even", !num.isEven().isEven());
    }
View Full Code Here

Examples of org.apache.struts2.components.Number

    private Integer minimumIntegerDigits;
    private Boolean parseIntegerOnly;
    private String roundingMode;

    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
        return new Number(stack);
    }
View Full Code Here

Examples of org.jscience.mathematics.number.Number

  @Override
  public ParseResult parse(final TokenList tokens, final int templatePos) {
   
    final String op = (String) tokens.get(templatePos);
    final LargeInteger input = (LargeInteger) tokens.get(templatePos + 1);
    Number result = null;
   
    if(op.equals("factorial")){
      //System.out.println("INput is: "+input);
     
      if(input.isLessThan(LargeInteger.valueOf(20)) && input.isGreaterThan(LargeInteger.ZERO)){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.