if (isOutClosed()) throw new IllegalStateException("Channel was already closed", outClosed); if (isInClosed()) { throw new IllegalStateException("Channel was already closed", inClosed); } else if (isOutClosed()) { throw new IllegalStateException("Channel was already closed", outClosed); } else {
if (!channel.isOutClosed()) channel.send(new Cancel(id)); // only send a cancel if we can, or else ChannelClosedException will mask the original cause
if (!channel.isOutClosed()) channel.send(new Cancel(id)); // only send a cancel if we can, or else ChannelClosedException will mask the original cause
if (!channel.isOutClosed()) channel.send(new Cancel(id)); // only send a cancel if we can, or else ChannelClosedException will mask the original cause
System.out.println("Running the tests"); assertTrue("Channel should be closing", channel.isClosingOrClosed()); assertFalse("Channel should not be closed due to the lock", channel.isOutClosed());
if (!channel.isOutClosed()) channel.send(new Cancel(id)); // only send a cancel if we can, or else ChannelClosedException will mask the original cause