Adding -Dtest.slow.destroy support to CookieDump to aid in testing of
start.jar -DSTOP.WAIT=360 --stop
This commit is contained in:
parent
7c0f7cc8f4
commit
57849a905f
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,4 @@ public class HelloWorld extends HttpServlet
|
|||
getServletContext().log("exception",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue