Skip to content

Instantly share code, notes, and snippets.

@matthew-wilson
Created February 11, 2015 10:45
Show Gist options
  • Save matthew-wilson/f2753850ff6362d55483 to your computer and use it in GitHub Desktop.
Save matthew-wilson/f2753850ff6362d55483 to your computer and use it in GitHub Desktop.
Test XML
<?xml version="1.0" encoding="UTF-8"?>
<spring:beans xmlns="http://www.citrusframework.org/schema/testcase"
xmlns:jms="http://www.citrusframework.org/schema/jms/testcase"
xmlns:ws="http://www.citrusframework.org/schema/ws/testcase"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.citrusframework.org/schema/jms/testcase http://www.citrusframework.org/schema/jms/testcase/citrus-jms-testcase.xsd
http://www.citrusframework.org/schema/ws/testcase http://www.citrusframework.org/schema/ws/testcase/citrus-ws-testcase.xsd
http://www.citrusframework.org/schema/testcase http://www.citrusframework.org/schema/testcase/citrus-testcase.xsd">
<template name="echo">
<echo><message>echo text1=${text1} text2=${text2}</message></echo>
<java class="com.citrus.samples.Echo">
<method name="echo">
<argument type="String">${text1}</argument>
<argument type="String[]">TEST MESSAGE,${text2}</argument>
</method>
</java>
</template>
<testcase name="TemplateParameterTest">
<actions>
<call-template name="echo">
<parameter name="text1" value="first call"/>
<parameter name="text2" value="100,${citrus.test.name}"/>
</call-template>
<call-template name="echo">
<parameter name="text1" value="second call"/>
<parameter name="text2" value="200,SUBSEQUENT CALL"/>
</call-template>
</actions>
</testcase>
</spring:beans>
Java class:
package com.citrus.samples;
import java.util.Arrays;
public class Echo {
public void echo (String arg1, String... args)
{
System.out.println ("Called echo [" + arg1 + "][" + Arrays.toString(args) + "]");
System.out.println(arg1);
System.out.println(Arrays.toString(args));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment