1 package org.apache.turbine; 2 3 56 57 import junit.framework.Test; 58 import junit.framework.TestCase; 59 import junit.framework.TestSuite; 60 61 import com.meterware.httpunit.WebTable; 62 import com.meterware.httpunit.WebResponse; 63 64 import org.apache.cactus.ServletTestCase; 65 import org.apache.cactus.WebRequest; 66 67 75 public class JspServletTest 76 extends ServletTestCase 77 { 78 81 Turbine turbine; 82 83 86 public JspServletTest(String name) 87 { 88 super(name); 89 } 90 91 94 public static Test suite() 95 { 96 return new TestSuite(JspServletTest.class); 97 } 98 99 104 protected void setUp() 105 throws Exception 106 { 107 super.setUp(); 108 config.setInitParameter("properties", 109 "/WEB-INF/conf/JspTRP.properties"); 110 turbine = new Turbine(); 111 turbine.init(config); 112 } 113 114 117 protected void tearDown() 118 throws Exception 119 { 120 turbine.destroy(); 121 super.tearDown(); 122 } 123 124 128 public void beginHomepage(WebRequest theRequest) 129 { 130 theRequest.setURL(null, "/test", "/servlet/test", null, null); 131 } 132 133 137 public void testHomepage() 138 throws Exception 139 { 140 turbine.doGet(request, response); 141 } 142 143 146 public void endHomepage(WebResponse theResponse) 147 throws Exception 148 { 149 assertEquals("Test Application JSP Page", theResponse.getTitle()); 150 } 151 } 152 | Popular Tags |