Package org.neo4j.smack.pipeline.core

Examples of org.neo4j.smack.pipeline.core.WorkTransactionPreparer


public class TestWorkTransactionPreparer
{
    @Test
    public void shouldSetNoTransactionIfNoTxIdAndNotTransactional()
    {
        WorkTransactionPreparer prepper = new WorkTransactionPreparer();
        TransactionWork txWork = mock(TransactionWork.class);
       
        when(txWork.getTransactionId()).thenReturn(-1l);
        when(txWork.isTransactional()).thenReturn(false);
       
        prepper.prepare(txWork);
       
        verify(txWork).setTransactionMode(WorkTransactionMode.NO_TRANSACTION);
       
        // TODO: Is it necessary that it generates a tx id for non-transactional work?
        verify(txWork).setTransactionId(0l);
View Full Code Here


    }
   
    @Test
    public void shouldSetOpenTransactionToTransactionalWorkWithTxId()
    {
        WorkTransactionPreparer prepper = new WorkTransactionPreparer();
        TransactionWork txWork = mock(TransactionWork.class);
       
        when(txWork.getTransactionId()).thenReturn(1l);
        when(txWork.isTransactional()).thenReturn(true);
       
        prepper.prepare(txWork);
       
        verify(txWork).setTransactionMode(WorkTransactionMode.OPEN_TRANSACTION);
        verify(txWork, never()).setTransactionId(anyLong());
    }
View Full Code Here

    }
   
    @Test
    public void shouldSetSingleTransactionToTransactionalWorkWithNoTxId()
    {
        WorkTransactionPreparer prepper = new WorkTransactionPreparer();
        TransactionWork txWork = mock(TransactionWork.class);
       
        when(txWork.getTransactionId()).thenReturn(-1l);
        when(txWork.isTransactional()).thenReturn(true);
       
        prepper.prepare(txWork);
       
        verify(txWork).setTransactionMode(WorkTransactionMode.SINGLE_TRANSACTION);
        verify(txWork).setTransactionId(anyLong());
    }
View Full Code Here

TOP

Related Classes of org.neo4j.smack.pipeline.core.WorkTransactionPreparer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.