Adding -Dtest.slow.destroy support to CookieDump to aid in testing of

start.jar -DSTOP.WAIT=360 --stop
This commit is contained in:
Joakim Erdfelt 2012-12-03 13:04:03 -07:00
parent 7c0f7cc8f4
commit 57849a905f
2 changed files with 18 additions and 4 deletions

View File

@ -19,6 +19,7 @@
package com.acme;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.concurrent.TimeUnit;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
@ -121,4 +122,21 @@ public class CookieDump extends HttpServlet
return string;
}
@Override
public void destroy()
{
// For testing --stop with STOP.WAIT handling of the jetty-start behavior.
if (Boolean.getBoolean("test.slow.destroy"))
{
try
{
TimeUnit.SECONDS.sleep(10);
}
catch (InterruptedException e)
{
// ignore
}
}
super.destroy();
}
}

View File

@ -67,8 +67,4 @@ public class HelloWorld extends HttpServlet
getServletContext().log("exception",e);
}
}
}