コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStartTxCorrectOrder() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestStartTxCorrectOrder()
        {
            // GIVEN
            TransactionToApply tx = mock(typeof(TransactionToApply));

            // WHEN
            TransactionApplierFacade result = ( TransactionApplierFacade )_facade.startTx(tx);

            // THEN
            InOrder inOrder = inOrder(_applier1, _applier2, _applier3);

            inOrder.verify(_applier1).startTx(tx);
            inOrder.verify(_applier2).startTx(tx);
            inOrder.verify(_applier3).startTx(tx);

            assertEquals(_txApplier1, result.Appliers[0]);
            assertEquals(_txApplier2, result.Appliers[1]);
            assertEquals(_txApplier3, result.Appliers[2]);
            assertEquals(3, result.Appliers.Length);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLinkTogetherTransactions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLinkTogetherTransactions()
        {
            // GIVEN
            Applier          applier   = mock(typeof(Applier));
            int              batchSize = 10;
            TransactionQueue queue     = new TransactionQueue(batchSize, applier);

            // WHEN
            TransactionToApply[] txs = new TransactionToApply[batchSize];
            for (int i = 0; i < batchSize; i++)
            {
                queue.Queue(txs[i] = new TransactionToApply(mock(typeof(TransactionRepresentation))));
            }

            // THEN
            verify(applier, times(1)).apply(any(), any());
            for (int i = 0; i < txs.Length - 1; i++)
            {
                assertEquals(txs[i + 1], txs[i].Next());
            }
        }
コード例 #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public long commit(TransactionToApply batch, org.neo4j.kernel.impl.transaction.tracing.CommitEvent commitEvent, org.neo4j.storageengine.api.TransactionApplicationMode mode) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
        public override long Commit(TransactionToApply batch, CommitEvent commitEvent, TransactionApplicationMode mode)
        {
            throw new ReadOnlyDbException();
        }
コード例 #4
0
 // These methods are called by the user when building a batch
 public virtual void Next(TransactionToApply next)
 {
     _nextTransactionInBatch = next;
 }