# HG changeset patch
# User František Kučera <franta-hg@frantovo.cz>
# Date 1409848922 -7200
# Node ID bb0aa5d23f2e872eabd185a7af51ccf1e803c163
# Parent  4ba54a632eb85094e97fbbceb9a3303de4644afb
out-xpath: unit test – parameter types

diff -r 4ba54a632eb8 -r bb0aa5d23f2e java/alt2xml-out-xpath/test/cz/frantovo/alt2xml/out/xpath/XPathActionNGTest.java
--- a/java/alt2xml-out-xpath/test/cz/frantovo/alt2xml/out/xpath/XPathActionNGTest.java	Thu Sep 04 18:33:34 2014 +0200
+++ b/java/alt2xml-out-xpath/test/cz/frantovo/alt2xml/out/xpath/XPathActionNGTest.java	Thu Sep 04 18:42:02 2014 +0200
@@ -46,11 +46,11 @@
 		documentBuilder = documentBuilderFactory.newDocumentBuilder();
 	}
 
-	private DOMResult generateEmptyResult() {
+	private DOMResult makeEmptyResult() {
 		return new DOMResult(documentBuilder.newDocument());
 	}
 
-	private static byte[] generateStringResult(String value) {
+	private static byte[] makeStringResult(String value) {
 		return (value + "\n").getBytes();
 	}
 
@@ -65,18 +65,55 @@
 	public void testRun_simple() throws Exception {
 		actionData.add("1+1");
 
-		doTest(generateEmptyResult(), actionData, actionProperties, generateStringResult("2"));
+		doTest(makeEmptyResult(), actionData, actionProperties, makeStringResult("2"));
+	}
+
+	private void setTyped(Boolean typed) {
+		actionProperties.put(XPathAction.PARAMETER_TYPED_PARAMETERS, typed.toString());
 	}
 
 	@Test
 	public void testRun_simpleParameters() throws Exception {
-		actionProperties.put(XPathAction.PARAMETER_TYPED_PARAMETERS, Boolean.FALSE);
+		setTyped(false);
 
 		actionData.add("1+$a");
+
 		actionData.add("a");
 		actionData.add("2");
 
-		doTest(generateEmptyResult(), actionData, actionProperties, generateStringResult("3"));
+		doTest(makeEmptyResult(), actionData, actionProperties, makeStringResult("3"));
+	}
+
+	@Test
+	public void testRun_simpleMoreParameters() throws Exception {
+		setTyped(false);
+
+		actionData.add("$a+$b");
+
+		actionData.add("a");
+		actionData.add("2");
+
+		actionData.add("b");
+		actionData.add("4");
+
+		doTest(makeEmptyResult(), actionData, actionProperties, makeStringResult("6"));
+	}
+
+	@Test
+	public void testRun_simpleTypedParameters() throws Exception {
+		setTyped(true);
+
+		actionData.add("$a+$b");
+
+		actionData.add("a");
+		actionData.add("InteGER");
+		actionData.add("4");
+
+		actionData.add("b");
+		actionData.add("integeR");
+		actionData.add("4");
+
+		doTest(makeEmptyResult(), actionData, actionProperties, makeStringResult("8"));
 	}
 
 	private void doTest(DOMResult domResult, List<String> actionData, Properties actionProperties, byte[] expectedResult) throws Exception {