Package org.springframework.integration.xquery.support

Examples of org.springframework.integration.xquery.support.NumberResultMapper


   */
  @Test
  public void withNonDecimalStringExpression() {
    XQueryExecutor executor = getExecutor();
    executor.setResultMappers(Collections.singletonMap(Number.class,
        (XQueryResultMapper<Number>)new NumberResultMapper()));
    executor.setXQuery("'4'");
    executor.afterPropertiesSet();
    List<Number> result = executor.executeForNumber(MessageBuilder.withPayload("<test/>").build());
    Assert.assertEquals(1, result.size());
    Assert.assertTrue(result.contains(Long.valueOf(4)));
View Full Code Here


   */
  @Test
  public void withDecimalStringExpression() {
    XQueryExecutor executor = getExecutor();
    executor.setResultMappers(Collections.singletonMap(Number.class,
        (XQueryResultMapper<Number>)new NumberResultMapper()));
    executor.setXQuery("'4.1'");
    executor.afterPropertiesSet();
    List<Number> result = executor.executeForNumber(MessageBuilder.withPayload("<test/>").build());
    Assert.assertEquals(1, result.size());
    Assert.assertTrue(result.contains(Double.valueOf(4.1)));
View Full Code Here

  @Test
  public void withStringExpression2() {
    XQueryExecutor executor = getExecutor();
    executor.setResultMappers(Collections.singletonMap(Number.class,
        (XQueryResultMapper<Number>)new NumberResultMapper()));
    executor.setXQuery("/person/age/text()");
    executor.afterPropertiesSet();
    List<Number> result = executor.executeForNumber(MessageBuilder.withPayload(xmlString).build());
    Assert.assertEquals(1, result.size());
    Assert.assertTrue(result.contains(Long.valueOf(29)));
View Full Code Here

      mapper.setFormatOutput(formatOutput);
      resultMappers.put(Boolean.class, mapper);
    }

    if(!resultMappers.containsKey(Number.class)) {
      NumberResultMapper mapper = new NumberResultMapper();
      mapper.setFormatOutput(formatOutput);
      resultMappers.put(Number.class, mapper);
    }

    if(!resultMappers.containsKey(Node.class)) {
      NodeResultMapper mapper = new NodeResultMapper();
      mapper.setFormatOutput(formatOutput);
      resultMappers.put(Node.class, mapper);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.integration.xquery.support.NumberResultMapper

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.