use of org.apache.camel.component.sql.stored.template.ast.Template in project camel by apache.
the class ParserTest method vendorSpecificNegativeSqlType.
@Test
public void vendorSpecificNegativeSqlType() {
Template template = parser.parseTemplate("ADDNUMBERS2(-1342 ${header.foo})");
assertEquals(-1342, ((InputParameter) template.getParameterList().get(0)).getSqlType());
}
use of org.apache.camel.component.sql.stored.template.ast.Template in project camel by apache.
the class ParserTest method vendorSpecificPositiveSqlTypeOut.
@Test
public void vendorSpecificPositiveSqlTypeOut() {
Template template = parser.parseTemplate("ADDNUMBERS2(OUT 1342 h1)");
assertEquals(1342, ((OutParameter) template.getParameterList().get(0)).getSqlType());
}
use of org.apache.camel.component.sql.stored.template.ast.Template in project camel by apache.
the class ParserTest method nestedSimpleExpression.
@Test
public void nestedSimpleExpression() {
Exchange exchange = createExchangeWithBody(1);
exchange.getIn().setHeader("foo", 1);
exchange.getIn().setHeader("bar", 3);
Template template = parser.parseTemplate("ADDNUMBERS2(INTEGER ${header.foo},INTEGER ${header.bar})");
assertEquals(1, ((InputParameter) template.getParameterList().get(0)).getValueExtractor().eval(exchange, null));
assertEquals(3, ((InputParameter) template.getParameterList().get(1)).getValueExtractor().eval(exchange, null));
}
Aggregations