Search in sources :

Example 1 with TransactionHelper

use of org.ow2.proactive.db.TransactionHelper in project scheduling by ow2-proactive.

the class TransactionHelperTest method setUp.

@Before
public void setUp() {
    sessionFactory = mock(SessionFactory.class);
    session = mock(Session.class);
    transaction = mock(Transaction.class);
    when(sessionFactory.openSession()).thenReturn(session);
    when(session.beginTransaction()).thenReturn(transaction);
    when(session.getTransaction()).thenReturn(transaction);
    transactionHelper = new TransactionHelper(sessionFactory);
    sessionWork = mock(SessionWork.class);
}
Also used : SessionFactory(org.hibernate.SessionFactory) SessionWork(org.ow2.proactive.db.SessionWork) Transaction(org.hibernate.Transaction) TransactionHelper(org.ow2.proactive.db.TransactionHelper) Session(org.hibernate.Session) Before(org.junit.Before)

Aggregations

Session (org.hibernate.Session)1 SessionFactory (org.hibernate.SessionFactory)1 Transaction (org.hibernate.Transaction)1 Before (org.junit.Before)1 SessionWork (org.ow2.proactive.db.SessionWork)1 TransactionHelper (org.ow2.proactive.db.TransactionHelper)1