mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
59256: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 59237: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 59231: MNT-10237: Merged V4.1.6 (4.1.6.4) to V4.1-BUG-FIX (4.1.8) 58895: MNT-10109: Merged DEV to PATCHES/V4.1.6 (4.1.6.4) 58855: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Fix unit tests failure by purging archived sites. Forbid new site creation if site group already exists. 58871: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Return beforePurgeNode callback binding to Site class. 58947: MNT-10109: PATCHES/V4.1.6 (4.1.6.4) 58946: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Fix test failures by purging deleted sites from trashcan so that sitename can be reused. Change SiteServiceImplTest to avoid database deadlock. 58949: MNT-10109: PATCHES/V4.1.6 (4.1.6.4) 58948: MNT-10109: Permissions are not restored when a deleted site is recovered from the trashcan - Fix test failures by purging deleted sites from trashcan so that sitename can be reused. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62120 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,6 +21,7 @@ package org.alfresco.repo.web.scripts;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -71,6 +72,7 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
||||
private SiteService siteService;
|
||||
private NodeService nodeService;
|
||||
private TransactionService transactionService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private NodeRef testSiteNodeRef;
|
||||
private String testSiteNodeRefString;
|
||||
@@ -86,14 +88,17 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
||||
this.siteService = (SiteService)appContext.getBean("SiteService");
|
||||
this.nodeService = (NodeService)appContext.getBean("NodeService");
|
||||
this.transactionService = (TransactionService)appContext.getBean("TransactionService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
// set admin as current user
|
||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
// delete the test site if it's still hanging around from previous runs
|
||||
if (siteService.getSite(TEST_SITE_NAME) != null)
|
||||
SiteInfo site = siteService.getSite(TEST_SITE_NAME);
|
||||
if (site != null)
|
||||
{
|
||||
siteService.deleteSite(TEST_SITE_NAME);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(site.getNodeRef()));
|
||||
}
|
||||
|
||||
// create the test site, this should create a site but it won't have any containers created
|
||||
@@ -115,6 +120,7 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
SiteInfo site = siteService.getSite(TEST_SITE_NAME);
|
||||
// use retrying transaction to delete the site
|
||||
this.transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@@ -127,6 +133,7 @@ public class ReadOnlyTransactionInGetRestApiTest extends BaseWebScriptTest
|
||||
return null;
|
||||
}
|
||||
});
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(site.getNodeRef()));
|
||||
|
||||
AuthenticationUtil.clearCurrentSecurityContext();
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.site.SiteModel;
|
||||
@@ -61,6 +62,7 @@ public class BlogServiceTest extends BaseWebScriptTest
|
||||
private AuthenticationComponent authenticationComponent;
|
||||
private PersonService personService;
|
||||
private SiteService siteService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private static final String USER_ONE = "UserOneSecondToo";
|
||||
private static final String USER_TWO = "UserTwoSecondToo";
|
||||
@@ -91,6 +93,7 @@ public class BlogServiceTest extends BaseWebScriptTest
|
||||
this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent");
|
||||
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
|
||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
// Authenticate as user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
@@ -123,8 +126,14 @@ public class BlogServiceTest extends BaseWebScriptTest
|
||||
// admin user required to delete things
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_BLOG);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// delete invite site
|
||||
siteService.deleteSite(SITE_SHORT_NAME_BLOG);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
|
||||
|
||||
// delete the users
|
||||
personService.deletePerson(USER_ONE);
|
||||
|
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.calendar.CalendarServiceImpl;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.site.SiteModel;
|
||||
@@ -67,6 +68,7 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
||||
private PersonService personService;
|
||||
private NodeService nodeService;
|
||||
private SiteService siteService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private static final String USER_ONE = "UserOneSecondToo";
|
||||
private static final String USER_TWO = "UserTwoSecondToo";
|
||||
@@ -100,6 +102,7 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
||||
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
|
||||
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
// Authenticate as user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
@@ -136,8 +139,13 @@ public class CalendarRestApiTest extends BaseWebScriptTest
|
||||
// admin user required to delete user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_CALENDAR);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// delete invite site
|
||||
siteService.deleteSite(SITE_SHORT_NAME_CALENDAR);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
|
||||
// delete the users
|
||||
deleteUser(USER_ONE);
|
||||
|
@@ -29,6 +29,7 @@ import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.ForumModel;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -78,6 +79,7 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
||||
private SiteService siteService;
|
||||
private NodeService nodeService;
|
||||
private NodeService internalNodeService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private static final String USER_ONE = "UserOneThird";
|
||||
private static final String USER_TWO = "UserTwoThird";
|
||||
@@ -109,6 +111,7 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
||||
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
// Authenticate as user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
@@ -178,6 +181,9 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
||||
this.authenticationService.deleteAuthentication(USER_TWO);
|
||||
}
|
||||
|
||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_DISCUSSION);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// delete discussions test site
|
||||
RetryingTransactionCallback<Void> deleteCallback = new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@@ -189,6 +195,8 @@ public class DiscussionRestApiTest extends BaseWebScriptTest
|
||||
}
|
||||
};
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(deleteCallback);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
}
|
||||
|
||||
private void createUser(String userName, String role)
|
||||
|
@@ -27,6 +27,7 @@ import org.alfresco.repo.action.executer.MailActionExecuter;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.invitation.WorkflowModelNominatedInvitation;
|
||||
import org.alfresco.repo.management.subsystems.ChildApplicationContextFactory;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
@@ -81,6 +82,7 @@ public class InviteServiceTest extends BaseWebScriptTest
|
||||
private MutableAuthenticationDao mutableAuthenticationDao;
|
||||
private NamespaceService namespaceService;
|
||||
private TransactionService transactionService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
// stores invitee email addresses, one entry for each "start invite" operation
|
||||
// invoked, so that resources created for each invitee for each test
|
||||
@@ -134,6 +136,7 @@ public class InviteServiceTest extends BaseWebScriptTest
|
||||
this.namespaceService = (NamespaceService) getServer().getApplicationContext().getBean("NamespaceService");
|
||||
this.transactionService = (TransactionService) getServer().getApplicationContext()
|
||||
.getBean("TransactionService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
configureMailExecutorForTestMode(this.getServer());
|
||||
|
||||
@@ -279,6 +282,19 @@ public class InviteServiceTest extends BaseWebScriptTest
|
||||
{
|
||||
super.tearDown();
|
||||
|
||||
|
||||
RunAsWork<SiteInfo[]> runAsWork = new RunAsWork<SiteInfo[]>()
|
||||
{
|
||||
public SiteInfo[] doWork() throws Exception
|
||||
{
|
||||
SiteInfo[] siteInfos = { siteService.getSite(SITE_SHORT_NAME_INVITE_1),
|
||||
siteService.getSite(SITE_SHORT_NAME_INVITE_2),
|
||||
siteService.getSite(SITE_SHORT_NAME_INVITE_3) };
|
||||
return siteInfos;
|
||||
}
|
||||
};
|
||||
final SiteInfo[] siteInfos = AuthenticationUtil.runAs(runAsWork, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
//
|
||||
// run various teardown operations which need to be run as 'admin'
|
||||
//
|
||||
@@ -333,6 +349,19 @@ public class InviteServiceTest extends BaseWebScriptTest
|
||||
}
|
||||
return null;
|
||||
}});
|
||||
|
||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
for (SiteInfo siteInfo : siteInfos)
|
||||
{
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
}
|
||||
|
||||
public static String PERSON_FIRSTNAME = "FirstName123";
|
||||
|
@@ -25,6 +25,7 @@ import java.util.List;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -70,6 +71,7 @@ public class LinksRestApiTest extends BaseWebScriptTest
|
||||
private NodeService nodeService;
|
||||
private NodeService internalNodeService;
|
||||
private SiteService siteService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private static final String USER_ONE = "UserOneSecondToo";
|
||||
private static final String USER_TWO = "UserTwoSecondToo";
|
||||
@@ -107,6 +109,7 @@ public class LinksRestApiTest extends BaseWebScriptTest
|
||||
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
|
||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
// Authenticate as user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
@@ -141,8 +144,13 @@ public class LinksRestApiTest extends BaseWebScriptTest
|
||||
// admin user required to delete user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_LINKS);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// delete the site
|
||||
siteService.deleteSite(SITE_SHORT_NAME_LINKS);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
|
||||
// delete the users
|
||||
personService.deletePerson(USER_ONE);
|
||||
|
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.site.SiteModel;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
@@ -46,6 +47,7 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
||||
private PersonService personService;
|
||||
private SiteService siteService;
|
||||
private NodeService nodeService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private static final String USER_ONE = "UserOneSecondToo";
|
||||
private static final String USER_TWO = "UserTwoSecondToo";
|
||||
@@ -63,6 +65,7 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
||||
this.personService = (PersonService)ctx.getBean("PersonService");
|
||||
this.siteService = (SiteService)ctx.getBean("SiteService");
|
||||
this.nodeService = (NodeService)ctx.getBean("NodeService");
|
||||
this.nodeArchiveService = (NodeArchiveService)ctx.getBean("nodeArchiveService");
|
||||
|
||||
// Do the setup as admin
|
||||
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
|
||||
@@ -86,8 +89,14 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
||||
// Admin user required to delete users and sites
|
||||
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
|
||||
|
||||
SiteInfo siteInfo = siteService.getSite(TEST_SITE.getShortName());
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// Zap the site, and their contents
|
||||
siteService.deleteSite(TEST_SITE.getShortName());
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
|
||||
|
||||
// Delete users
|
||||
for (String user : new String[] {USER_ONE, USER_TWO, USER_THREE})
|
||||
@@ -112,10 +121,12 @@ public class NodeWebScripTest extends BaseWebScriptTest
|
||||
@Override
|
||||
public SiteInfo execute() throws Throwable
|
||||
{
|
||||
if (siteService.getSite(shortName) != null)
|
||||
SiteInfo siteInfo = siteService.getSite(shortName);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// Tidy up after failed earlier run
|
||||
siteService.deleteSite(shortName);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
|
||||
// Do the create
|
||||
|
@@ -21,6 +21,7 @@ package org.alfresco.repo.web.scripts.nodelocator;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.model.Repository;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.nodelocator.AncestorNodeLocator;
|
||||
import org.alfresco.repo.nodelocator.CompanyHomeNodeLocator;
|
||||
import org.alfresco.repo.nodelocator.SitesHomeNodeLocator;
|
||||
@@ -61,6 +62,7 @@ public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
||||
private Repository repositoryHelper;
|
||||
private NodeRef companyHome;
|
||||
private NamespaceService namespaceService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
public void testCompanyHomeNodeLocator() throws Exception
|
||||
{
|
||||
@@ -113,6 +115,7 @@ public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
||||
if (site != null)
|
||||
{
|
||||
siteService.deleteSite(site.getShortName());
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(site.getNodeRef()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,5 +282,6 @@ public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
||||
this.namespaceService= (NamespaceService) appContext.getBean("NamespaceService");
|
||||
this.repositoryHelper = (Repository) appContext.getBean("repositoryHelper");
|
||||
this.companyHome = repositoryHelper.getCompanyHome();
|
||||
this.nodeArchiveService = (NodeArchiveService) appContext.getBean("nodeArchiveService");
|
||||
}
|
||||
}
|
||||
|
@@ -548,6 +548,13 @@ public class SiteServiceTest extends BaseWebScriptTest
|
||||
JSONObject grp = getResult.getJSONObject("authority");
|
||||
assertEquals("full name not correct", testGroupName, grp.getString("fullName"));
|
||||
}
|
||||
|
||||
// cleanup
|
||||
if(authorityService.authorityExists(testGroupName))
|
||||
{
|
||||
this.authenticationComponent.setSystemUserAsCurrentUser();
|
||||
authorityService.deleteAuthority(testGroupName);
|
||||
}
|
||||
}
|
||||
|
||||
public void testDeleteMembership() throws Exception
|
||||
@@ -1157,5 +1164,12 @@ public class SiteServiceTest extends BaseWebScriptTest
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup
|
||||
if (authorityService.authorityExists(testGroupName))
|
||||
{
|
||||
this.authenticationComponent.setSystemUserAsCurrentUser();
|
||||
this.authorityService.deleteAuthority(testGroupName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ import java.util.Date;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.archive.NodeArchiveService;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
@@ -70,6 +71,7 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
||||
private NodeService internalNodeService;
|
||||
private SiteService siteService;
|
||||
private WikiService wikiService;
|
||||
private NodeArchiveService nodeArchiveService;
|
||||
|
||||
private static final String USER_ONE = "UserOneSecondToo";
|
||||
private static final String USER_TWO = "UserTwoSecondToo";
|
||||
@@ -110,6 +112,7 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
||||
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
|
||||
this.wikiService = (WikiService)getServer().getApplicationContext().getBean("WikiService");
|
||||
this.internalNodeService = (NodeService)getServer().getApplicationContext().getBean("nodeService");
|
||||
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
|
||||
|
||||
// Authenticate as user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
@@ -144,8 +147,13 @@ public class WikiRestApiTest extends BaseWebScriptTest
|
||||
// admin user required to delete user
|
||||
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
|
||||
|
||||
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_WIKI);
|
||||
if (siteInfo != null)
|
||||
{
|
||||
// delete the site
|
||||
siteService.deleteSite(SITE_SHORT_NAME_WIKI);
|
||||
nodeArchiveService.purgeArchivedNode(nodeArchiveService.getArchivedNode(siteInfo.getNodeRef()));
|
||||
}
|
||||
|
||||
// delete the users
|
||||
if(personService.personExists(USER_ONE))
|
||||
|
Reference in New Issue
Block a user