398467 Servlet 3.1 Non Blocking IO

some cleanup/fixes of SPDY tests.  More work needed
This commit is contained in:
Greg Wilkins 2013-05-25 17:07:30 +10:00
parent c7be106423
commit 288a452881
2 changed files with 9 additions and 32 deletions

View File

@ -1615,8 +1615,10 @@ public class Request implements HttpServletRequest
Object old_value = _attributes == null?null:_attributes.getAttribute(name);
if ("org.eclipse.jetty.server.Request.queryEncoding".equals(name))
setQueryEncoding(value == null?null:value.toString());
setQueryEncoding(value == null?null:value.toString());
else if ("org.eclipse.jetty.server.sendContent".equals(name))
LOG.warn("Deprecated: org.eclipse.jetty.server.sendContent");
if (_attributes == null)
_attributes = new AttributesMap();
_attributes.setAttribute(name,value);

View File

@ -18,7 +18,6 @@
package org.eclipse.jetty.spdy.server.http;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -51,7 +50,6 @@ import org.eclipse.jetty.spdy.api.SynInfo;
import org.eclipse.jetty.util.Fields;
import org.eclipse.jetty.util.log.StdErrLog;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
public class ServerHTTPSPDYTest extends AbstractHTTPSPDYTest
@ -874,32 +872,12 @@ public class ServerHTTPSPDYTest extends AbstractHTTPSPDYTest
Assert.assertTrue(replyLatch.await(5, TimeUnit.SECONDS));
Assert.assertTrue(dataLatch.await(5, TimeUnit.SECONDS));
}
@Ignore("The correspondent functionality in HttpOutput is not yet implemented")
@Test
public void testGETWithMediumContentAsInputStreamByPassed() throws Exception
{
byte[] data = new byte[2048];
testGETWithContentByPassed(new ByteArrayInputStream(data), data.length);
}
@Ignore("The correspondent functionality in HttpOutput is not yet implemented")
@Test
public void testGETWithBigContentAsInputStreamByPassed() throws Exception
{
byte[] data = new byte[128 * 1024];
testGETWithContentByPassed(new ByteArrayInputStream(data), data.length);
}
@Test
public void testGETWithMediumContentAsBufferByPassed() throws Exception
{
byte[] data = new byte[2048];
testGETWithContentByPassed(ByteBuffer.wrap(data), data.length);
}
private void testGETWithContentByPassed(final Object content, final int length) throws Exception
{
final byte[] data = new byte[2048];
final CountDownLatch handlerLatch = new CountDownLatch(1);
Session session = startClient(version, startHTTPServer(version, new AbstractHandler()
{
@ -908,10 +886,7 @@ public class ServerHTTPSPDYTest extends AbstractHTTPSPDYTest
throws IOException, ServletException
{
request.setHandled(true);
// We use this trick that's present in Jetty code: if we add a request attribute
// called "org.eclipse.jetty.server.sendContent", then it will trigger the
// content bypass that we want to test
request.setAttribute("org.eclipse.jetty.server.sendContent", content);
request.getResponse().getHttpOutput().sendContent(ByteBuffer.wrap(data));
handlerLatch.countDown();
}
}), null);
@ -940,7 +915,7 @@ public class ServerHTTPSPDYTest extends AbstractHTTPSPDYTest
contentLength.addAndGet(dataInfo.asBytes(true).length);
if (dataInfo.isClose())
{
Assert.assertEquals(length, contentLength.get());
Assert.assertEquals(data.length, contentLength.get());
dataLatch.countDown();
}
}