package org.multiverse.stms.gamma.integration.blocking; import org.junit.Test; import org.multiverse.api.TxnExecutor; import org.multiverse.api.LockMode; import org.multiverse.stms.gamma.LeanGammaTxnExecutor; import org.multiverse.stms.gamma.transactions.GammaTxnConfig; import org.multiverse.stms.gamma.transactions.fat.FatFixedLengthGammaTxnFactory; public class ConnectionPool_FatFixedLengthGammaTxn_StressTest extends ConnectionPool_AbstractTest { private LockMode lockMode = LockMode.None; @Test public void testNoLock() { lockMode = LockMode.None; run(); } @Test public void testReadLock() { lockMode = LockMode.Read; run(); } @Test public void testWriteLock() { lockMode = LockMode.Write; run(); } @Test public void testExclusiveLock() { lockMode = LockMode.Exclusive; run(); } @Override protected TxnExecutor newTakeBlock() { GammaTxnConfig config = new GammaTxnConfig(stm) .setReadLockMode(lockMode); return new LeanGammaTxnExecutor(new FatFixedLengthGammaTxnFactory(config)); } @Override protected TxnExecutor newReturnBlock() { GammaTxnConfig config = new GammaTxnConfig(stm) .setReadLockMode(lockMode); return new LeanGammaTxnExecutor(new FatFixedLengthGammaTxnFactory(config)); } }