@Test public void testfindManifest() throws Exception { //Now check the compatible versions using the manifest TFile theWar = getFile(".war", "module/share-3.4.11.war"); Manifest manifest = this.findManifest(theWar); assertNotNull(manifest); assertEquals("Alfresco Share Enterprise", manifest.getMainAttributes().getValue(MANIFEST_IMPLEMENTATION_TITLE)); assertEquals("3.4.11", manifest.getMainAttributes().getValue(MANIFEST_SPECIFICATION_VERSION)); theWar = getFile(".war", "module/alfresco-4.2.a.war"); manifest = this.findManifest(theWar); assertNotNull(manifest); assertEquals("Alfresco Repository Community", manifest.getMainAttributes().getValue(MANIFEST_IMPLEMENTATION_TITLE)); assertEquals("4.2.a", manifest.getMainAttributes().getValue(MANIFEST_SPECIFICATION_VERSION)); }
/** * Tests to see if the war is a share war. */ @Test public void testIsShareWar() { TFile theWar = getFile(".war", "module/test.war"); //Version 4.1.0 assertFalse(this.isShareWar(theWar)); theWar = getFile(".war", "module/empty.war"); assertFalse(this.isShareWar(theWar)); theWar = getFile(".war", "module/alfresco-4.2.a.war"); assertFalse(this.isShareWar(theWar)); theWar = getFile(".war", "module/share-4.2.a.war"); assertTrue(this.isShareWar(theWar)); }
@Test public void testListModules() throws Exception { TFile theWar = getFile(".war", "module/test.war"); List<ModuleDetails> details = this.listModules(theWar); assertNotNull(details); assertEquals(details.size(), 0); theWar = getFile(".war", "module/share-4.2.a.war"); details = this.listModules(theWar); assertNotNull(details); assertEquals(details.size(), 1); ModuleDetails aModule = details.get(0); assertEquals("alfresco-mm-share", aModule.getId()); assertEquals("0.1.5.6", aModule.getModuleVersionNumber().toString()); assertEquals(ModuleInstallState.INSTALLED, aModule.getInstallState()); }
TFile theWar = getFile(".war", "module/share-3.4.11.war"); //enterprise edition theWar = getFile(".war", "module/share-4.2.a.war"); this.checkCompatibleEditionUsingManifest(theWar, installingModuleDetails); String propertiesLocation = getFile(".amp", "module/test_v5.amp") + "/module.properties"; installingModuleDetails = ModuleDetailsHelper.createModuleDetailsFromPropertyLocation(propertiesLocation); theWar = getFile(".war", "module/share-3.4.11.war"); this.checkCompatibleEdition(theWar, installingModuleDetails);//should succeed theWar = getFile(".war", "module/share-4.2.a.war"); this.checkCompatibleEdition(theWar, installingModuleDetails);
TFile theWar = getFile(".war", "module/test.war"); //Community Edition
@Test public void testNoVersionProperties() { TFile theWar = getFile(".war", "module/empty.war"); ModuleDetails installingModuleDetails = new ModuleDetailsImpl("test_it", new ModuleVersionNumber("9999"), "Test Mod", "Testing module"); installingModuleDetails.setRepoVersionMin(new VersionNumber("10.1")); this.checkCompatibleVersion(theWar, installingModuleDetails); //does not throw exception this.checkCompatibleEdition(theWar, installingModuleDetails); //does not throw exception }
TFile theWar = getFile(".war", "module/share-3.4.11.war"); ModuleDetails installingModuleDetails = new ModuleDetailsImpl("test_it", new ModuleVersionNumber("9999"), "Test Mod", "Testing module"); installingModuleDetails.setRepoVersionMin(new VersionNumber("10.1")); theWar = getFile(".war", "module/share-4.2.a.war"); installingModuleDetails = new ModuleDetailsImpl("test_it", new ModuleVersionNumber("9999"), "Test Mod", "Testing module"); installingModuleDetails.setRepoVersionMin(new VersionNumber("101.1")); theWar = getFile(".war", "module/alfresco-4.2.a.war");
@Test public void testCheckCompatibleVersion() TFile theWar = getFile(".war", "module/test.war"); //Version 4.1.0