<?xml version="1.0" encoding="UTF-8"?>
<test-data xmlns="http://pmd.sourceforge.net/rule-tests"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests https://pmd.sourceforge.io/rule-tests_1_0_0.xsd">


	<code-fragment id="use-quiet-reference-notation"><![CDATA[
<input type="text" name="email" value="$!email"/>
<input type="text" name="email" value="$!{email}"/>
    ]]>
	</code-fragment>

	<test-code>
		<description>Use quiet reference notation</description>
		<expected-problems>0</expected-problems>
		<code-ref id="use-quiet-reference-notation" />
	</test-code>


	<code-fragment id="not-use-quiet-reference-notation"><![CDATA[
<input type="text" name="email" value="$email"/>
<input type="text" name="email" value="${email}"/>
    ]]>
	</code-fragment>

	<test-code>
		<description>Not use quiet reference notation</description>
		<expected-problems>2</expected-problems>
		<expected-linenumbers>1,2</expected-linenumbers>
		<code-ref id="not-use-quiet-reference-notation" />
	</test-code>

	<code-fragment id="set-directives-is-not-considered"><![CDATA[
#set( $email = "email" )
#set( ${email} = "email" )
#if( $foo )
  <strong>Velocity!</strong>
#end
<ul>
#foreach( $product in $allProducts )
    <li>$product</li>
#end
</ul>
#include( "greetings.txt", $seasonalstock )
    ]]>
	</code-fragment>

	<test-code>
		<description>SetDirectives is not considered</description>
		<expected-problems>1</expected-problems>
		<expected-linenumbers>8</expected-linenumbers>
		<code-ref id="set-directives-is-not-considered" />
	</test-code>


	<code-fragment id="macro-directives-is-not-considered"><![CDATA[
#macro( tablerows $color $somelist )
	#foreach( $something in $somelist )
		<tr><td bgcolor=$color>$something</td></tr>
	#end
#end
    ]]>
	</code-fragment>

	<test-code>
		<description>Macro is not considered</description>
		<expected-problems>0</expected-problems>
		<code-ref id="macro-directives-is-not-considered" />
	</test-code>


	<code-fragment id="reference-in-parentheses-is-not-considered"><![CDATA[
<td >
     $!timezone.toLocal($currentDate,null,"Asia/Shanghai")
</td>
    ]]>
	</code-fragment>

	<test-code>
		<description>Reference in parentheses is not considered</description>
		<expected-problems>0</expected-problems>
		<code-ref id="reference-in-parentheses-is-not-considered" />
	</test-code>
</test-data>
