Exemple #1
0
        private static void SendToChannel(GetStoreFileRequest getStoreFileRequest, EmbeddedChannel embeddedChannel)
        {
            embeddedChannel.writeOutbound(getStoreFileRequest);

            ByteBuf @object = embeddedChannel.readOutbound();

            embeddedChannel.writeInbound(@object);
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getsTransmitted()
        public virtual void GetsTransmitted()
        {
            // given
            GetStoreFileRequest expectedStoreRequest = new GetStoreFileRequest(_expectedStore, _expectedFile, EXPECTED_LAST_TRANSACTION.Value);

            // when
            SendToChannel(expectedStoreRequest, EmbeddedChannel);

            // then
            GetStoreFileRequest actualStoreRequest = EmbeddedChannel.readInbound();

            assertEquals(_expectedStore, actualStoreRequest.ExpectedStoreId());
            assertEquals(_expectedFile, actualStoreRequest.File());
            assertEquals(EXPECTED_LAST_TRANSACTION.Value, actualStoreRequest.RequiredTransactionId());
        }
Exemple #3
0
        private bool HandleFileDoesNotExist(ChannelHandlerContext channelHandlerContext, GetStoreFileRequest getStoreFileRequest)
        {
            FakeFile file = FindFile(_filesystem, getStoreFileRequest.File().Name);

            if (file.RemainingFailed > 0)
            {
                file.RemainingFailed = file.RemainingFailed - 1;
                _log.info("FakeServer failing for file %s", getStoreFileRequest.File());
                Failed(channelHandlerContext);
                return(true);
            }
            return(false);
        }
Exemple #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, java.util.List<Object> out) throws Exception
            protected internal override void Decode(ChannelHandlerContext ctx, ByteBuf @in, IList <object> @out)
            {
                GetStoreFileRequest getStoreFileRequest = (new GetStoreFileRequest.StoreFileRequestMarshall()).Unmarshal0(new NetworkReadableClosableChannelNetty4(@in));

                @out.Add(getStoreFileRequest);
            }