1 18 19 package org.apache.strutsel.taglib.html; 20 21 import javax.servlet.ServletException ; 22 import javax.servlet.http.HttpServletResponse ; 23 import javax.servlet.jsp.JspException ; 24 import junit.framework.Test; 25 import junit.framework.TestSuite; 26 import org.apache.strutsel.taglib.utils.JspTagTestCase; 27 28 29 public class TestELFrameTag 30 extends JspTagTestCase { 31 32 private static final String FORWARD_VALUE = "stuff"; 33 private static final String PATH_VALUE = "/stuff"; 34 35 protected ELFrameTag elFrameTag = null; 36 37 public TestELFrameTag(String theName) { 38 super(theName); 39 } 40 41 public static void main(String [] args) { 42 junit.awtui.TestRunner. 43 main(new String [] { TestELFrameTag.class.getName() }); 44 } 45 46 public static Test suite() { 47 return new TestSuite(TestELFrameTag.class); 48 } 49 50 public void setUp() { 51 elFrameTag = new ELFrameTag(); 52 elFrameTag.setPageContext(pageContext); 53 } 54 55 public void tearDown() { 56 elFrameTag = null; 57 } 58 59 63 public void testPlain() 64 throws ServletException , JspException { 65 HttpServletResponse response = 66 (HttpServletResponse )pageContext.getResponse(); 67 68 boolean gotCorrectException = false; 69 70 try { 71 int startTagReturn = elFrameTag.doStartTag(); 72 } catch (JspException ex) { 73 gotCorrectException = true; 75 } catch (Exception ex) { 76 fail(); 77 } 78 79 if (!gotCorrectException) 80 fail(); 81 } 82 83 89 93 95 98 103 105 108 113 117 } 125 | Popular Tags |