mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-2526 Make sure we set up the file plan from within a transaction.
This commit is contained in:
@@ -61,11 +61,6 @@ public class MultipleSchedulesTest extends BaseRMTestCase
|
|||||||
applicationContext = ApplicationContextHelper.getApplicationContext(getConfigLocations());
|
applicationContext = ApplicationContextHelper.getApplicationContext(getConfigLocations());
|
||||||
internalDispositionService = (DispositionService) applicationContext.getBean("dispositionService");
|
internalDispositionService = (DispositionService) applicationContext.getBean("dispositionService");
|
||||||
|
|
||||||
// Set up the file plan if it hasn't already been done.
|
|
||||||
if (categoryA == null)
|
|
||||||
{
|
|
||||||
setUpFilePlan();
|
|
||||||
}
|
|
||||||
// Ensure different records are used for each test.
|
// Ensure different records are used for each test.
|
||||||
record = null;
|
record = null;
|
||||||
}
|
}
|
||||||
@@ -77,6 +72,12 @@ public class MultipleSchedulesTest extends BaseRMTestCase
|
|||||||
*/
|
*/
|
||||||
private void setUpFilePlan()
|
private void setUpFilePlan()
|
||||||
{
|
{
|
||||||
|
// Only set up the file plan if it hasn't already been done.
|
||||||
|
if (categoryA == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Create two categories.
|
// Create two categories.
|
||||||
categoryA = filePlanService.createRecordCategory(filePlan, CATEGORY_A_NAME);
|
categoryA = filePlanService.createRecordCategory(filePlan, CATEGORY_A_NAME);
|
||||||
categoryB = filePlanService.createRecordCategory(filePlan, CATEGORY_B_NAME);
|
categoryB = filePlanService.createRecordCategory(filePlan, CATEGORY_B_NAME);
|
||||||
@@ -119,6 +120,7 @@ public class MultipleSchedulesTest extends BaseRMTestCase
|
|||||||
{
|
{
|
||||||
test()
|
test()
|
||||||
.given(() -> {
|
.given(() -> {
|
||||||
|
setUpFilePlan();
|
||||||
// Create a record filed under category A and linked to category B.
|
// Create a record filed under category A and linked to category B.
|
||||||
record = fileFolderService.create(folderA, RECORD_NAME, ContentModel.TYPE_CONTENT).getNodeRef();
|
record = fileFolderService.create(folderA, RECORD_NAME, ContentModel.TYPE_CONTENT).getNodeRef();
|
||||||
recordService.link(record, folderB);
|
recordService.link(record, folderB);
|
||||||
@@ -149,6 +151,7 @@ public class MultipleSchedulesTest extends BaseRMTestCase
|
|||||||
{
|
{
|
||||||
test()
|
test()
|
||||||
.given(() -> {
|
.given(() -> {
|
||||||
|
setUpFilePlan();
|
||||||
// Create a record filed under category B and linked to category A.
|
// Create a record filed under category B and linked to category A.
|
||||||
record = fileFolderService.create(folderB, RECORD_NAME, ContentModel.TYPE_CONTENT).getNodeRef();
|
record = fileFolderService.create(folderB, RECORD_NAME, ContentModel.TYPE_CONTENT).getNodeRef();
|
||||||
recordService.link(record, folderA);
|
recordService.link(record, folderA);
|
||||||
|
Reference in New Issue
Block a user