mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD:
46292: Fix for ALF-17783: Checks and creates the backup directory when needed. 46295: Added some more tests related to ALF-17783 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46765 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -583,6 +583,14 @@ public class ModuleManagementTool implements LogOutput
|
|||||||
backupLocation = BACKUP_DIR + "/" + generateGuid() + ".bin";
|
backupLocation = BACKUP_DIR + "/" + generateGuid() + ".bin";
|
||||||
if (preview == false)
|
if (preview == false)
|
||||||
{
|
{
|
||||||
|
//Create the directory if it doesn't exist.
|
||||||
|
TFile backupLocationDirectory = new TFile(warFileLocation+ BACKUP_DIR);
|
||||||
|
if (!backupLocationDirectory.exists())
|
||||||
|
{
|
||||||
|
backupLocationDirectory.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Backup the file
|
||||||
TFile backupFile = new TFile(warFileLocation + backupLocation);
|
TFile backupFile = new TFile(warFileLocation + backupLocation);
|
||||||
destinationChild.cp_rp(backupFile);
|
destinationChild.cp_rp(backupFile);
|
||||||
}
|
}
|
||||||
|
@@ -250,7 +250,7 @@ public class ModuleManagementToolTest extends TestCase
|
|||||||
{
|
{
|
||||||
manager.setVerbose(true);
|
manager.setVerbose(true);
|
||||||
|
|
||||||
String warLocation = getFileLocation(".war", "module/test.war");
|
String warLocation = getFileLocation(".war", "module/alfresco-4.2.c.war");
|
||||||
String ampLocation = getFileLocation(".amp", "module/test_v4.amp");
|
String ampLocation = getFileLocation(".amp", "module/test_v4.amp");
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -263,8 +263,18 @@ public class ModuleManagementToolTest extends TestCase
|
|||||||
{
|
{
|
||||||
assertTrue(e.getMessage().contains("The amp will overwrite an existing file"));
|
assertTrue(e.getMessage().contains("The amp will overwrite an existing file"));
|
||||||
}
|
}
|
||||||
this.manager.installModule(ampLocation, warLocation, false, true, false); //install it again
|
|
||||||
this.manager.installModule(ampLocation, warLocation, false, true, false); //install it again, just to be sure
|
String ampv2Location = getFileLocation(".amp", "module/test_v2.amp");
|
||||||
|
warLocation = getFileLocation(".war", "module/alfresco-4.2.c.war"); //Get a new war file
|
||||||
|
this.manager.installModule(ampLocation, warLocation, false, true, false); //install v1
|
||||||
|
this.manager.installModule(ampv2Location, warLocation, false, true, false); //install v2
|
||||||
|
|
||||||
|
//install another amp that replaces the same files
|
||||||
|
ampLocation = getFileLocation(".amp", "module/test_v4.amp");
|
||||||
|
warLocation = getFileLocation(".war", "module/alfresco-4.2.c.war"); //Get a new war file
|
||||||
|
String amp5Location = getFileLocation(".amp", "module/test_v7.amp"); //new amp that overides existing files
|
||||||
|
this.manager.installModule(ampLocation, warLocation, false, true, false);
|
||||||
|
this.manager.installModule(amp5Location, warLocation, false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInstallFromDir()
|
public void testInstallFromDir()
|
||||||
|
BIN
source/test-resources/module/alfresco-4.2.c.war
Executable file
BIN
source/test-resources/module/alfresco-4.2.c.war
Executable file
Binary file not shown.
BIN
source/test-resources/module/test_v7.amp
Executable file
BIN
source/test-resources/module/test_v7.amp
Executable file
Binary file not shown.
Reference in New Issue
Block a user