reduced verbosity of tests reporting errors
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2064 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
f9640c4116
commit
f16dcd8cad
|
@ -394,7 +394,7 @@ public class HttpConnection implements Connection
|
||||||
_handling=true;
|
_handling=true;
|
||||||
setCurrentConnection(this);
|
setCurrentConnection(this);
|
||||||
|
|
||||||
while (more_in_buffer)
|
while (more_in_buffer && _endp.isOpen())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,14 +33,6 @@ public class LocalConnector extends AbstractConnector
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Not needed anymore, as there is no need to reopen the connector to reset its state
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void reopen()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getResponses(String requests) throws Exception
|
public String getResponses(String requests) throws Exception
|
||||||
{
|
{
|
||||||
return getResponses(requests, false);
|
return getResponses(requests, false);
|
||||||
|
@ -121,7 +113,7 @@ public class LocalConnector extends AbstractConnector
|
||||||
boolean leaveOpen = keepOpen;
|
boolean leaveOpen = keepOpen;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (endPoint.getIn().length() > 0)
|
while (endPoint.getIn().length() > 0 && endPoint.isOpen())
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,8 @@ public class HttpConnectionTest
|
||||||
server = new Server();
|
server = new Server();
|
||||||
connector = new LocalConnector();
|
connector = new LocalConnector();
|
||||||
server.addConnector(connector);
|
server.addConnector(connector);
|
||||||
connector.setHeaderBufferSize(1024);
|
connector.setRequestHeaderSize(1024);
|
||||||
|
connector.setResponseHeaderSize(1024);
|
||||||
server.setHandler(new DumpHandler());
|
server.setHandler(new DumpHandler());
|
||||||
server.start();
|
server.start();
|
||||||
}
|
}
|
||||||
|
@ -491,7 +492,6 @@ public class HttpConnectionTest
|
||||||
response=connector.getResponses("CONNECT www.webtide.com:8080 HTTP/1.1\n"+
|
response=connector.getResponses("CONNECT www.webtide.com:8080 HTTP/1.1\n"+
|
||||||
"Host: myproxy:8888\015\012"+
|
"Host: myproxy:8888\015\012"+
|
||||||
"\015\012");
|
"\015\012");
|
||||||
System.err.println("RESPONSE:"+response);
|
|
||||||
offset = checkContains(response,offset,"HTTP/1.1 200");
|
offset = checkContains(response,offset,"HTTP/1.1 200");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,9 +252,7 @@ public class ServletTest extends TestCase
|
||||||
ByteArrayBuffer out = new ByteArrayBuffer(4096);
|
ByteArrayBuffer out = new ByteArrayBuffer(4096);
|
||||||
out.put(request0.getBytes("iso8859-1"));
|
out.put(request0.getBytes("iso8859-1"));
|
||||||
String responses = tester.getResponses(out).toString();
|
String responses = tester.getResponses(out).toString();
|
||||||
|
|
||||||
System.err.println(responses);
|
|
||||||
|
|
||||||
int offset = responses.indexOf("HTTP/1.1 500");
|
int offset = responses.indexOf("HTTP/1.1 500");
|
||||||
assertTrue(offset>=0);
|
assertTrue(offset>=0);
|
||||||
offset = responses.indexOf("Content-Length: ",offset);
|
offset = responses.indexOf("Content-Length: ",offset);
|
||||||
|
|
|
@ -171,7 +171,16 @@ public abstract class RFC2616BaseTest
|
||||||
|
|
||||||
response = http.request(req1);
|
response = http.request(req1);
|
||||||
response.assertStatus("3.6 Transfer Coding / Bad 400",HttpStatus.BAD_REQUEST_400);
|
response.assertStatus("3.6 Transfer Coding / Bad 400",HttpStatus.BAD_REQUEST_400);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Transfer Codings
|
||||||
|
*
|
||||||
|
* @see <a href="http://tools.ietf.org/html/rfc2616#section-3.6">RFC 2616 (section 3.6)</a>
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void test3_6_2() throws Throwable
|
||||||
|
{
|
||||||
// Chunked
|
// Chunked
|
||||||
StringBuffer req2 = new StringBuffer();
|
StringBuffer req2 = new StringBuffer();
|
||||||
req2.append("GET /echo/R1 HTTP/1.1\n");
|
req2.append("GET /echo/R1 HTTP/1.1\n");
|
||||||
|
@ -215,9 +224,17 @@ public abstract class RFC2616BaseTest
|
||||||
response = responses.get(2); // Response 3
|
response = responses.get(2); // Response 3
|
||||||
response.assertStatusOK("3.6.1 Transfer Codings / Response 3 Code");
|
response.assertStatusOK("3.6.1 Transfer Codings / Response 3 Code");
|
||||||
response.assertNoBody("3.6.1 Transfer Codings / No Body");
|
response.assertNoBody("3.6.1 Transfer Codings / No Body");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Transfer Codings
|
||||||
|
*
|
||||||
|
* @see <a href="http://tools.ietf.org/html/rfc2616#section-3.6">RFC 2616 (section 3.6)</a>
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void test3_6_3() throws Throwable
|
||||||
|
{
|
||||||
// Chunked
|
// Chunked
|
||||||
|
|
||||||
StringBuffer req3 = new StringBuffer();
|
StringBuffer req3 = new StringBuffer();
|
||||||
req3.append("POST /echo/R1 HTTP/1.1\n");
|
req3.append("POST /echo/R1 HTTP/1.1\n");
|
||||||
req3.append("Host: localhost\n");
|
req3.append("Host: localhost\n");
|
||||||
|
@ -261,8 +278,17 @@ public abstract class RFC2616BaseTest
|
||||||
response.assertStatusOK("3.6.1 Transfer Codings / Response 3 Code");
|
response.assertStatusOK("3.6.1 Transfer Codings / Response 3 Code");
|
||||||
response.assertNoBody("3.6.1 Transfer Codings / No Body");
|
response.assertNoBody("3.6.1 Transfer Codings / No Body");
|
||||||
|
|
||||||
// Chunked and keep alive
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Transfer Codings
|
||||||
|
*
|
||||||
|
* @see <a href="http://tools.ietf.org/html/rfc2616#section-3.6">RFC 2616 (section 3.6)</a>
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void test3_6_4() throws Throwable
|
||||||
|
{
|
||||||
|
// Chunked and keep alive
|
||||||
StringBuffer req4 = new StringBuffer();
|
StringBuffer req4 = new StringBuffer();
|
||||||
req4.append("GET /echo/R1 HTTP/1.1\n");
|
req4.append("GET /echo/R1 HTTP/1.1\n");
|
||||||
req4.append("Host: localhost\n");
|
req4.append("Host: localhost\n");
|
||||||
|
|
Loading…
Reference in New Issue