WIP: Versuch den StaticTest zu reparieren...
authorKai Moritz <kai@coolibri.de>
Tue, 19 Jun 2012 00:33:28 +0000 (02:33 +0200)
committerKai Moritz <kai@coolibri.de>
Thu, 2 Aug 2012 07:03:26 +0000 (09:03 +0200)
examples/static/pom.xml
examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java [deleted file]
examples/static/src/main/webapp/WEB-INF/web.xml
examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java [new file with mode: 0644]
examples/static/tomcat.sh [deleted file]

index 9fe6d11..5cf0634 100644 (file)
@@ -19,6 +19,7 @@
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-io</artifactId>
       <version>${commons-io.version}</version>
+      <scope>test</scope>
     </dependency>
   </dependencies>
 
diff --git a/examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java b/examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java
deleted file mode 100644 (file)
index 6dff5ff..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-package de.halbekunst.cachecontrol.examples;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.io.IOUtils;
-
-/**
- * Möglichst simple Fake-Implementierung für die Ausführung des Testfalls
- *
- * @author kai
- */
-public class SimpleDefaultServlet extends HttpServlet {
-
-  @Override
-  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-    String path = getServletContext().getRealPath(request.getRequestURI());
-    if (path == null) {
-      response.sendError(HttpServletResponse.SC_NOT_FOUND);
-      return;
-    }
-    IOUtils.copy(new FileInputStream(path), response.getOutputStream());
-  }
-}
index 89bf591..d2fcb57 100644 (file)
@@ -48,7 +48,7 @@
 
   <servlet>
     <servlet-name>default</servlet-name>
-    <servlet-class>de.halbekunst.cachecontrol.examples.SimpleDefaultServlet</servlet-class>
+    <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
   </servlet>
 
 
diff --git a/examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java b/examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java
new file mode 100644 (file)
index 0000000..0173a1f
--- /dev/null
@@ -0,0 +1,28 @@
+package org.eclipse.jetty.servlet;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.io.IOUtils;
+
+/**
+ * Möglichst simple Fake-Implementierung für die Ausführung des Testfalls
+ *
+ * @author kai
+ */
+public class DefaultServlet extends HttpServlet {
+
+  @Override
+  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+    String path = getServletContext().getRealPath(request.getRequestURI());
+    if (path == null) {
+      response.sendError(HttpServletResponse.SC_NOT_FOUND);
+      return;
+    }
+    response.setContentType("text/html");
+    IOUtils.copy(new FileInputStream(path), response.getOutputStream());
+  }
+}
diff --git a/examples/static/tomcat.sh b/examples/static/tomcat.sh
deleted file mode 100755 (executable)
index 4378a12..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-#
-
-# OutOfMemoryException beim "mvn jetty:run" umgehen und
-# Parameter zum nachträglichen anhängen eines Debuggers
-# setzen
-export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m -XX:-UseGCOverheadLimit -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n"
-
-rm -v src/main/webapp/WEB-INF/lib/juplo*
-
-mvn tomcat:run-war