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:
Alan Davis
2014-02-12 01:19:54 +00:00
parent 07eb61ba0f
commit fd8771e7aa
10 changed files with 128 additions and 22 deletions

View File

@@ -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();
// Zap the site, and their contents
siteService.deleteSite(TEST_SITE.getShortName());
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