@Test public void testCheckCompatibleEditionUsingManifest() throws IOException { Properties props = dummyModuleProperties(); ModuleDetails installingModuleDetails = new ModuleDetailsImpl(props); TFile theWar = getFile(".war", "module/share-3.4.11.war"); // enterprise edition // Test for no edition specified this.checkCompatibleEditionUsingManifest( theWar, installingModuleDetails); // does not throw exception // Test for invalid edition props.setProperty(ModuleDetails.PROP_EDITIONS, "CommuniT"); installingModuleDetails = new ModuleDetailsImpl(props); try { this.checkCompatibleEditionUsingManifest(theWar, installingModuleDetails); fail(); // should never get here } catch (ModuleManagementToolException exception) { assertTrue( exception .getMessage() .endsWith("can only be installed in one of the following editions[CommuniT]")); } props.setProperty(ModuleDetails.PROP_EDITIONS, ("Enterprise")); // should ignore case installingModuleDetails = new ModuleDetailsImpl(props); this.checkCompatibleEditionUsingManifest( theWar, installingModuleDetails); // does not throw exception props.setProperty(ModuleDetails.PROP_EDITIONS, ("Community")); // should ignore case installingModuleDetails = new ModuleDetailsImpl(props); try { this.checkCompatibleEditionUsingManifest(theWar, installingModuleDetails); fail(); // should never get here } catch (ModuleManagementToolException exception) { assertTrue( exception .getMessage() .endsWith("can only be installed in one of the following editions[Community]")); } 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); try { this.checkCompatibleEdition(theWar, installingModuleDetails); fail(); // should never get here } catch (ModuleManagementToolException exception) { assertTrue( exception .getMessage() .endsWith("can only be installed in one of the following editions[Enterprise]")); } theWar = getFile(".war", "module/share-3.4.11.war"); this.checkCompatibleEdition(theWar, installingModuleDetails); // should succeed try { theWar = getFile(".war", "module/share-4.2.a.war"); this.checkCompatibleEdition(theWar, installingModuleDetails); fail(); // should never get here } catch (ModuleManagementToolException exception) { assertTrue( exception .getMessage() .endsWith("can only be installed in one of the following editions[Enterprise]")); } }