org.kuali.rice.krad.service
Class PessimisticLockServiceTest
java.lang.Object
org.kuali.rice.test.BaseRiceTestCase
org.kuali.rice.test.RiceTestCase
org.kuali.rice.test.RiceInternalSuiteDataTestCase
org.kuali.rice.test.BaseModuleTestCase
org.kuali.rice.test.BaselineTestCase
org.kuali.rice.krad.test.KRADTestCase
org.kuali.rice.krad.service.PessimisticLockServiceTest
- All Implemented Interfaces:
- MethodAware
public class PessimisticLockServiceTest
- extends KRADTestCase
PessimisticLockServiceTest tests PessimisticLockServiceImpl
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Methods inherited from class org.kuali.rice.test.RiceTestCase |
configureLogging, dumpMemory, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, getUserDir, loadPerTestData, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PessimisticLockServiceTest
public PessimisticLockServiceTest()
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class KRADTestCase
- Throws:
Exception
testDeleteLocks
@UnitTestData(sqlStatements={@UnitTestSql(value="DELETE FROM KRNS_PESSIMISTIC_LOCK_T"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1111, \'4f6bc9e2-7df8-102c-97b6-ed716fdaf540\', 0, NULL, \'1234\', {d \'2007-07-01\'}, \'employee\', \'aa5d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1112, \'5add9cba-7df8-102c-97b6-ed716fdaf540\', 0, NULL, \'1235\', {d \'2007-10-01\'}, \'frank\', \'dd4d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1113, \'69e42b8e-7df8-102c-97b6-ed716fdaf540\', 0, NULL, \'1236\', {d \'2007-08-01\'}, \'fred\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1114, \'76504650-7df8-102c-97b6-ed716fdaf540\', 0, NULL, \'1237\', {d \'2007-08-01\'}, \'fred\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')")})
public void testDeleteLocks()
throws Exception
- tests deleting
PessimisticLock
objects. Tests that invalid deletes throw exceptions and valid
deletes by owner users as well as lock admin users do work as expected
- Throws:
Exception
testGenerateNewLocks
public void testGenerateNewLocks()
throws Exception
- tests the generation of new
PessimisticLock
objects
- Throws:
Exception
testGetPessimisticLocksForDocument
@UnitTestData(sqlStatements={@UnitTestSql(value="DELETE FROM KRNS_PESSIMISTIC_LOCK_T"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1111, \'fbcb0362-7dfb-102c-97b6-ed716fdaf540\', 0, NULL, \'1234\', {d \'2007-07-01\'}, \'fran\', \'aa5d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1112, \'055bef4a-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1237\', {d \'2007-10-01\'}, \'frank\', \'dd5d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1113, \'0e0144ec-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1236\', {d \'2007-10-01\'}, \'frank\', \'dd5d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1114, \'1891526c-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1237\', {d \'2007-08-01\'}, \'fred\', \'ab4d6c83-4d0f-4309-a528-c2f81ec00396\')")})
public void testGetPessimisticLocksForDocument()
throws Exception
- tests retrieving
PessimisticLock
objects by document number
- Throws:
Exception
testGetPessimisticLocksForSession
@UnitTestData(sqlStatements={@UnitTestSql(value="DELETE FROM KRNS_PESSIMISTIC_LOCK_T"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1111, \'24c40cd2-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1234\', {d \'2007-07-01\'}, \'fran\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1112, \'32602e8e-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1235\', {d \'2007-10-01\'}, \'fran\', \'bc5d6c66-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1113, \'3acfc1ce-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1236\', {d \'2007-10-01\'}, \'fran\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1114, \'463cc642-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1237\', {d \'2007-08-01\'}, \'fran\', \'bc5d6c66-4d0f-4309-a528-c2f81ec00396\')")})
public void testGetPessimisticLocksForSession()
throws Exception
- This method tests retrieving
PessimisticLock
objects by session id
- Throws:
Exception
testReleaseAllLocksForUser
@UnitTestData(sqlStatements={@UnitTestSql(value="DELETE FROM KRNS_PESSIMISTIC_LOCK_T"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1111, \'24c40cd2-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1234\', {d \'2007-07-01\'}, \'fran\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1112, \'32602e8e-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1235\', {d \'2007-10-01\'}, \'frank\', \'bc5d6c66-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1113, \'3acfc1ce-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1236\', {d \'2007-10-01\'}, \'frank\', \'bc5d6c66-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1114, \'463cc642-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1237\', {d \'2007-08-01\'}, \'fred\', \'dd5d6c66-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1115, \'4e66c4b2-7dfc-102c-97b6-ed716fdaf540\', 0, \'Temporary Lock\', \'1234\', {d \'2007-07-01\'}, \'fran\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1116, \'55d99b02-7dfc-102c-97b6-ed716fdaf540\', 0, \'Temporary Lock\', \'1235\', {d \'2007-10-01\'}, \'frank\', \'bc5d6c66-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1117, \'5e47fb26-7dfc-102c-97b6-ed716fdaf540\', 0, \'Temporary Lock\', \'1236\', {d \'2007-10-01\'}, \'frank\', \'bc5d6c66-4d0f-4309-a528-c2f81ec00396\')"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1118, \'65c366d8-7dfc-102c-97b6-ed716fdaf540\', 0, \'Temporary Lock\', \'1237\', {d \'2007-08-01\'}, \'fred\', \'dd5d6c66-4d0f-4309-a528-c2f81ec00396\')")})
public void testReleaseAllLocksForUser()
throws Exception
- This method tests releasing
PessimisticLock
objects for a specific user
- Throws:
Exception
testSaveLock
@UnitTestData(sqlStatements={@UnitTestSql(value="DELETE FROM KRNS_PESSIMISTIC_LOCK_T"),@UnitTestSql(value="INSERT INTO KRNS_PESSIMISTIC_LOCK_T (PESSIMISTIC_LOCK_ID,OBJ_ID,VER_NBR,LOCK_DESC_TXT,DOC_HDR_ID,GNRT_DT,PRNCPL_ID,SESN_ID) VALUES (1111, \'73f340de-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1234\', {d \'2007-07-01\'}, \'fran\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')")})
public void testSaveLock()
throws Exception
- tests saving
PessimisticLock
objects
- Throws:
Exception
testEstablishLocks
public void testEstablishLocks()
throws Exception
- tests the PessimisticLockService.establishLocks method and the PessimisticLockService.getDocumentActions method
- Throws:
Exception
testWorkflowPessimisticLocking
public void testWorkflowPessimisticLocking()
throws Exception
- tests the PessimistLockService's workflow pessimistic locking capabilities
- Throws:
Exception
testPessimisticLockingWithCustomDocumentLockDescriptors
public void testPessimisticLockingWithCustomDocumentLockDescriptors()
throws Exception
- tests the PessimisticLockService's ability to establish pessimistic locks for documents supporting custom lock descriptors
- Throws:
Exception
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.