FIXED : ALF-12531: MMT needs to properly support upgrading of AMP files

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@33695 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2012-02-06 15:43:56 +00:00
parent fdc9bdfe84
commit f530502bd3
3 changed files with 180 additions and 90 deletions

View File

@@ -210,6 +210,28 @@ public class ModuleManagementToolTest extends TestCase
// TODO need to prove that the war file has not been updated in any way
}
public void testUninstall()
throws Exception
{
manager.setVerbose(true);
String warLocation = getFileLocation(".war", "module/test.war");
String ampLocation = getFileLocation(".amp", "module/test_v1.amp");
// Initial install of module
this.manager.installModule(ampLocation, warLocation, false, false, false);
this.manager.listModules(warLocation);
this.manager.uninstallModule("test", warLocation, false, false);
List<String> files = new ArrayList<String>(10);
files.add("/WEB-INF/classes/alfresco/module/test/module.properties");
files.add("/WEB-INF/classes/alfresco/module/test/modifications.install");
files.add("/WEB-INF/lib/test.jar");
files.add("/WEB-INF/classes/alfresco/module/test/module-context.xml");
checkForFileNonExistance(warLocation, files);
}
public void testForcedInstall()
throws Exception
{
@@ -247,6 +269,7 @@ public class ModuleManagementToolTest extends TestCase
}
}
public void testList()
throws Exception
{
@@ -271,6 +294,21 @@ public class ModuleManagementToolTest extends TestCase
return file.getPath();
}
// public void testNoWar() throws Exception
// {
// File noWar = new File("noWar");
// File amp = getFile(".amp", "module/test_v1.amp");
// try
// {
// this.manager.installModule(amp, noWar,false,false);
// }
// catch (ModuleManagementToolException exception)
// {
// assertTrue(exception.getMessage().endsWith("does not exist."));
// }
//
// }
private void checkForFileExistance(String warLocation, List<String> files)
{
for (String file : files)