mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
MNT-19114 - Made review changes
This commit is contained in:
@@ -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)
|
||||
|
@@ -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,18 +57,14 @@ 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);
|
||||
siteService.createSite("rmSite", PARENT_NODE, generate(), generate(), SiteVisibility.PUBLIC, TYPE_RM_SITE);
|
||||
|
||||
// Adding two immediate folder type children
|
||||
getSiteContainer(
|
||||
@@ -86,15 +82,10 @@ public class RM19114Test extends BaseRMTestCase
|
||||
transactionService,
|
||||
taggingService);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void when() throws Exception
|
||||
{
|
||||
doTestInTransaction(new VoidTest()
|
||||
{
|
||||
public void runImpl() throws Exception
|
||||
{
|
||||
|
||||
wikiPage = getSiteContainer(
|
||||
PARENT_NODE,
|
||||
WIKI_PAGE_FOLDER_TYPE,
|
||||
@@ -102,29 +93,18 @@ public class RM19114Test extends BaseRMTestCase
|
||||
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 after()
|
||||
{
|
||||
public void runImpl() throws Exception
|
||||
{
|
||||
siteService.deleteSite(PARENT_NODE);}});
|
||||
siteService.deleteSite(PARENT_NODE);
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user