aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-07-16 09:39:39 (EDT)
committerThomas Becker2013-07-16 09:39:39 (EDT)
commit7d9803972e638b466742e45b28116fe843e2bf67 (patch)
tree996cf5e0e55f68e14252b5abfab9f636d8165a0a
parentb858f266d68440f201fa170f12a4f6ce4c8491fe (diff)
downloadorg.eclipse.jetty.project-7d9803972e638b466742e45b28116fe843e2bf67.zip
org.eclipse.jetty.project-7d9803972e638b466742e45b28116fe843e2bf67.tar.gz
org.eclipse.jetty.project-7d9803972e638b466742e45b28116fe843e2bf67.tar.bz2
413066 fix HttpTransportOverSPDYTest
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java6
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java18
-rw-r--r--jetty-spdy/spdy-http-server/src/test/resources/jetty-logging.properties2
3 files changed, 14 insertions, 12 deletions
diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
index 036df04..4c3a7c2 100644
--- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
+++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDY.java
@@ -118,9 +118,9 @@ public class HttpTransportOverSPDY implements HttpTransport
// info!=null content!=null lastContent==true reply, commit with content and complete
short version = stream.getSession().getVersion();
- boolean hasContent = BufferUtil.hasContent(content) && HttpMethod.HEAD.name().equals(requestHeaders.get
- (HTTPSPDYHeader
- .METHOD.name(version)));
+ boolean isHeadRequest = HttpMethod.HEAD.name().equals(requestHeaders.get(HTTPSPDYHeader.METHOD.name(version))
+ .value());
+ boolean hasContent = BufferUtil.hasContent(content) && !isHeadRequest;
if (info != null)
{
diff --git a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java
index e8d76c7..3213757 100644
--- a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java
+++ b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/HttpTransportOverSPDYTest.java
@@ -18,13 +18,6 @@
package org.eclipse.jetty.spdy.server.http;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Random;
@@ -52,6 +45,13 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
@RunWith(MockitoJUnitRunner.class)
public class HttpTransportOverSPDYTest
{
@@ -79,8 +79,10 @@ public class HttpTransportOverSPDYTest
@Before
public void setUp() throws Exception
{
+ Fields requestHeaders = new Fields();
+ requestHeaders.add(HTTPSPDYHeader.METHOD.name(SPDY.V3),"GET");
httpTransportOverSPDY = new HttpTransportOverSPDY(connector, httpConfiguration, endPoint, pushStrategy,
- stream, new Fields());
+ stream, requestHeaders);
when(responseInfo.getStatus()).thenReturn(HttpStatus.OK_200);
when(stream.getSession()).thenReturn(session);
when(session.getVersion()).thenReturn(SPDY.V3);
diff --git a/jetty-spdy/spdy-http-server/src/test/resources/jetty-logging.properties b/jetty-spdy/spdy-http-server/src/test/resources/jetty-logging.properties
index 30da0a8..88ca97c 100644
--- a/jetty-spdy/spdy-http-server/src/test/resources/jetty-logging.properties
+++ b/jetty-spdy/spdy-http-server/src/test/resources/jetty-logging.properties
@@ -4,5 +4,5 @@ org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
#org.eclipse.jetty.io.ssl.LEVEL=DEBUG
#org.eclipse.jetty.spdy.LEVEL=DEBUG
#org.eclipse.jetty.client.LEVEL=DEBUG
-#org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy.LEVEL=DEBUG
+org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy.LEVEL=DEBUG
#org.mortbay.LEVEL=DEBUG