Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldProvideExpectedMetaData() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldProvideExpectedMetaData()
        {
            ChunkedInput <ByteBuf> replicatedContent = ChunkedReplicatedContent.Chunked(( sbyte )1, new ThreeChunks(this, -1, 8));

            UnpooledByteBufAllocator allocator = UnpooledByteBufAllocator.DEFAULT;

            ByteBuf byteBuf = replicatedContent.readChunk(allocator);

            // is not last
            assertFalse(byteBuf.readBoolean());
            // first chunk has content
            assertEquals(( sbyte )1, byteBuf.readByte());
            byteBuf.release();

            byteBuf = replicatedContent.readChunk(allocator);
            // is not last
            assertFalse(byteBuf.readBoolean());
            byteBuf.release();

            byteBuf = replicatedContent.readChunk(allocator);
            // is last
            assertTrue(byteBuf.readBoolean());
            byteBuf.release();

            assertNull(replicatedContent.readChunk(allocator));
        }
Exemple #2
0
 public override void Handle(DistributedOperation distributedOperation)
 {
     Output.Add(ChunkedReplicatedContent.Single(DISTRIBUTED_OPERATION, distributedOperation.marshalMetaData));
 }
Exemple #3
0
 public override void Handle(DummyRequest dummyRequest)
 {
     Output.Add(ChunkedReplicatedContent.Chunked(DUMMY_REQUEST, dummyRequest.Encoder()));
 }
Exemple #4
0
 public override void Handle(ReplicatedLockTokenRequest replicatedLockTokenRequest)
 {
     Output.Add(ChunkedReplicatedContent.Single(LOCK_TOKEN_REQUEST, channel => ReplicatedLockTokenSerializer.marshal(replicatedLockTokenRequest, channel)));
 }
Exemple #5
0
 public override void Handle(NewLeaderBarrier newLeaderBarrier)
 {
     Output.Add(ChunkedReplicatedContent.Single(NEW_LEADER_BARRIER_TYPE, channel =>
     {
     }));
 }
Exemple #6
0
 public override void Handle(ReplicatedIdAllocationRequest replicatedIdAllocationRequest)
 {
     Output.Add(ChunkedReplicatedContent.Single(ID_RANGE_REQUEST_TYPE, channel => ReplicatedIdAllocationRequestSerializer.marshal(replicatedIdAllocationRequest, channel)));
 }
Exemple #7
0
 public override void Handle(MemberIdSet memberIdSet)
 {
     Output.Add(ChunkedReplicatedContent.Single(RAFT_MEMBER_SET_TYPE, channel => MemberIdSetSerializer.marshal(memberIdSet, channel)));
 }
Exemple #8
0
 public override void Handle(ReplicatedTransaction replicatedTransaction)
 {
     Output.Add(ChunkedReplicatedContent.Chunked(TX_CONTENT_TYPE, new MaxTotalSize(replicatedTransaction.Encode())));
 }