Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGreg Wilkins2013-11-01 03:45:16 +0000
committerGreg Wilkins2013-11-01 03:45:16 +0000
commit852be79a3c17fc86e434b1f65108cb902f6030ca (patch)
treeadc801cfdf39404c82c5325b6df255cea0975df6 /tests
parent37ea88d299b1220dff4902b46500415046e962cc (diff)
parent56fcfa45fb642825db38b8197467a63ee2aeffd6 (diff)
downloadorg.eclipse.jetty.project-852be79a3c17fc86e434b1f65108cb902f6030ca.tar.gz
org.eclipse.jetty.project-852be79a3c17fc86e434b1f65108cb902f6030ca.tar.xz
org.eclipse.jetty.project-852be79a3c17fc86e434b1f65108cb902f6030ca.zip
Merge remote-tracking branch 'origin/master' into jetty-9.1
Conflicts: jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java
Diffstat (limited to 'tests')
-rw-r--r--tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java16
-rw-r--r--tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java3
2 files changed, 10 insertions, 9 deletions
diff --git a/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java b/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java
index 51e26b1eaf..9a97fef747 100644
--- a/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java
+++ b/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java
@@ -239,9 +239,8 @@ public abstract class ContinuationBase
int port=_port;
String response=null;
- try
+ try (Socket socket = new Socket("localhost",port);)
{
- Socket socket = new Socket("localhost",port);
socket.setSoTimeout(10000);
socket.getOutputStream().write(request.getBytes("UTF-8"));
socket.getOutputStream().flush();
@@ -269,6 +268,7 @@ public abstract class ContinuationBase
{}
/* ------------------------------------------------------------ */
+ @Override
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
{
final Continuation continuation = ContinuationSupport.getContinuation(request);
@@ -306,7 +306,7 @@ public abstract class ContinuationBase
if (continuation.isInitial())
{
- ((HttpServletResponse)response).addHeader("history","initial");
+ response.addHeader("history","initial");
if (read_before>0)
{
byte[] buf=new byte[read_before];
@@ -325,7 +325,7 @@ public abstract class ContinuationBase
if (suspend_for>0)
continuation.setTimeout(suspend_for);
continuation.addContinuationListener(__listener);
- ((HttpServletResponse)response).addHeader("history","suspend");
+ response.addHeader("history","suspend");
continuation.suspend(response);
if (complete_after>0)
@@ -404,7 +404,7 @@ public abstract class ContinuationBase
}
else
{
- ((HttpServletResponse)response).addHeader("history","!initial");
+ response.addHeader("history","!initial");
if (suspend2_for>=0 && request.getAttribute("2nd")==null)
{
request.setAttribute("2nd","cycle");
@@ -412,7 +412,7 @@ public abstract class ContinuationBase
if (suspend2_for>0)
continuation.setTimeout(suspend2_for);
// continuation.addContinuationListener(__listener);
- ((HttpServletResponse)response).addHeader("history","suspend");
+ response.addHeader("history","suspend");
continuation.suspend(response);
if (complete2_after>0)
@@ -452,7 +452,7 @@ public abstract class ContinuationBase
@Override
public void run()
{
- ((HttpServletResponse)response).addHeader("history","resume");
+ response.addHeader("history","resume");
continuation.resume();
}
};
@@ -463,7 +463,7 @@ public abstract class ContinuationBase
}
else if (resume2_after==0)
{
- ((HttpServletResponse)response).addHeader("history","resume");
+ response.addHeader("history","resume");
continuation.resume();
}
if (undispatch)
diff --git a/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java b/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java
index 2ca10a0a94..8b1b3f57f0 100644
--- a/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java
+++ b/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java
@@ -23,7 +23,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Request;
@@ -194,6 +194,7 @@ public class ContinuationTest extends ContinuationBase
class Log extends AbstractLifeCycle implements RequestLog
{
+ @Override
public void log(Request request, Response response)
{
_log.add(response.getStatus()+" "+response.getContentCount()+" "+request.getRequestURI());

Back to the top