INT-2688 Add header-type to xpath-header-enricher
JIRA: https://jira.springsource.org/browse/INT-2688 JIRA: https://jira.springsource.org/browse/INT-3237 Doc Polishing.
This commit is contained in:
committed by
Gary Russell
parent
b817e98a44
commit
16c7ac6134
@@ -16,11 +16,11 @@
|
||||
|
||||
<xpath-header-enricher input-channel="input" output-channel="output">
|
||||
<header name="name" xpath-expression="/person/@name" />
|
||||
<header name="age" xpath-expression="/person/@age" evaluation-type="NUMBER_RESULT" />
|
||||
<header name="age" xpath-expression="/person/@age" evaluation-type="NUMBER_RESULT" header-type="int"/>
|
||||
<header name="married" xpath-expression="/person/@married = 'true'" evaluation-type="BOOLEAN_RESULT" />
|
||||
<header name="node-test" xpath-expression="/person/@age" evaluation-type="NODE_RESULT" />
|
||||
<header name="node-list-test" xpath-expression="/person/@*" evaluation-type="NODE_LIST_RESULT" />
|
||||
<header name="ref-test" xpath-expression-ref="testExpression" evaluation-type="NUMBER_RESULT" />
|
||||
<header name="ref-test" xpath-expression-ref="testExpression" evaluation-type="NUMBER_RESULT" />
|
||||
</xpath-header-enricher>
|
||||
|
||||
<xpath-expression id="testExpression" expression="/person/@age * 2"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,16 +28,18 @@ import org.w3c.dom.Node;
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@@ -65,7 +67,7 @@ public class XPathHeaderEnricherParserTests {
|
||||
@Test
|
||||
public void numberResult() {
|
||||
Message<?> result = this.getResultMessage();
|
||||
assertEquals(new Double(42), result.getHeaders().get("age"));
|
||||
assertEquals(42, result.getHeaders().get("age"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user