Modul mit Beispiel-Konfigurationen ├╝berarbeitet. Jetzt: 1 Modul pro Test
[percentcodec] / cachecontrol-example-jsp / src / test / java / de / halbekunst / cachecontrol / examples / jsp / JspTest.java
1 package de.halbekunst.cachecontrol.examples.jsp;
2
3 import de.halbekunst.juplo.test.HttpTestCase;
4 import com.meterware.httpunit.WebResponse;
5 import com.meterware.servletunit.InvocationContext;
6 import org.junit.Test;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9
10 /**
11  *
12  * @author kai
13  */
14 public class JspTest extends HttpTestCase {
15
16   private static final Logger log = LoggerFactory.getLogger(JspTest.class);
17
18
19   public JspTest() {
20     super("src/main/webapp/WEB-INF/web.xml");
21   }
22
23
24   @Test
25   public void testSimplePage() throws Exception {
26     WebResponse response = executeRequest("http://localhost:8080/simple-page.jsp");
27     log.info("Title:\t\t{}", response.getTitle());
28     log.debug("Text:\t\t{}", response.getText());
29   }
30
31   @Test
32   public void testPageWithInclude() throws Exception {
33     WebResponse response = executeRequest("http://localhost:8080/page-with-include.jsp");
34     log.info("Title:\t\t{}", response.getTitle());
35     log.debug("Text:\t\t{}", response.getText());
36   }
37
38   @Test
39   public void testPageWithForward() throws Exception {
40     WebResponse response = executeRequest("http://localhost:8080/page-with-forward.jsp");
41     log.info("Title:\t\t{}", response.getTitle());
42     log.debug("Text:\t\t{}", response.getText());
43   }
44 }