aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-12-07 05:39:33 (EST)
committerThomas Becker2012-12-07 05:39:53 (EST)
commitdb6fdca3b9501da07877f23f99074f775619bc0e (patch)
treea1f9fa931adca8176b5fd6425a6915ccb12fb8d6
parente612c19eb7fe6f2c83e659ef37f95f7685e6ddbf (diff)
downloadorg.eclipse.jetty.project-db6fdca3b9501da07877f23f99074f775619bc0e.zip
org.eclipse.jetty.project-db6fdca3b9501da07877f23f99074f775619bc0e.tar.gz
org.eclipse.jetty.project-db6fdca3b9501da07877f23f99074f775619bc0e.tar.bz2
395922: Unit test that checks if ControlFrameBytes are sent in the right order even with priorization
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java3
-rw-r--r--jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java253
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java4
3 files changed, 171 insertions, 89 deletions
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
index 24562ed..ff0270c 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardStream.java
@@ -468,7 +468,8 @@ public class StandardStream implements IStream
@Override
public String toString()
{
- return String.format("stream=%d v%d windowSize=%db reset=%s %s %s", getId(), session.getVersion(), getWindowSize(), isReset(), openState, closeState);
+ return String.format("stream=%d v%d windowSize=%db reset=%s prio=%d %s %s", getId(), session.getVersion(),
+ getWindowSize(), isReset(), priority, openState, closeState);
}
private boolean canSend()
diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java
index 980c649..29309f0 100644
--- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java
+++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java
@@ -20,10 +20,12 @@ package org.eclipse.jetty.spdy;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
+import java.util.HashSet;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -47,6 +49,8 @@ import org.eclipse.jetty.spdy.generator.Generator;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.Fields;
import org.eclipse.jetty.util.Promise;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.thread.Scheduler;
import org.eclipse.jetty.util.thread.TimerScheduler;
import org.junit.After;
@@ -71,12 +75,16 @@ import static org.mockito.Mockito.verify;
@RunWith(MockitoJUnitRunner.class)
public class StandardSessionTest
{
+ private static final Logger LOG = Log.getLogger(StandardSessionTest.class);
+
@Mock
private Controller controller;
private ExecutorService threadPool;
private StandardSession session;
private Scheduler scheduler;
private Fields headers;
+ private final ByteBufferPool bufferPool = new MappedByteBufferPool();
+ private final Generator generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
@Before
public void setUp() throws Exception
@@ -84,9 +92,7 @@ public class StandardSessionTest
threadPool = Executors.newCachedThreadPool();
scheduler = new TimerScheduler();
scheduler.start();
- ByteBufferPool bufferPool = new MappedByteBufferPool();
- Generator generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
- session = new StandardSession(SPDY.V2, bufferPool,threadPool,scheduler,controller,null,1,null, generator,new FlowControlStrategy.None());
+ session = new StandardSession(SPDY.V2, bufferPool, threadPool, scheduler, controller, null, 1, null, generator, new FlowControlStrategy.None());
headers = new Fields();
}
@@ -100,17 +106,20 @@ public class StandardSessionTest
@SuppressWarnings("unchecked")
private void setControllerWriteExpectationToFail(final boolean fail)
{
- doAnswer(new Answer() {
- public Object answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- Callback callback = (Callback)args[1];
- if (fail)
- callback.failed(new ClosedChannelException());
- else
- callback.succeeded();
- return null;
- }})
- .when(controller).write(any(ByteBuffer.class),any(Callback.class));
+ doAnswer(new Answer()
+ {
+ public Object answer(InvocationOnMock invocation)
+ {
+ Object[] args = invocation.getArguments();
+ Callback callback = (Callback)args[1];
+ if (fail)
+ callback.failed(new ClosedChannelException());
+ else
+ callback.succeeded();
+ return null;
+ }
+ })
+ .when(controller).write(any(ByteBuffer.class), any(Callback.class));
}
@Test
@@ -120,8 +129,8 @@ public class StandardSessionTest
IStream stream = createStream();
assertThatStreamIsInSession(stream);
- assertThat("stream is not reset",stream.isReset(),is(false));
- session.rst(new RstInfo(stream.getId(),StreamStatus.STREAM_ALREADY_CLOSED));
+ assertThat("stream is not reset", stream.isReset(), is(false));
+ session.rst(new RstInfo(stream.getId(), StreamStatus.STREAM_ALREADY_CLOSED));
assertThatStreamIsNotInSession(stream);
assertThatStreamIsReset(stream);
}
@@ -133,8 +142,8 @@ public class StandardSessionTest
IStream stream = createStream();
assertThatStreamIsInSession(stream);
- stream.updateCloseState(true,true);
- session.onControlFrame(new SynReplyFrame(SPDY.V2,SynInfo.FLAG_CLOSE,stream.getId(),null));
+ stream.updateCloseState(true, true);
+ session.onControlFrame(new SynReplyFrame(SPDY.V2, SynInfo.FLAG_CLOSE, stream.getId(), null));
assertThatStreamIsClosed(stream);
assertThatStreamIsNotInSession(stream);
}
@@ -146,8 +155,8 @@ public class StandardSessionTest
IStream stream = createStream();
assertThatStreamIsInSession(stream);
- stream.updateCloseState(true,false);
- stream.headers(new HeadersInfo(headers,true));
+ stream.updateCloseState(true, false);
+ stream.headers(new HeadersInfo(headers, true));
assertThatStreamIsClosed(stream);
assertThatStreamIsNotInSession(stream);
}
@@ -158,9 +167,9 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
IStream stream = createStream();
- assertThat("stream is not unidirectional",stream.isUnidirectional(),not(true));
+ assertThat("stream is not unidirectional", stream.isUnidirectional(), not(true));
Stream pushStream = createPushStream(stream);
- assertThat("pushStream is unidirectional",pushStream.isUnidirectional(),is(true));
+ assertThat("pushStream is unidirectional", pushStream.isUnidirectional(), is(true));
}
@Test
@@ -170,8 +179,8 @@ public class StandardSessionTest
Stream stream = createStream();
IStream pushStream = createPushStream(stream);
- assertThat("Push stream must be associated to the first stream created",pushStream.getAssociatedStream().getId(),is(stream.getId()));
- assertThat("streamIds need to be monotonic",pushStream.getId(),greaterThan(stream.getId()));
+ assertThat("Push stream must be associated to the first stream created", pushStream.getAssociatedStream().getId(), is(stream.getId()));
+ assertThat("streamIds need to be monotonic", pushStream.getId(), greaterThan(stream.getId()));
}
@Test
@@ -186,13 +195,13 @@ public class StandardSessionTest
assertThatPushStreamIsHalfClosed(pushStream);
assertThatPushStreamIsNotClosed(pushStream);
- stream.updateCloseState(true,true);
+ stream.updateCloseState(true, true);
assertThatStreamIsHalfClosed(stream);
assertThatStreamIsNotClosed(stream);
assertThatPushStreamIsHalfClosed(pushStream);
assertThatPushStreamIsNotClosed(pushStream);
- session.onControlFrame(new SynReplyFrame(SPDY.V2,SynInfo.FLAG_CLOSE,stream.getId(),null));
+ session.onControlFrame(new SynReplyFrame(SPDY.V2, SynInfo.FLAG_CLOSE, stream.getId(), null));
assertThatStreamIsClosed(stream);
assertThatPushStreamIsNotClosed(pushStream);
}
@@ -203,9 +212,9 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
IStream stream = createStream();
- stream.updateCloseState(true,true);
+ stream.updateCloseState(true, true);
assertThatStreamIsHalfClosed(stream);
- stream.updateCloseState(true,false);
+ stream.updateCloseState(true, false);
assertThatStreamIsClosed(stream);
createPushStreamAndMakeSureItFails(stream);
}
@@ -213,8 +222,8 @@ public class StandardSessionTest
private void createPushStreamAndMakeSureItFails(IStream stream) throws InterruptedException
{
final CountDownLatch failedLatch = new CountDownLatch(1);
- SynInfo synInfo = new SynInfo(headers,false,stream.getPriority());
- stream.syn(synInfo,5,TimeUnit.SECONDS,new Promise.Adapter<Stream>()
+ SynInfo synInfo = new SynInfo(headers, false, stream.getPriority());
+ stream.syn(synInfo, 5, TimeUnit.SECONDS, new Promise.Adapter<Stream>()
{
@Override
public void failed(Throwable x)
@@ -222,7 +231,7 @@ public class StandardSessionTest
failedLatch.countDown();
}
});
- assertThat("pushStream creation failed",failedLatch.await(5,TimeUnit.SECONDS),is(true));
+ assertThat("pushStream creation failed", failedLatch.await(5, TimeUnit.SECONDS), is(true));
}
@Test
@@ -234,11 +243,11 @@ public class StandardSessionTest
IStream pushStream = createPushStream(stream);
assertThatPushStreamIsHalfClosed(pushStream);
assertThatPushStreamIsInSession(pushStream);
- assertThatStreamIsAssociatedWithPushStream(stream,pushStream);
- session.data(pushStream,new StringDataInfo("close",true),5,TimeUnit.SECONDS,new Callback.Adapter());
+ assertThatStreamIsAssociatedWithPushStream(stream, pushStream);
+ session.data(pushStream, new StringDataInfo("close", true), 5, TimeUnit.SECONDS, new Callback.Adapter());
assertThatPushStreamIsClosed(pushStream);
assertThatPushStreamIsNotInSession(pushStream);
- assertThatStreamIsNotAssociatedWithPushStream(stream,pushStream);
+ assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
}
@Test
@@ -249,9 +258,9 @@ public class StandardSessionTest
IStream stream = createStream();
IStream pushStream = (IStream)stream.syn(new SynInfo(false)).get();
assertThatPushStreamIsInSession(pushStream);
- session.rst(new RstInfo(pushStream.getId(),StreamStatus.INVALID_STREAM));
+ session.rst(new RstInfo(pushStream.getId(), StreamStatus.INVALID_STREAM));
assertThatPushStreamIsNotInSession(pushStream);
- assertThatStreamIsNotAssociatedWithPushStream(stream,pushStream);
+ assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
assertThatStreamIsReset(pushStream);
}
@@ -261,11 +270,11 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
IStream stream = createStream();
- SynInfo synInfo = new SynInfo(headers,true,stream.getPriority());
- IStream pushStream = (IStream)stream.syn(synInfo).get(5,TimeUnit.SECONDS);
+ SynInfo synInfo = new SynInfo(headers, true, stream.getPriority());
+ IStream pushStream = (IStream)stream.syn(synInfo).get(5, TimeUnit.SECONDS);
assertThatPushStreamIsHalfClosed(pushStream);
assertThatPushStreamIsClosed(pushStream);
- assertThatStreamIsNotAssociatedWithPushStream(stream,pushStream);
+ assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
assertThatStreamIsNotInSession(pushStream);
}
@@ -276,15 +285,15 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
IStream stream = createStream();
- SynInfo synInfo = new SynInfo(headers,false,stream.getPriority());
- IStream pushStream = (IStream)stream.syn(synInfo).get(5,TimeUnit.SECONDS);
- assertThatStreamIsAssociatedWithPushStream(stream,pushStream);
+ SynInfo synInfo = new SynInfo(headers, false, stream.getPriority());
+ IStream pushStream = (IStream)stream.syn(synInfo).get(5, TimeUnit.SECONDS);
+ assertThatStreamIsAssociatedWithPushStream(stream, pushStream);
assertThatPushStreamIsInSession(pushStream);
- pushStream.headers(new HeadersInfo(headers,true));
+ pushStream.headers(new HeadersInfo(headers, true));
assertThatPushStreamIsNotInSession(pushStream);
assertThatPushStreamIsHalfClosed(pushStream);
assertThatPushStreamIsClosed(pushStream);
- assertThatStreamIsNotAssociatedWithPushStream(stream,pushStream);
+ assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
}
@Test
@@ -294,11 +303,11 @@ public class StandardSessionTest
final CountDownLatch createdListenerCalledLatch = new CountDownLatch(1);
final CountDownLatch closedListenerCalledLatch = new CountDownLatch(1);
- session.addListener(new TestStreamListener(createdListenerCalledLatch,closedListenerCalledLatch));
+ session.addListener(new TestStreamListener(createdListenerCalledLatch, closedListenerCalledLatch));
IStream stream = createStream();
- session.onDataFrame(new DataFrame(stream.getId(),SynInfo.FLAG_CLOSE,128),ByteBuffer.allocate(128));
- stream.data(new StringDataInfo("close",true));
- assertThat("onStreamCreated listener has been called",createdListenerCalledLatch.await(5,TimeUnit.SECONDS),is(true));
+ session.onDataFrame(new DataFrame(stream.getId(), SynInfo.FLAG_CLOSE, 128), ByteBuffer.allocate(128));
+ stream.data(new StringDataInfo("close", true));
+ assertThat("onStreamCreated listener has been called", createdListenerCalledLatch.await(5, TimeUnit.SECONDS), is(true));
assertThatOnStreamClosedListenerHasBeenCalled(closedListenerCalledLatch);
}
@@ -308,9 +317,9 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
final CountDownLatch closedListenerCalledLatch = new CountDownLatch(1);
- session.addListener(new TestStreamListener(null,closedListenerCalledLatch));
+ session.addListener(new TestStreamListener(null, closedListenerCalledLatch));
IStream stream = createStream();
- session.rst(new RstInfo(stream.getId(),StreamStatus.CANCEL_STREAM));
+ session.rst(new RstInfo(stream.getId(), StreamStatus.CANCEL_STREAM));
assertThatOnStreamClosedListenerHasBeenCalled(closedListenerCalledLatch);
}
@@ -321,12 +330,12 @@ public class StandardSessionTest
final CountDownLatch createdListenerCalledLatch = new CountDownLatch(2);
final CountDownLatch closedListenerCalledLatch = new CountDownLatch(1);
- session.addListener(new TestStreamListener(createdListenerCalledLatch,closedListenerCalledLatch));
+ session.addListener(new TestStreamListener(createdListenerCalledLatch, closedListenerCalledLatch));
IStream stream = createStream();
IStream pushStream = createPushStream(stream);
- session.data(pushStream,new StringDataInfo("close",true),5,TimeUnit.SECONDS,new Callback.Adapter());
+ session.data(pushStream, new StringDataInfo("close", true), 5, TimeUnit.SECONDS, new Callback.Adapter());
assertThat("onStreamCreated listener has been called twice. Once for the stream and once for the pushStream",
- createdListenerCalledLatch.await(5,TimeUnit.SECONDS),is(true));
+ createdListenerCalledLatch.await(5, TimeUnit.SECONDS), is(true));
assertThatOnStreamClosedListenerHasBeenCalled(closedListenerCalledLatch);
}
@@ -336,10 +345,10 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
final CountDownLatch closedListenerCalledLatch = new CountDownLatch(1);
- session.addListener(new TestStreamListener(null,closedListenerCalledLatch));
+ session.addListener(new TestStreamListener(null, closedListenerCalledLatch));
IStream stream = createStream();
IStream pushStream = createPushStream(stream);
- session.rst(new RstInfo(pushStream.getId(),StreamStatus.CANCEL_STREAM));
+ session.rst(new RstInfo(pushStream.getId(), StreamStatus.CANCEL_STREAM));
assertThatOnStreamClosedListenerHasBeenCalled(closedListenerCalledLatch);
}
@@ -377,9 +386,9 @@ public class StandardSessionTest
{
setControllerWriteExpectationToFail(false);
- IStream stream = (IStream)session.syn(new SynInfo(false),new StreamFrameListener.Adapter()).get();
- stream.updateCloseState(true,false);
- assertThat("stream is half closed from remote side",stream.isHalfClosed(),is(true));
+ IStream stream = (IStream)session.syn(new SynInfo(false), new StreamFrameListener.Adapter()).get();
+ stream.updateCloseState(true, false);
+ assertThat("stream is half closed from remote side", stream.isHalfClosed(), is(true));
stream.process(new ByteBufferDataInfo(ByteBuffer.allocate(256), true));
}
@@ -389,18 +398,18 @@ public class StandardSessionTest
setControllerWriteExpectationToFail(false);
final CountDownLatch onDataCalledLatch = new CountDownLatch(1);
- Stream stream = session.syn(new SynInfo(false),new StreamFrameListener.Adapter()
+ Stream stream = session.syn(new SynInfo(false), new StreamFrameListener.Adapter()
{
@Override
public void onData(Stream stream, DataInfo dataInfo)
{
onDataCalledLatch.countDown();
- super.onData(stream,dataInfo);
+ super.onData(stream, dataInfo);
}
- }).get(5,TimeUnit.SECONDS);
- session.onControlFrame(new SynReplyFrame(SPDY.V2,SynInfo.FLAG_CLOSE,stream.getId(),headers));
- session.onDataFrame(new DataFrame(stream.getId(),(byte)0,0),ByteBuffer.allocate(128));
- assertThat("onData is never called",onDataCalledLatch.await(1,TimeUnit.SECONDS),not(true));
+ }).get(5, TimeUnit.SECONDS);
+ session.onControlFrame(new SynReplyFrame(SPDY.V2, SynInfo.FLAG_CLOSE, stream.getId(), headers));
+ session.onDataFrame(new DataFrame(stream.getId(), (byte)0, 0), ByteBuffer.allocate(128));
+ assertThat("onData is never called", onDataCalledLatch.await(1, TimeUnit.SECONDS), not(true));
}
@SuppressWarnings("unchecked")
@@ -424,97 +433,173 @@ public class StandardSessionTest
// first data frame should fail on controller.write()
stream.data(new StringDataInfo("data", false), 5, TimeUnit.SECONDS, callback);
- // second data frame should fail without controller.writer() as the connection is expected to be broken after first controller.write() call failed.
+ // second data frame should fail without controller.write() as the connection is expected to be broken after first controller.write() call failed.
stream.data(new StringDataInfo("data", false), 5, TimeUnit.SECONDS, callback);
verify(controller, times(1)).write(any(ByteBuffer.class), any(Callback.class));
assertThat("Callback.failed has been called twice", failedCalledLatch.await(5, TimeUnit.SECONDS), is(true));
}
+ @Test
+ public void testHeaderFramesAreSentInTheOrderTheyAreCreated() throws ExecutionException,
+ TimeoutException, InterruptedException
+ {
+ testHeaderFramesAreSentInOrder((byte)0, (byte)0, (byte)0);
+ }
+
+ @Test
+ public void testHeaderFramesAreSentInTheOrderTheyAreCreatedWithPrioritization() throws ExecutionException,
+ TimeoutException, InterruptedException
+ {
+ testHeaderFramesAreSentInOrder((byte)0, (byte)1, (byte)2);
+ }
+
+ private void testHeaderFramesAreSentInOrder(final byte priority0, final byte priority1, final byte priority2) throws InterruptedException, ExecutionException
+ {
+ final StandardSession testLocalSession = new StandardSession(SPDY.V2, bufferPool, threadPool, scheduler,
+ new ControllerMock(), null, 1, null, generator, new FlowControlStrategy.None());
+ HashSet<Future> tasks = new HashSet<>();
+
+ int numberOfTasksToRun = 128;
+ for (int i = 0; i < numberOfTasksToRun; i++)
+ {
+ tasks.add(threadPool.submit(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ synStream(priority0);
+ synStream(priority1);
+ synStream(priority2);
+ }
+
+ private void synStream(byte priority)
+ {
+ SynInfo synInfo = new SynInfo(headers, false, priority);
+ testLocalSession.syn(synInfo, new StreamFrameListener.Adapter());
+ }
+ }));
+ }
+
+ for (Future task : tasks)
+ {
+ task.get();
+ }
+
+ threadPool.shutdown();
+ threadPool.awaitTermination(60, TimeUnit.SECONDS);
+ }
+
+ private class ControllerMock implements Controller
+ {
+ long lastStreamId = 0;
+
+ @Override
+ public void write(ByteBuffer buffer, Callback callback)
+ {
+ StandardSession.FrameBytes frameBytes = (StandardSession.FrameBytes)callback;
+
+ int streamId = frameBytes.getStream().getId();
+ LOG.debug("last: {}, current: {}", lastStreamId, streamId);
+ if (lastStreamId < streamId)
+ lastStreamId = streamId;
+ else
+ throw new IllegalStateException("Last streamId: " + lastStreamId + " is not smaller than current StreamId: " +
+ streamId);
+ frameBytes.succeeded();
+ }
+
+ @Override
+ public void close(boolean onlyOutput)
+ {
+ }
+ }
+
private IStream createStream() throws InterruptedException, ExecutionException, TimeoutException
{
- SynInfo synInfo = new SynInfo(headers,false,(byte)0);
- return (IStream)session.syn(synInfo,new StreamFrameListener.Adapter()).get(50,TimeUnit.SECONDS);
+ SynInfo synInfo = new SynInfo(headers, false, (byte)0);
+ return (IStream)session.syn(synInfo, new StreamFrameListener.Adapter()).get(50, TimeUnit.SECONDS);
}
private IStream createPushStream(Stream stream) throws InterruptedException, ExecutionException, TimeoutException
{
- SynInfo synInfo = new SynInfo(headers,false,stream.getPriority());
- return (IStream)stream.syn(synInfo).get(5,TimeUnit.SECONDS);
+ SynInfo synInfo = new SynInfo(headers, false, stream.getPriority());
+ return (IStream)stream.syn(synInfo).get(5, TimeUnit.SECONDS);
}
private void assertThatStreamIsClosed(IStream stream)
{
- assertThat("stream is closed",stream.isClosed(),is(true));
+ assertThat("stream is closed", stream.isClosed(), is(true));
}
private void assertThatStreamIsReset(IStream stream)
{
- assertThat("stream is reset",stream.isReset(),is(true));
+ assertThat("stream is reset", stream.isReset(), is(true));
}
private void assertThatStreamIsNotInSession(IStream stream)
{
- assertThat("stream is not in session",session.getStreams().contains(stream),not(true));
+ assertThat("stream is not in session", session.getStreams().contains(stream), not(true));
}
private void assertThatStreamIsInSession(IStream stream)
{
- assertThat("stream is in session",session.getStreams().contains(stream),is(true));
+ assertThat("stream is in session", session.getStreams().contains(stream), is(true));
}
private void assertThatStreamIsNotClosed(IStream stream)
{
- assertThat("stream is not closed",stream.isClosed(),not(true));
+ assertThat("stream is not closed", stream.isClosed(), not(true));
}
private void assertThatStreamIsNotHalfClosed(IStream stream)
{
- assertThat("stream is not halfClosed",stream.isHalfClosed(),not(true));
+ assertThat("stream is not halfClosed", stream.isHalfClosed(), not(true));
}
private void assertThatPushStreamIsNotClosed(Stream pushStream)
{
- assertThat("pushStream is not closed",pushStream.isClosed(),not(true));
+ assertThat("pushStream is not closed", pushStream.isClosed(), not(true));
}
private void assertThatStreamIsHalfClosed(IStream stream)
{
- assertThat("stream is halfClosed",stream.isHalfClosed(),is(true));
+ assertThat("stream is halfClosed", stream.isHalfClosed(), is(true));
}
private void assertThatStreamIsNotAssociatedWithPushStream(IStream stream, IStream pushStream)
{
- assertThat("pushStream is removed from parent",stream.getPushedStreams().contains(pushStream),not(true));
+ assertThat("pushStream is removed from parent", stream.getPushedStreams().contains(pushStream), not(true));
}
private void assertThatPushStreamIsNotInSession(Stream pushStream)
{
- assertThat("pushStream is not in session",session.getStreams().contains(pushStream),not(true));
+ assertThat("pushStream is not in session", session.getStreams().contains(pushStream), not(true));
}
private void assertThatPushStreamIsInSession(Stream pushStream)
{
- assertThat("pushStream is in session",session.getStreams().contains(pushStream),is(true));
+ assertThat("pushStream is in session", session.getStreams().contains(pushStream), is(true));
}
private void assertThatStreamIsAssociatedWithPushStream(IStream stream, Stream pushStream)
{
- assertThat("stream is associated with pushStream",stream.getPushedStreams().contains(pushStream),is(true));
+ assertThat("stream is associated with pushStream", stream.getPushedStreams().contains(pushStream), is(true));
}
private void assertThatPushStreamIsClosed(Stream pushStream)
{
- assertThat("pushStream is closed",pushStream.isClosed(),is(true));
+ assertThat("pushStream is closed", pushStream.isClosed(), is(true));
}
private void assertThatPushStreamIsHalfClosed(Stream pushStream)
{
- assertThat("pushStream is half closed ",pushStream.isHalfClosed(),is(true));
+ assertThat("pushStream is half closed ", pushStream.isHalfClosed(), is(true));
}
private void assertThatOnStreamClosedListenerHasBeenCalled(final CountDownLatch closedListenerCalledLatch) throws InterruptedException
{
- assertThat("onStreamClosed listener has been called",closedListenerCalledLatch.await(5,TimeUnit.SECONDS),is(true));
+ assertThat("onStreamClosed listener has been called", closedListenerCalledLatch.await(5, TimeUnit.SECONDS), is(true));
}
}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java
index 065ca71..a6fbfc4 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Callback.java
@@ -41,8 +41,6 @@ import org.eclipse.jetty.util.log.Log;
*
* <p>Semantically this is equivalent to an optimise Promise&lt;Void&gt;, but callback is a more meaningful
* name than EmptyPromise</p>
- *
- * @param <C> the type of the context object
*/
public interface Callback
{
@@ -61,8 +59,6 @@ public interface Callback
/**
* <p>Empty implementation of {@link Callback}</p>
- *
- * @param <C> the type of the context object
*/
public static class Adapter implements Callback
{