Statische Test-Datei (eine CSS-Datei) zu den Test-Beispielen hinzugefĆ¼gt
authorKai Moritz <kai@coolibri.de>
Fri, 1 Jun 2012 23:31:59 +0000 (01:31 +0200)
committerKai Moritz <kai@coolibri.de>
Thu, 2 Aug 2012 07:03:26 +0000 (09:03 +0200)
cachecontrol-example-jsp/src/main/webapp/WEB-INF/web.xml
cachecontrol-example-jsp/src/main/webapp/default.css [new file with mode: 0644]
cachecontrol-example-jsp/src/main/webapp/page-with-include.jsp
cachecontrol-example-jsp/src/main/webapp/simple-page.jsp
cachecontrol-example-jsp/src/test/java/de/halbekunst/cachecontrol/examples/jsp/JspTest.java

index f454b87..6080872 100644 (file)
@@ -32,6 +32,9 @@
     <filter-name>accelerator</filter-name>
     <url-pattern>*.jsp</url-pattern>
   </filter-mapping>
-
+  <filter-mapping>
+    <filter-name>accelerator</filter-name>
+    <url-pattern>*.css</url-pattern>
+  </filter-mapping>
 
 </web-app>
diff --git a/cachecontrol-example-jsp/src/main/webapp/default.css b/cachecontrol-example-jsp/src/main/webapp/default.css
new file mode 100644 (file)
index 0000000..e04bba2
--- /dev/null
@@ -0,0 +1,7 @@
+body {
+  background-color: #ccc;
+  color: #444;
+}
+h1,h2,h3,h4 {
+  color: #000;
+}
\ No newline at end of file
index 3347af7..ba581a4 100644 (file)
@@ -6,6 +6,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Page with include</title>
+    <link rel="stylesheet" type="text/css" media="all" href="/default.css">
   </head>
   <body>
     <h1>Hello World!</h1>
index 23e5779..880d761 100644 (file)
@@ -5,6 +5,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Simple Page</title>
+    <link rel="stylesheet" type="text/css" media="all" href="/default.css">
   </head>
   <body>
     <h1>Hello World!</h1>
index 26225ab..9861068 100644 (file)
@@ -2,7 +2,6 @@ package de.halbekunst.cachecontrol.examples.jsp;
 
 import de.halbekunst.juplo.test.HttpTestCase;
 import com.meterware.httpunit.WebResponse;
-import com.meterware.servletunit.InvocationContext;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,4 +40,11 @@ public class JspTest extends HttpTestCase {
     log.info("Title:\t\t{}", response.getTitle());
     log.debug("Text:\t\t{}", response.getText());
   }
+
+  @Test
+  public void testStaticContent() throws Exception {
+    WebResponse response = executeRequest("http://localhost:8080/default.css");
+    log.info("Title:\t\t{}", response.getTitle());
+    log.debug("Text:\t\t{}", response.getText());
+  }
 }