camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samruben <>
Subject Expression Language exchange test
Date Wed, 11 Apr 2012 16:41:09 GMT

I need to test whether the predicate object matches the exchange for various
expression languages. I need to know what exchange value I need to set in
exchange to validate the predicate. 

public void test() {
                String expression="//orders/value>10"';
		CamelContext context = new DefaultCamelContext();
		Predicate predicate=new JXpathExpression(expression,boolean.class);
		Exchange exchange = new DefaultExchange(context);
		Message in = exchange.getIn();
                in.setBody(""); // how i need to set the message in exchange
in order to evaluate it against pre
                boolean check=predicate.matches(exchange); 

for Jxpath : the predicate object contains JXpath[//orders/value>10], how i
need to set the exchange in order to evaluate this expression.

Thank you

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message