1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.struts2.components;
19
20 import java.util.List;
21
22 import org.apache.struts2.TestAction;
23 import org.apache.struts2.views.jsp.AbstractUITagTest;
24
25 import com.opensymphony.xwork2.validator.validators.RequiredFieldValidator;
26
27 /***
28 * <code>FormTest</code>
29 *
30 */
31 public class FormTest extends AbstractUITagTest {
32
33
34 public void testTestFormGetValidators() {
35 Form form = new Form(stack, request, response);
36 form.getParameters().put("actionClass", TestAction.class);
37 List v = form.getValidators("foo");
38 assertEquals(1, v.size());
39 assertEquals(RequiredFieldValidator.class, v.get(0).getClass());
40 }
41 }