KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > ui > SubmitTest


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.jsp.ui;
6
7 import com.opensymphony.webwork.TestAction;
8 import com.opensymphony.webwork.views.jsp.AbstractUITagTest;
9
10
11 /**
12  * User: plightbo
13  * Date: Oct 16, 2003
14  * Time: 10:52:57 PM
15  */

16 public class SubmitTest extends AbstractUITagTest {
17     //~ Methods ////////////////////////////////////////////////////////////////
18

19     public void testDefaultValues() throws Exception JavaDoc {
20         TestAction testAction = (TestAction) action;
21         testAction.setFoo("bar");
22
23         SubmitTag tag = new SubmitTag();
24         tag.setPageContext(pageContext);
25         tag.setLabel("mylabel");
26         tag.setName("myname");
27
28         tag.doStartTag();
29         tag.doEndTag();
30
31         verify(TextFieldTag.class.getResource("Submit-2.txt"));
32     }
33
34     public void testSimple() throws Exception JavaDoc {
35         TestAction testAction = (TestAction) action;
36         testAction.setFoo("bar");
37
38         SubmitTag tag = new SubmitTag();
39         tag.setPageContext(pageContext);
40         tag.setLabel("mylabel");
41         tag.setAlign("left");
42         tag.setName("myname");
43         tag.setValue("%{foo}");
44
45         tag.doStartTag();
46         tag.doEndTag();
47
48         verify(TextFieldTag.class.getResource("Submit-1.txt"));
49     }
50 }
51
Popular Tags