Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.concurrent.Future<Object> replicate(ReplicatedContent command, boolean trackResult) throws ReplicationFailureException
        public override Future <object> Replicate(ReplicatedContent command, bool trackResult)
        {
            MemberId currentLeader = _leaderProvider.currentLeader();

            if (currentLeader == null)
            {
                throw new ReplicationFailureException("Replication aborted since no leader was available");
            }
            return(Replicate0(command, trackResult, currentLeader));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGiveCurrentLeaderIfAvailable() throws InterruptedException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldGiveCurrentLeaderIfAvailable()
        {
            _leaderProvider.Leader = _memberId;
            assertEquals(_leaderProvider.currentLeader(), _memberId);
            assertEquals(_leaderProvider.awaitLeader(), _memberId);
        }