mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-2072 (Concurrency exceptions and deadlocks on Records Management "File to" rule)
* Fixed the failing test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.2.1.x@102279 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -203,26 +203,39 @@ public class FileToActionTest extends BaseRMTestCase
|
|||||||
|
|
||||||
private void createRecord(final String path, final String name, final String resolvedPath)
|
private void createRecord(final String path, final String name, final String resolvedPath)
|
||||||
{
|
{
|
||||||
|
final String[] pathValues = StringUtils.tokenizeToStringArray(resolvedPath, "/");
|
||||||
|
|
||||||
|
// set parameters
|
||||||
|
Map<String, Serializable> params = new HashMap<String, Serializable>(1);
|
||||||
|
params.put(FileToAction.PARAM_PATH, path);
|
||||||
|
params.put(FileToAction.PARAM_CREATE_RECORD_PATH, true);
|
||||||
|
|
||||||
doTestInTransaction(new Test<Void>()
|
doTestInTransaction(new Test<Void>()
|
||||||
{
|
{
|
||||||
public Void run() throws Exception
|
public Void run() throws Exception
|
||||||
{
|
{
|
||||||
String[] pathValues = StringUtils.tokenizeToStringArray(resolvedPath, "/");
|
|
||||||
|
|
||||||
// show the folder doesn't exist to begin with
|
// show the folder doesn't exist to begin with
|
||||||
FileInfo createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList<String>(Arrays.asList(pathValues)), false);
|
FileInfo createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList<String>(Arrays.asList(pathValues)), false);
|
||||||
//assertNull(createdRecordFolder);
|
assertNull(createdRecordFolder);
|
||||||
|
|
||||||
// set parameters
|
// set parameters
|
||||||
Map<String, Serializable> params = new HashMap<String, Serializable>(1);
|
Map<String, Serializable> params = new HashMap<String, Serializable>(1);
|
||||||
params.put(FileToAction.PARAM_PATH, path);
|
params.put(FileToAction.PARAM_PATH, path);
|
||||||
params.put(FileToAction.PARAM_CREATE_RECORD_PATH, true);
|
params.put(FileToAction.PARAM_CREATE_RECORD_PATH, true);
|
||||||
|
|
||||||
// execute file-to action
|
return null;
|
||||||
rmActionService.executeRecordsManagementAction(dmDocument, FileToAction.NAME, params);
|
}
|
||||||
|
}, ADMIN_USER);
|
||||||
|
|
||||||
|
// execute file-to action
|
||||||
|
rmActionService.executeRecordsManagementAction(dmDocument, FileToAction.NAME, params);
|
||||||
|
|
||||||
|
doTestInTransaction(new Test<Void>()
|
||||||
|
{
|
||||||
|
public Void run() throws Exception
|
||||||
|
{
|
||||||
// show the folder has now been created
|
// show the folder has now been created
|
||||||
createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList<String>(Arrays.asList(pathValues)), false);
|
FileInfo createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList<String>(Arrays.asList(pathValues)), false);
|
||||||
assertNotNull(createdRecordFolder);
|
assertNotNull(createdRecordFolder);
|
||||||
assertEquals(name, createdRecordFolder.getName());
|
assertEquals(name, createdRecordFolder.getName());
|
||||||
NodeRef createdRecordFolderNodeRef = createdRecordFolder.getNodeRef();
|
NodeRef createdRecordFolderNodeRef = createdRecordFolder.getNodeRef();
|
||||||
|
Reference in New Issue
Block a user