1 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 16 public class SubmitTest extends AbstractUITagTest { 17 19 public void testDefaultValues() throws Exception { 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 { 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 |