made test more robust
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2807 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
014b43a3d7
commit
b91027275f
|
@ -33,7 +33,6 @@ import javax.servlet.ServletContext;
|
|||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.ServletResponseWrapper;
|
||||
import javax.servlet.UnavailableException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
@ -64,7 +63,6 @@ public class PutFilter implements Filter
|
|||
|
||||
Set<String> _operations = new HashSet<String>();
|
||||
private ConcurrentMap<String,String> _hidden = new ConcurrentHashMap<String, String>();
|
||||
private String _options=null;
|
||||
|
||||
private ServletContext _context;
|
||||
private String _baseURI;
|
||||
|
|
|
@ -133,16 +133,25 @@ public class PutFilterTest
|
|||
int l = to_send.length();
|
||||
out.write(to_send.substring(0,l-10).getBytes());
|
||||
out.flush();
|
||||
Thread.sleep(100);
|
||||
out.write(to_send.substring(l-10,l-5).getBytes());
|
||||
out.flush();
|
||||
Thread.sleep(100);
|
||||
|
||||
// test GET
|
||||
request.setMethod("GET");
|
||||
request.setVersion("HTTP/1.0");
|
||||
request.setHeader("Host","tester");
|
||||
request.setURI("/context/file.txt");
|
||||
response.parse(tester.getResponses(request.generate()));
|
||||
|
||||
// loop until the resource is hidden (ie the PUT is starting to
|
||||
// read the file
|
||||
do
|
||||
{
|
||||
Thread.sleep(100);
|
||||
|
||||
// test GET
|
||||
request.setMethod("GET");
|
||||
request.setVersion("HTTP/1.0");
|
||||
request.setHeader("Host","tester");
|
||||
request.setURI("/context/file.txt");
|
||||
response.parse(tester.getResponses(request.generate()));
|
||||
}
|
||||
while(response.getStatus()==200);
|
||||
assertTrue(response.getMethod()==null);
|
||||
assertEquals(HttpServletResponse.SC_NOT_FOUND,response.getStatus());
|
||||
|
||||
|
|
Loading…
Reference in New Issue