コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void commitACoupleOfTransactionsSuccessfully()
        public virtual void CommitACoupleOfTransactionsSuccessfully()
        {
            TransactionPropagator propagator = NewPropagator(3, 1, givenOrder());

            propagator.Committed(2, MASTER_SERVER_ID);
            propagator.Committed(3, MASTER_SERVER_ID);
            propagator.Committed(4, MASTER_SERVER_ID);
            AssertCalls(( FakeSlave )_slaves.GetEnumerator().next(), 2, 3, 4);
            _logProvider.assertNone(_communicationLogMessage);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void roundRobinSomeFailing()
        public virtual void RoundRobinSomeFailing()
        {
            TransactionPropagator propagator = NewPropagator(4, 2, roundRobin(), false, true);

            for (long tx = 2; tx <= 6; tx++)
            {
                propagator.Committed(tx, MASTER_SERVER_ID);
            }

            /* SLAVE |    TX
             *   0   | 2     5 6
             * F 1   |
             *   2   | 2 3 4   6
             *   3   |   3 4 5
             */

            IEnumerator <Slave> slaveIt = _slaves.GetEnumerator();

//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2, 5, 6);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            slaveIt.next();
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2, 3, 4, 6);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 3, 4, 5);
            _logProvider.assertNone(_communicationLogMessage);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void commitSuccessfullyAtThreeSlaves()
        public virtual void CommitSuccessfullyAtThreeSlaves()
        {
            TransactionPropagator propagator = NewPropagator(5, 3, givenOrder());

            propagator.Committed(2, MASTER_SERVER_ID);
            propagator.Committed(3, 1);
            propagator.Committed(4, 2);

            IEnumerator <Slave> slaveIt = _slaves.GetEnumerator();

//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2, 4);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2, 3);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2, 3, 4);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next());
            _logProvider.assertNone(_communicationLogMessage);
        }
コード例 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void commitFailureAtFirstOneShouldMoveOnToNext()
        public virtual void CommitFailureAtFirstOneShouldMoveOnToNext()
        {
            TransactionPropagator propagator = NewPropagator(3, 1, givenOrder(), true);

            propagator.Committed(2, MASTER_SERVER_ID);
            IEnumerator <Slave> slaveIt = _slaves.GetEnumerator();

//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2);
            _logProvider.assertNone(_communicationLogMessage);
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void roundRobinSingleSlave()
        public virtual void RoundRobinSingleSlave()
        {
            TransactionPropagator propagator = NewPropagator(3, 1, roundRobin());

            for (long tx = 2; tx <= 6; tx++)
            {
                propagator.Committed(tx, MASTER_SERVER_ID);
            }
            IEnumerator <Slave> slaveIt = _slaves.GetEnumerator();

//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 2, 5);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 3, 6);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            AssertCalls(( FakeSlave )slaveIt.next(), 4);
            _logProvider.assertNone(_communicationLogMessage);
        }