diff --git a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/action/FileToActionTest.java b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/action/FileToActionTest.java index bd43983a70..cadc97243c 100644 --- a/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/action/FileToActionTest.java +++ b/rm-server/test/java/org/alfresco/module/org_alfresco_module_rm/test/legacy/action/FileToActionTest.java @@ -203,26 +203,39 @@ public class FileToActionTest extends BaseRMTestCase private void createRecord(final String path, final String name, final String resolvedPath) { + final String[] pathValues = StringUtils.tokenizeToStringArray(resolvedPath, "/"); + + // set parameters + Map params = new HashMap(1); + params.put(FileToAction.PARAM_PATH, path); + params.put(FileToAction.PARAM_CREATE_RECORD_PATH, true); + doTestInTransaction(new Test() { public Void run() throws Exception { - String[] pathValues = StringUtils.tokenizeToStringArray(resolvedPath, "/"); - // show the folder doesn't exist to begin with FileInfo createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList(Arrays.asList(pathValues)), false); - //assertNull(createdRecordFolder); + assertNull(createdRecordFolder); // set parameters Map params = new HashMap(1); params.put(FileToAction.PARAM_PATH, path); params.put(FileToAction.PARAM_CREATE_RECORD_PATH, true); - // execute file-to action - rmActionService.executeRecordsManagementAction(dmDocument, FileToAction.NAME, params); + return null; + } + }, ADMIN_USER); + // execute file-to action + rmActionService.executeRecordsManagementAction(dmDocument, FileToAction.NAME, params); + + doTestInTransaction(new Test() + { + public Void run() throws Exception + { // show the folder has now been created - createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList(Arrays.asList(pathValues)), false); + FileInfo createdRecordFolder = fileFolderService.resolveNamePath(filePlan, new ArrayList(Arrays.asList(pathValues)), false); assertNotNull(createdRecordFolder); assertEquals(name, createdRecordFolder.getName()); NodeRef createdRecordFolderNodeRef = createdRecordFolder.getNodeRef();