improved test harness timing

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2538 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2010-11-19 00:25:32 +00:00
parent 26e82ad779
commit 835751c2ef
5 changed files with 21 additions and 11 deletions

View File

@ -278,6 +278,11 @@ public class HttpExchangeTest extends TestCase
throwable.set(x);
}
@Override
protected void onConnectionFailed(Throwable x)
{
throwable.set(x);
}
};
httpExchange.setURL(_scheme+"localhost:"+_port+"/");
httpExchange.setMethod("SLEEP");
@ -288,7 +293,7 @@ public class HttpExchangeTest extends TestCase
public void run()
{
try {
Thread.sleep(250);
Thread.sleep(500);
_httpClient.stop();
} catch(Exception e) {e.printStackTrace();}
}
@ -522,7 +527,7 @@ public class HttpExchangeTest extends TestCase
}
else if (request.getMethod().equalsIgnoreCase("SLEEP"))
{
Thread.sleep(1000);
Thread.sleep(10000);
}
else
{

View File

@ -67,7 +67,7 @@ public class TestJettyOSGiBootCore
{
return Arrays.asList(options(
//get the jetty home config from the osgi boot bundle.
PaxRunnerOptions.vmOptions("-D" + DefaultJettyAtJettyHomeHelper.SYS_PROP_JETTY_HOME_BUNDLE + "=org.eclipse.jetty.osgi.boot -Djetty.port=9876"),
PaxRunnerOptions.vmOptions("-Djetty.port=9876 -D" + DefaultJettyAtJettyHomeHelper.SYS_PROP_JETTY_HOME_BUNDLE + "=org.eclipse.jetty.osgi.boot"),
// CoreOptions.equinox(),

View File

@ -67,9 +67,8 @@ public class TestJettyOSGiBootWithJsp
// this just adds all what you write here to java vm argumenents of the (new) osgi process.
// PaxRunnerOptions.vmOption( "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006" ),
PaxRunnerOptions.vmOption("-D" + OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS +
"=etc/jetty.xml;" + testrealm.getAbsolutePath()+
" -Djetty.port=9876"),
PaxRunnerOptions.vmOption("-Djetty.port=9876 -D" + OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS +
"=etc/jetty.xml;" + testrealm.getAbsolutePath()),
mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot" ).versionAsInProject(),
mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot-jsp" ).versionAsInProject(),

View File

@ -57,6 +57,7 @@ public abstract class ConnectorTimeoutTest extends HttpServerTestFixture
"content-length: "+contentB.length+"\r\n"+
"\r\n").getBytes("utf-8"));
os.write(contentB);
os.flush();
long start = System.currentTimeMillis();
String in = IO.toString(is);

View File

@ -101,6 +101,8 @@ import org.eclipse.jetty.util.resource.ResourceFactory;
* servlet context root. Useful for only serving static content out
* of only specific subdirectories.
*
* pathInfoOnly If true, only the path info will be applied to the resourceBase
*
* stylesheet Set with the location of an optional stylesheet that will be used
* to decorate the directory listing html.
*
@ -135,10 +137,11 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
private boolean _acceptRanges=true;
private boolean _dirAllowed=true;
private boolean _welcomeServlets=true;
private boolean _welcomeServlets=false;
private boolean _welcomeExactServlets=false;
private boolean _redirectWelcome=false;
private boolean _gzip=true;
private boolean _pathInfoOnly=false;
private Resource _resourceBase;
private ResourceCache _cache;
@ -175,6 +178,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
_dirAllowed=getInitBoolean("dirAllowed",_dirAllowed);
_redirectWelcome=getInitBoolean("redirectWelcome",_redirectWelcome);
_gzip=getInitBoolean("gzip",_gzip);
_pathInfoOnly=getInitBoolean("pathInfoOnly",_pathInfoOnly);
if ("exact".equals(getInitParameter("welcomeServlets")))
{
@ -384,7 +388,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
reqRanges = null;
}
String pathInContext=URIUtil.addPaths(servletPath,pathInfo);
String pathInContext=_pathInfoOnly?pathInfo:URIUtil.addPaths(servletPath,pathInfo);
boolean endsWithSlash=pathInContext.endsWith(URIUtil.SLASH);
// Can we gzip this request?
@ -503,6 +507,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
// else look for a welcome file
else if (null!=(welcome=getWelcomeFile(pathInContext)))
{
Log.debug("welcome={}",welcome);
if (_redirectWelcome)
{
// Redirect to the index