1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts2.dojo.views.jsp.ui;
23
24 import org.apache.struts2.dojo.TestAction;
25
26 /***
27 * Test Submit component in "ajax" theme.
28 */
29 public class SubmitAjaxTest extends AbstractUITagTest {
30 public void testSubmit() throws Exception {
31 TestAction testAction = (TestAction) action;
32 testAction.setFoo("bar");
33
34 SubmitTag tag = new SubmitTag();
35 tag.setPageContext(pageContext);
36
37 tag.setId("a");
38 tag.setHref("b");
39 tag.setLoadingText("c");
40 tag.setErrorText("d");
41 tag.setListenTopics("e");
42 tag.setBeforeNotifyTopics("f");
43 tag.setAfterNotifyTopics("g");
44 tag.setHandler("h");
45 tag.setType("submit");
46 tag.setLabel("i");
47 tag.setNotifyTopics("k");
48 tag.setIndicator("l");
49 tag.setShowLoadingText("true");
50 tag.setErrorNotifyTopics("m");
51 tag.setHighlightColor("n");
52 tag.setHighlightDuration("o");
53 tag.setValidate("true");
54 tag.setAjaxAfterValidation("true");
55 tag.setSeparateScripts("true");
56 tag.setTabindex("1");
57 tag.setTransport("p");
58 tag.setParseContent("false");
59 tag.doStartTag();
60 tag.doEndTag();
61
62 verify(SubmitAjaxTest.class.getResource("submit-ajax-1.txt"));
63 }
64
65 public void testButton() throws Exception {
66 TestAction testAction = (TestAction) action;
67 testAction.setFoo("bar");
68
69 SubmitTag tag = new SubmitTag();
70 tag.setPageContext(pageContext);
71
72 tag.setId("a");
73 tag.setTheme("ajax");
74 tag.setHref("b");
75 tag.setLoadingText("c");
76 tag.setErrorText("d");
77 tag.setListenTopics("e");
78 tag.setBeforeNotifyTopics("f");
79 tag.setAfterNotifyTopics("g");
80 tag.setHandler("h");
81 tag.setType("button");
82 tag.setLabel("i");
83 tag.setNotifyTopics("k");
84 tag.setIndicator("l");
85 tag.setErrorNotifyTopics("m");
86 tag.setValidate("true");
87 tag.setSeparateScripts("true");
88 tag.setTabindex("1");
89 tag.doStartTag();
90 tag.doEndTag();
91
92 verify(SubmitAjaxTest.class.getResource("submit-ajax-2.txt"));
93 }
94
95 public void testImage() throws Exception {
96 TestAction testAction = (TestAction) action;
97 testAction.setFoo("bar");
98
99 SubmitTag tag = new SubmitTag();
100 tag.setPageContext(pageContext);
101
102 tag.setId("a");
103 tag.setTheme("ajax");
104 tag.setHref("b");
105 tag.setLoadingText("c");
106 tag.setErrorText("d");
107 tag.setListenTopics("e");
108 tag.setBeforeNotifyTopics("f");
109 tag.setAfterNotifyTopics("g");
110 tag.setHandler("h");
111 tag.setType("image");
112 tag.setLabel("i");
113 tag.setSrc("j");
114 tag.setNotifyTopics("k");
115 tag.setIndicator("l");
116 tag.setErrorNotifyTopics("m");
117 tag.setValidate("true");
118 tag.setSeparateScripts("true");
119 tag.doStartTag();
120 tag.doEndTag();
121
122 verify(SubmitAjaxTest.class.getResource("submit-ajax-3.txt"));
123 }
124 }