public class PessimisticLockServiceTest extends KRADTestCase
PessimisticLockServiceImpl
KRADTestCase.BootstrapTest, KRADTestCase.Legacy
BaselineTestCase.BaselineMode, BaselineTestCase.Mode
dd, kradTestHarnessSpringResourceLoader
dirty
LOG, moduleName
DEFAULT_TEST_HARNESS_SPRING_BEANS, failedSuiteTestName, perTestLifeCycles, SUITE_LIFE_CYCLES_FAILED, SUITE_LIFE_CYCLES_RAN, suiteLifeCycles
log, method
Constructor and Description |
---|
PessimisticLockServiceTest() |
Modifier and Type | Method and Description |
---|---|
void |
setUp() |
void |
testCustomLockDescriptors() |
void |
testDeleteLocks()
tests deleting
PessimisticLock objects. |
void |
testEstablishLocks()
Deprecated.
|
void |
testEstablishPessimisticLocks()
Tests the
PessimisticLockService.establishPessimisticLocks method. |
void |
testGenerateNewLocks()
tests the generation of new
PessimisticLock objects |
void |
testGetPessimisticLocksForDocument()
tests retrieving
PessimisticLock objects by document number |
void |
testGetPessimisticLocksForSession()
This method tests retrieving
PessimisticLock objects by session id |
void |
testPessimisticLockingWithCustomDocumentLockDescriptors()
Deprecated.
|
void |
testReleaseAllLocksForUser()
This method tests releasing
PessimisticLock objects for a specific user |
void |
testSaveLock()
tests saving
PessimisticLock objects |
void |
testWorkflowPessimisticLocking()
Tests the
PessimisticLockService.establishWorkflowPessimisticLocking method. |
getKRADTestHarnessContext, getLoadApplicationLifecycle, getPerTestTablesNotToClear, getSuiteLifecycles, getTestDictionaryObject, loadSuiteTestData, setUpInternal, setUpLegacyContext, tearDown, tearDownLegacyContext
getClearDbPerTestLifecycles, getMode, getPerTestLifecycles, getPerTestTablesToClear, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles
getModuleName
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKRADDefaultSuiteTestData
configureLogging, dumpMemory, getConfigLocations, getFullTestName, getModuleTestConfigLocation, getRiceMasterDefaultConfigFile, getTestHarnessConfig, getTestHarnessSpringBeansLocation, getTestHarnessSpringResourceLoader, getUserDir, loadPerTestData, logAfterRun, logBeforeRun, report, setBaseDirSystemProperty, setClearTables, setModuleName, startLifecycles, startSuiteDataLoaderLifecycles, stopLifecycles
getName, getPerTestDataLoaderLifecycle, getTestMethod, resetLogLevels, setLogLevel, setName, setTestMethod
public PessimisticLockServiceTest()
public void setUp() throws Exception
setUp
in class KRADTestCase
Exception
@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
PessimisticLock
objects. Tests that invalid deletes throw exceptions and valid
deletes by owner users as well as lock admin users do work as expectedException
public void testGenerateNewLocks() throws Exception
PessimisticLock
objectsException
@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
PessimisticLock
objects by document numberException
@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
PessimisticLock
objects by session idException
@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
PessimisticLock
objects for a specific userException
@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
PessimisticLock
objectsException
public void testEstablishPessimisticLocks() throws Exception
PessimisticLockService.establishPessimisticLocks
method.Exception
public void testCustomLockDescriptors() throws Exception
Exception
@Deprecated public void testEstablishLocks() throws Exception
Exception
public void testWorkflowPessimisticLocking() throws Exception
PessimisticLockService.establishWorkflowPessimisticLocking
method.Exception
@Deprecated public void testPessimisticLockingWithCustomDocumentLockDescriptors() throws Exception
Exception
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.