Fix ALF-2499 (Deleting a web project also deletes similarly named web projects - Potential Data Loss)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19918 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2010-04-20 15:36:45 +00:00
parent b53c4f4fae
commit d74f934789
4 changed files with 35 additions and 10 deletions

View File

@@ -482,6 +482,13 @@ public class WebProjectServiceImplTest extends AbstractWCMServiceImplTest
String wpStoreId = wpInfo.getStoreId();
assertNotNull(wpService.getWebProject(wpStoreId));
// Create ANOther web project
WebProjectInfo wpAnoInfo = wpService.createWebProject(TEST_WEBPROJ_DNS+"-delete ano", TEST_WEBPROJ_NAME+"-delete ano", TEST_WEBPROJ_TITLE, TEST_WEBPROJ_DESCRIPTION, TEST_WEBPROJ_DEFAULT_WEBAPP, true, null);
String wpStoreAnoId = wpAnoInfo.getStoreId();
assertEquals(2, sbService.listSandboxes(wpStoreId).size());
assertEquals(2, sbService.listSandboxes(wpStoreAnoId).size());
// Switch to USER_ONE
AuthenticationUtil.setFullyAuthenticatedUser(USER_ONE);
@@ -517,6 +524,9 @@ public class WebProjectServiceImplTest extends AbstractWCMServiceImplTest
wpService.deleteWebProject(wpStoreId);
assertNull(wpService.getWebProject(wpStoreId));
assertEquals(0, sbService.listSandboxes(wpStoreId).size());
assertEquals(2, sbService.listSandboxes(wpStoreAnoId).size());
try
{
// Try to delete a web project that isn't there (-ve test)