improved test harness - removed arbitrary waits

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2514 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2010-11-16 13:38:51 +00:00
parent 52ac3598f8
commit ff2239a2ba
1 changed files with 14 additions and 4 deletions

View File

@ -237,10 +237,20 @@ public abstract class ContinuationBase extends TestCase
request+="Content-Length: "+content.length()+"\r\n";
request+="\r\n" + content;
Socket socket = new Socket("localhost",_port);
int port=_port;
String response=null;
try
{
Socket socket = new Socket("localhost",port);
socket.getOutputStream().write(request.getBytes("UTF-8"));
String response = toString(socket.getInputStream());
response = toString(socket.getInputStream());
}
catch(Exception e)
{
System.err.println("failed on port "+port);
throw e;
}
return response;
}