MNT-19114 - Made review changes

This commit is contained in:
Elena Hardon
2018-02-19 13:40:52 +02:00
parent b581d58726
commit f1e3c0b853
2 changed files with 34 additions and 68 deletions

View File

@@ -27,20 +27,19 @@
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
import com.google.common.collect.Sets;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.node.integrity.IntegrityException;
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
import org.alfresco.repo.policy.annotation.Behaviour;
import org.alfresco.repo.policy.annotation.BehaviourBean;
@@ -59,7 +58,6 @@ import org.alfresco.service.cmr.site.SiteVisibility;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ParameterCheck;
import org.alfresco.util.PropertyMap;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* Behaviour associated with the RM Site type
@@ -342,18 +340,6 @@ public class RmSiteType extends BaseBehaviourBean
});
}
/**
* Overridden this because in this case we need to have multiple cm:folder types.
* The two mentioned folders are created when rm site is created and those are Saved Searches and surf-config folder.
*
*/
@Override
protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List<QName> acceptedUniqueChildType,
List<QName> acceptedMultipleChildType) throws IntegrityException
{
super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType);
}
@Behaviour(kind = BehaviourKind.CLASS,
policy = "alf:onDeleteNode",
notificationFrequency = NotificationFrequency.TRANSACTION_COMMIT)

View File

@@ -35,9 +35,9 @@ import org.alfresco.service.cmr.site.SiteInfo;
import org.alfresco.service.cmr.site.SiteVisibility;
/**
* Test class for RM 19114, wiki page can not be created under RM site
* Test class for MNT 19114, wiki page can not be created under RM site
*/
public class RM19114Test extends BaseRMTestCase
public class MNT19114Test extends BaseRMTestCase
{
public static final String PARENT_NODE = "RMSite";
public static final String DOCUMENT_LIBRARY_FOLDER_TYPE = "documentLibrary";
@@ -57,74 +57,54 @@ public class RM19114Test extends BaseRMTestCase
*/
public void testCreateWikiPageInRmSite() throws Exception
{
doBehaviourDrivenTest(new BehaviourDrivenTest(null, false)
doBehaviourDrivenTest(new BehaviourDrivenTest()
{
NodeRef wikiPage;
public void given()
{
doTestInTransaction(new VoidTest()
{
public void runImpl() throws Exception
{
// Creating a Records Management site
SiteInfo rmSite= siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE);
// Creating a Records Management site
siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE);
// Adding two immediate folder type children
getSiteContainer(
PARENT_NODE,
DOCUMENT_LIBRARY_FOLDER_TYPE,
true,
siteService,
transactionService,
taggingService);
getSiteContainer(
PARENT_NODE,
SURF_CONFIG_FOLDER_TYPE,
true,
siteService,
transactionService,
taggingService);
}
});
// Adding two immediate folder type children
getSiteContainer(
PARENT_NODE,
DOCUMENT_LIBRARY_FOLDER_TYPE,
true,
siteService,
transactionService,
taggingService);
getSiteContainer(
PARENT_NODE,
SURF_CONFIG_FOLDER_TYPE,
true,
siteService,
transactionService,
taggingService);
}
public void when() throws Exception
{
doTestInTransaction(new VoidTest()
{
public void runImpl() throws Exception
{
wikiPage = getSiteContainer(
PARENT_NODE,
WIKI_PAGE_FOLDER_TYPE,
true,
siteService,
transactionService,
taggingService);
}
});
wikiPage = getSiteContainer(
PARENT_NODE,
WIKI_PAGE_FOLDER_TYPE,
true,
siteService,
transactionService,
taggingService);
}
public void then() throws Exception
{
doTestInTransaction(new VoidTest()
{
public void runImpl() throws Exception
{
assertEquals( true, nodeService.exists(wikiPage));
}
});
// Check if the new folder type wiki page has been created
assertEquals(true, nodeService.exists(wikiPage));
}
public void after(){
doTestInTransaction(new VoidTest()
{
public void runImpl() throws Exception
{
siteService.deleteSite(PARENT_NODE);}});
public void after()
{
siteService.deleteSite(PARENT_NODE);
}
});
}