From: Kai Moritz Date: Tue, 19 Jun 2012 00:33:28 +0000 (+0200) Subject: WIP: Versuch den StaticTest zu reparieren... X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=a1aeed74b19ff960b557dfec1b494da18c79522e;p=percentcodec WIP: Versuch den StaticTest zu reparieren... --- diff --git a/examples/static/pom.xml b/examples/static/pom.xml index 9fe6d115..5cf0634f 100644 --- a/examples/static/pom.xml +++ b/examples/static/pom.xml @@ -19,6 +19,7 @@ org.apache.commons commons-io ${commons-io.version} + test 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 index 6dff5ff8..00000000 --- a/examples/static/src/main/java/de/halbekunst/cachecontrol/examples/SimpleDefaultServlet.java +++ /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()); - } -} diff --git a/examples/static/src/main/webapp/WEB-INF/web.xml b/examples/static/src/main/webapp/WEB-INF/web.xml index 89bf5915..d2fcb570 100644 --- a/examples/static/src/main/webapp/WEB-INF/web.xml +++ b/examples/static/src/main/webapp/WEB-INF/web.xml @@ -48,7 +48,7 @@ default - de.halbekunst.cachecontrol.examples.SimpleDefaultServlet + org.eclipse.jetty.servlet.DefaultServlet 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 index 00000000..0173a1fc --- /dev/null +++ b/examples/static/src/test/java/org/eclipse/jetty/servlet/DefaultServlet.java @@ -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 index 4378a128..00000000 --- a/examples/static/tomcat.sh +++ /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