Test for FreezeService

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@43583 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2012-11-13 17:31:30 +00:00
parent ceb945aa82
commit f274a3cb9a
2 changed files with 140 additions and 122 deletions

View File

@@ -26,10 +26,10 @@ import org.alfresco.service.cmr.repository.NodeRef;
/** /**
* Freeze Service Interface * Freeze Service Interface
* *
* TODO Fill the implementation of this service out and consolidate existing freeze code. For now consider this a guide for a future service implementation. * TODO
* Implementation used to consolidate freeze behaviours in 2.0. * Implementation used to consolidate freeze behaviours in 2.0.
* When implementing consider application of freeze to 'any' node references, not just records and record folders. (Consider implecations for security and * When implementing consider application of freeze to 'any' node references, not just records and record folders.
* capabilities) * (Consider implications for security and capabilities)
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.0 * @since 2.0

View File

@@ -182,9 +182,27 @@ public class FreezeServiceImplTest extends BaseRMTestCase
assertNotNull(freezeService.getFreezeInitiator(recordTwo)); assertNotNull(freezeService.getFreezeInitiator(recordTwo));
assertFalse(freezeService.isFrozen(recordThree)); assertFalse(freezeService.isFrozen(recordThree));
// FIXME // Relinquish the first hold
freezeService.unFreeze(recordTwo); holdNodeRef = holdAssocs.iterator().next();
freezeService.unFreeze(recordOne); freezeService.relinquish(holdNodeRef);
// Check the existing hold
holdAssocs = freezeService.getHolds(filePlan);
assertNotNull(holdAssocs);
assertEquals(1, holdAssocs.size());
// Relinquish the second hold
holdNodeRef = holdAssocs.iterator().next();
freezeService.unFreeze(freezeService.getFrozen(holdNodeRef));
// All holds should be deleted
holdAssocs = freezeService.getHolds(filePlan);
assertEquals(0, holdAssocs.size());
// Check the nodes are unfrozen
assertFalse(freezeService.isFrozen(recordOne));
assertFalse(freezeService.isFrozen(recordTwo));
assertFalse(freezeService.isFrozen(recordThree));
} }
/** /**