From 31872bfce74056ea5fbc919100dc91b29a230370 Mon Sep 17 00:00:00 2001 From: Dave Ward Date: Sun, 19 Feb 2012 11:19:12 +0000 Subject: [PATCH] ALF-12898: Fixed up merge git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34056 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/module/tool/WarHelperImplTest.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/source/java/org/alfresco/repo/module/tool/WarHelperImplTest.java b/source/java/org/alfresco/repo/module/tool/WarHelperImplTest.java index f48838e50b..b677b14b53 100644 --- a/source/java/org/alfresco/repo/module/tool/WarHelperImplTest.java +++ b/source/java/org/alfresco/repo/module/tool/WarHelperImplTest.java @@ -43,7 +43,7 @@ public class WarHelperImplTest extends WarHelperImpl @Test public void testCheckCompatibleVersion() { - File theWar = getFile(".war", "module/test.war"); //Version 4.0.1 + File theWar = getFile(".war", "module/test.war"); //Version 4.1.0 ModuleDetails installingModuleDetails = new ModuleDetailsImpl("test_it", new VersionNumber("9999"), "Test Mod", "Testing module"); installingModuleDetails.setRepoVersionMin(new VersionNumber("10.1")); @@ -74,9 +74,25 @@ public class WarHelperImplTest extends WarHelperImpl installingModuleDetails.setRepoVersionMax(new VersionNumber("99")); this.checkCompatibleVersion(theWar, installingModuleDetails); //does not throw exception - installingModuleDetails.setRepoVersionMin(new VersionNumber("4.0.1")); //current war version - installingModuleDetails.setRepoVersionMax(new VersionNumber("4.0.1")); //current war version + installingModuleDetails.setRepoVersionMin(new VersionNumber("4.1.0")); //current war version + installingModuleDetails.setRepoVersionMax(new VersionNumber("4.1.0")); //current war version this.checkCompatibleVersion(theWar, installingModuleDetails); //does not throw exception + + installingModuleDetails.setRepoVersionMin(new VersionNumber("3.4.0")); //current war version + installingModuleDetails.setRepoVersionMax(new VersionNumber("4.1.0")); //current war version + this.checkCompatibleVersion(theWar, installingModuleDetails); //does not throw exception + + try + { + installingModuleDetails.setRepoVersionMin(new VersionNumber("3.4.0")); //current war version + installingModuleDetails.setRepoVersionMax(new VersionNumber("4.0.999")); //current war version + this.checkCompatibleVersion(theWar, installingModuleDetails); //does not throw exception + fail("Should not pass as current version is 4.1.0 and the max value is 4.0.999"); //should never get here + } + catch (ModuleManagementToolException exception) + { + assertTrue(exception.getMessage().endsWith("cannot be installed on a repo version greater than 4.0.999")); + } } @Test