|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.test.KRADTestCase org.kuali.rice.krad.service.PessimisticLockServiceTest
public class PessimisticLockServiceTest
This class is used to test the PessimisticLockServiceImpl
class
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.kuali.rice.test.BaselineTestCase |
---|
BaselineTestCase.BaselineMode, BaselineTestCase.Mode |
Field Summary |
---|
Fields inherited from class org.kuali.rice.test.BaselineTestCase |
---|
dirty |
Fields inherited from class org.kuali.rice.test.BaseModuleTestCase |
---|
LOG, moduleName |
Fields inherited from class org.kuali.rice.test.RiceTestCase |
---|
DEFAULT_TEST_HARNESS_SPRING_BEANS, failedSuiteTestName, perTestLifeCycles, SUITE_LIFE_CYCLES_FAILED, SUITE_LIFE_CYCLES_RAN, suiteLifeCycles |
Fields inherited from class org.kuali.rice.test.BaseRiceTestCase |
---|
log, method |
Constructor Summary | |
---|---|
PessimisticLockServiceTest()
|
Method Summary | |
---|---|
void |
setUp()
|
void |
testDeleteLocks()
This method tests deleting PessimisticLock objects. |
void |
testEstablishLocks()
This method tests the PessimisticLockService.establishLocks method and the PessimisticLockService.getDocumentActions method. |
void |
testGenerateNewLocks()
This method tests the generation of new PessimisticLock objects |
void |
testGetPessimisticLocksForDocument()
This method tests retrieving PessimisticLock objects by document number |
void |
testGetPessimisticLocksForSession()
This method tests retrieving PessimisticLock objects by session id |
void |
testPessimisticLockingWithCustomDocumentLockDescriptors()
This method tests the PessimisticLockService's ability to establish pessimistic locks for documents supporting custom lock descriptors. |
void |
testPessimisticLockingWithCustomMaintainableLockDescriptors()
This method tests the PessimisticLockService's ability to establish pessimistic locks for maintenance documents (via maintainables) that support custom lock descriptors. |
void |
testReleaseAllLocksForUser()
This method tests releasing PessimisticLock objects for a specific user |
void |
testSaveLock()
This method tests saving PessimisticLock objects |
void |
testWorkflowPessimisticLocking()
This method tests the PessimistLockService's workflow pessimistic locking capabilities. |
Methods inherited from class org.kuali.test.KRADTestCase |
---|
getLoadApplicationLifecycle, getSuiteLifecycles, loadSuiteTestData |
Methods inherited from class org.kuali.rice.test.BaselineTestCase |
---|
getClearDbPerTestLifecycles, getMode, getPerTestLifecycles, getPerTestTablesNotToClear, getPerTestTablesToClear, getRollbackClearDbPerTestLifecycles, getRollbackTestLifecycles |
Methods inherited from class org.kuali.rice.test.BaseModuleTestCase |
---|
getModuleName |
Methods inherited from class org.kuali.rice.test.RiceInternalSuiteDataTestCase |
---|
getKIMDataLoadOrderFile, getKIMSqlFileBaseLocation, getKRADDefaultSuiteTestData |
Methods inherited from class org.kuali.rice.test.BaseRiceTestCase |
---|
getName, getPerTestDataLoaderLifecycle, resetLogLevels, setLogLevel, setName, setTestMethod |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PessimisticLockServiceTest()
Method Detail |
---|
public void setUp() throws Exception
setUp
in class BaselineTestCase
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 expected
Exception
public void testGenerateNewLocks() throws Exception
PessimisticLock
objects
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, \'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 number
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, \'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 id
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, \'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 user
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, \'73f340de-7dfc-102c-97b6-ed716fdaf540\', 0, NULL, \'1234\', {d \'2007-07-01\'}, \'fran\', \'ad4d6c83-4d0f-4309-a528-c2f81ec00396\')")}) public void testSaveLock() throws Exception
PessimisticLock
objects
Exception
public void testEstablishLocks() throws Exception
Exception
public void testWorkflowPessimisticLocking() throws Exception
Exception
public void testPessimisticLockingWithCustomDocumentLockDescriptors() throws Exception
Exception
public void testPessimisticLockingWithCustomMaintainableLockDescriptors() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |