/** * Installs a given AMP file into a given WAR file. * * @see ModuleManagementTool#installModule(String, String, boolean, boolean, boolean) * * @param ampFileLocation the location of the AMP file to be installed * @param warFileLocation the location of the WAR file into which the AMP file is to be installed */ public void installModule(String ampFileLocation, String warFileLocation) { installModule(ampFileLocation, warFileLocation, false, false, true); }
private void installModules(java.io.File dir, String warFileLocation, boolean preview, boolean forceInstall, boolean backupWAR) { java.io.File[] children = dir.listFiles(); if (children != null) { for (java.io.File child : children) { if (child.isFile() == true && child.getName().toLowerCase().endsWith(".amp") == true) { installModule(child.getPath(), warFileLocation, preview, forceInstall, backupWAR); } else { installModules(child, warFileLocation, preview, forceInstall, backupWAR); } } } }
private void installModules(java.io.File dir, String warFileLocation, boolean preview, boolean forceInstall, boolean backupWAR) { java.io.File[] children = dir.listFiles(); if (children != null) { for (java.io.File child : children) { if (child.isFile() == true && child.getName().toLowerCase().endsWith(".amp") == true) { installModule(child.getPath(), warFileLocation, preview, forceInstall, backupWAR); } else { installModules(child, warFileLocation, preview, forceInstall, backupWAR); } } } }
/** * Installs a given AMP file into a given WAR file. * * @see ModuleManagementTool#installModule(String, String, boolean, boolean, boolean) * * @param ampFileLocation the location of the AMP file to be installed * @param warFileLocation the location of the WAR file into which the AMP file is to be installed */ public void installModule(String ampFileLocation, String warFileLocation) { installModule(ampFileLocation, warFileLocation, false, false, true); }
mmt.installModule(ampLocation.getAbsolutePath(), warLocation.getAbsolutePath(), false, // preview
public void testWhiteSpaceInCustomMapping() throws Exception { manager.setVerbose(true); String warLocation = getFileLocation(".war", "module/test.war"); String ampLocation = getFileLocation(".amp", "module/test_v3.amp"); // Initial install of module this.manager.installModule(ampLocation, warLocation, false, false, true); 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"); files.add("/images/test.jpg"); files.add("/css/test.css"); files.add("/extra.txt"); checkForFileExistance(warLocation, files); }
manager.installModule(aepFileLocation, warFileLocation, previewInstall, forceInstall, backup);
this.manager.installModule(testAmpV1Location, warLocation, false, false, false); this.manager.installModule(testAmpDepV1Location, warLocation, false, false, false); this.manager.installModule(testAmpDepV2Location, warLocation, false, false, false); fail("Failed to detect inadequate dependency on the test amp"); this.manager.installModule(testAmpV2Location, warLocation, false, false, false); this.manager.installModule(testAmpDepV2Location, warLocation, false, false, false);
manager.installModule(aepFileLocation, warFileLocation, previewInstall, forceInstall, backup);
public void testExistingFilesInWar() throws Exception { manager.setVerbose(true); String warLocation = getFileLocation(".war", "module/test.war"); //Version 4.0.1 String ampLocation = getFileLocation(".amp", "module/test_v4.amp"); try { this.manager.installModule(ampLocation, warLocation, false, false, true); } catch(ModuleManagementToolException exception) { assertTrue(exception.getMessage().contains("will overwrite an existing file in the war")); } this.manager.installModule(ampLocation, warLocation, false, true, true); //Now force it checkContentsOfFile(warLocation + "/jsp/relogin.jsp", "VERSIONONE"); checkContentsOfFile(warLocation + "/css/main.css", "p{margin-bottom:1em;}"); this.manager.installModule(ampLocation, warLocation, false, true, false); //install it again }
public void testNoWar() throws Exception { String noWar = "noWar"; String ampLocation = getFileLocation(".amp", "module/test_v1.amp"); try { this.manager.installModule(ampLocation, noWar,false,false, false); } catch (ModuleManagementToolException exception) { assertTrue(exception.getMessage().endsWith("does not exist.")); } try { this.manager.installModule(ampLocation, noWar,false,false, true); //backup war } catch (ModuleManagementToolException exception) { assertTrue(exception.getMessage().endsWith("does not exist.")); } }
public void testPreviewInstall() 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, true, false, true); // 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); }
this.manager.installModule(ampLocation, warLocation, false, false, false); //not forced fail("Failed to detect existing files in the amp"); this.manager.installModule(ampLocation, warLocation, false, true, false); //install v1 this.manager.installModule(ampv2Location, warLocation, false, true, false); //install v2 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);
mmt.installModule( getSourceFile().getAbsolutePath(), destLocation.getAbsolutePath(),
private void installerSharedTests(String warLocation, String ampLocation, String ampV2Location) this.manager.installModule(ampLocation, warLocation); this.manager.installModule(ampLocation, warLocation); this.manager.installModule(ampV2Location, warLocation); this.manager.installModule(ampLocation, warLocation);
public void testBasicFolderInstall() throws Exception { manager.setVerbose(true); String warDirectory = extractToDir(".war", "module/test.war"); String ampDirectory = extractToDir(".amp", "module/test_v1.amp"); String ampV2Directory = getFileLocation(".amp", "module/test_v2.amp"); assertNotNull(warDirectory); assertNotNull(ampDirectory); assertNotNull(ampV2Directory); installerSharedTests(warDirectory, ampDirectory, ampV2Directory); //Now try it on share warDirectory = extractToDir(".war", "module/share-3.4.11.war"); assertNotNull(warDirectory); assertNotNull(ampDirectory); this.manager.installModule(ampDirectory, warDirectory); warDirectory = extractToDir(".war", "module/share-4.2.a.war"); assertNotNull(warDirectory); String ampV2Location = getFileLocation(".amp", "module/test_v6.amp"); this.manager.installModule(ampV2Location, warDirectory); }
assertEquals(details.size(), 0); this.manager.installModule(ampLocation, warLocation); assertEquals("1.0", aModule.getModuleVersionNumber().toString()); this.manager.installModule(ampV2Location, warLocation); String testAmp7 = getFileLocation(".amp", "module/test_v7.amp"); this.manager.installModule(testAmpDepV2Location, warLocation, false, true, false); this.manager.installModule(testAmp7, warLocation, false, true, false);