• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#*
2
3@test test.vm
4
5This template is used for Velocity regression testing.
6If you alter this template make sure you change the
7corresponding comparison file so that the regression
8test doesn't fail incorrectly.
9
10*#
11
12<html>
13<body>
14
15$name
16
17#if ($customer)
18    $customer.Name
19#end
20
21
22## this is a comment.
23
24#if ($customer)
25    this is the first line
26#end
27
28## This is the test bed.
29
30this is testing for wild loose commas , ,
31
32$100
33
34
35#set($foo = "bar")
36
37This is the $foo way.
38
39#if ($foo)
40    This is $bar.
41#elseif ($bar)
42    This is the first elseif!
43#elseif ($foo)
44    This is the second elseif!
45#else
46    This is the else
47#end
48
49#if ($foo)
50    This is the if.
51#else
52    This is the else.
53#end
54
55
56\#set \$foo = "bar"
57
58\$foo   => $foo
59\$foo;  => $foo;
60\$foo.  => $foo.
61\$foo.. => $foo..
62\$foo/  => $foo/
63\$foo"  => $foo"
64\$foo\  => $foo\
65\$foo<  => $foo<
66\$foo-  => $foo-
67\$fooo+ => $fooo+
68\$foo-x => $foo-x
69\$foo$  => $foo$
70
71
72
73#set($iam_cool = "jon")
74$iam_cool
75$!nada nothing here
76
77function preload(imgObj,imgSrc)
78{
79    if (document.images)
80    {
81        eval(imgObj+' = new Image()')
82        eval(imgObj+'.src = "'+imgSrc+'"')
83    }
84}
85
86function changeImage(layer,imgName,imgObj)
87{
88    if (document.images)
89    {
90        if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
91        else document.images[imgName].src = eval(imgObj+".src")
92    }
93}
94
95#if ($javascript)
96    function changeImage(layer,imgName,imgObj)
97    {
98        if (document.images)
99        {
100            if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
101            else document.images[imgName].src = eval(imgObj+".src")
102        }
103    }
104#end
105
106<!-- This is an HTML comment -->
107
108
109$provider2.Title
110
111#set($a = "x")
112$a
113
114#set($b = $a)
115$b
116
117<input type="text" name="email" value="">
118<input type="text" name="email" value="$!schmarg">
119
120
121#set($c = $provider.Title)
122$c
123
124
125#set($d = $provider.getTitle())
126$d
127
128
129#set($provider.Title = "crocodile hunter!")
130
131
132
133$provider.Title
134
135
136
137<!-- look here -->
138
139#set($provider.Title = $d)
140$provider.Title
141
142
143
144#set($provider.Title = $provider.Name)
145$provider.Title
146
147
148#set($provider.Title = $provider.getName())
149$provider.Title
150
151
152
153#set($a = true)
154
155#set($b = false)
156
157#set($provider.State = true)
158
159#set($provider.State = false)
160
161
162
163#if ($provider.StateTrue)
164    This is a property that returns a boolean
165    value of true.
166#end
167
168#if (true)
169    This expression is always (true).
170#end
171
172
173Foreach with a variable.
174
175#foreach ($element in $list)
176    This is $element.
177#end
178
179Foreach with an array.
180
181<table>
182#foreach ($element in $provider.Array)
183    <tr>
184        <td>This is $element</td>
185    </tr>
186#end
187</table>
188
189
190#foreach ($element in $provider.Vector)
191    This is the $element.
192#end
193
194
195Foreach with a method.
196
197#foreach ($element in $provider.getCustomers())
198    This is $element.
199#end
200
201$10.00
202
203"this is great"
204
205(this is also great)
206
207This is the \#stuff and this
208is the way \#to \#go.
209
210this = that
211
212I am a $provider.getTitle().
213
214#if ($provider.theAPLRules())
215    Yes the APL rules!
216#else
217    It still rules!
218#end
219
220</body>
221</html>
222