Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = ClientHandshakeException.class) public void shouldFailHandshakeForUnknownProtocolOnClient() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFailHandshakeForUnknownProtocolOnClient()
        {
            // given
            HandshakeServer handshakeServer = new HandshakeServer(_raftApplicationProtocolRepository, _modifierProtocolRepository, new ProtocolHandshakeHappyTest.FakeServerChannel(_handshakeClient)
                                                                  );
            Channel clientChannel = new ProtocolHandshakeHappyTest.FakeClientChannel(handshakeServer);

            // when
            CompletableFuture <ProtocolStack> clientHandshakeFuture = _handshakeClient.initiate(clientChannel, _catchupApplicationProtocolRepository, _modifierProtocolRepository);

            // then
            try
            {
                clientHandshakeFuture.getNow(null);
            }
            catch (CompletionException ex)
            {
                throw ex.InnerException;
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSendInitialMagicOnInitiation()
        public virtual void ShouldSendInitialMagicOnInitiation()
        {
            _client.initiate(_channel, _applicationProtocolRepository, _modifierProtocolRepository);

            verify(_channel).write(InitialMagicMessage.Instance());
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void SetUp()
        {
            _protocolStackCompletableFuture = _client.initiate(_channel, _applicationProtocolRepository, _modifierProtocolRepository);
        }
Beispiel #4
0
 internal virtual CompletableFuture <ProtocolStack> Initiate()
 {
     return(HandshakeClient.initiate(ClientChannel, ClientApplicationProtocolRepository, ClientModifierProtocolRepository));
 }