use of org.apache.cassandra.streaming.messages.CompleteMessage in project cassandra by apache.
the class StreamingMultiplexedChannelTest method onControlMessageComplete_Exception.
@Test
public void onControlMessageComplete_Exception() throws InterruptedException, ExecutionException, TimeoutException {
Assert.assertTrue(channel.isOpen());
Assert.assertTrue(sender.connected());
ChannelPromise promise = channel.newPromise();
promise.setFailure(new RuntimeException("this is just a testing exception"));
Future f = sender.onMessageComplete(promise, new CompleteMessage());
f.get(5, TimeUnit.SECONDS);
Assert.assertFalse(channel.isOpen());
Assert.assertFalse(sender.connected());
Assert.assertEquals(StreamSession.State.FAILED, session.state());
}
use of org.apache.cassandra.streaming.messages.CompleteMessage in project cassandra by apache.
the class StreamingInboundHandlerTest method StreamDeserializingTask_deriveSession_NoSession.
@Test(expected = UnsupportedOperationException.class)
public void StreamDeserializingTask_deriveSession_NoSession() {
CompleteMessage msg = new CompleteMessage();
StreamDeserializingTask task = new StreamDeserializingTask(null, streamingChannel, streamingChannel.messagingVersion);
task.deriveSession(msg);
}
use of org.apache.cassandra.streaming.messages.CompleteMessage in project cassandra by apache.
the class StreamingMultiplexedChannelTest method onControlMessageComplete_HappyPath.
@Test
public void onControlMessageComplete_HappyPath() {
Assert.assertTrue(channel.isOpen());
Assert.assertTrue(sender.connected());
ChannelPromise promise = channel.newPromise();
promise.setSuccess();
Assert.assertNull(sender.onMessageComplete(promise, new CompleteMessage()));
Assert.assertTrue(channel.isOpen());
Assert.assertTrue(sender.connected());
Assert.assertNotEquals(StreamSession.State.FAILED, session.state());
}
Aggregations