From 3184f8fa8b301bcc00cf54bc4a84a3c33d84f8a0 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Tue, 9 Jul 2013 14:03:20 +0000 Subject: [PATCH] Merged DEV to HEAD 52250: ALF-19207: MT module startup does not work - Any attempt to force modules to start for all tenants will be met with an UnsupportedOperationException - Any fix will have to be part of ALF-18954 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@52291 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/module/ModuleComponentHelper.java | 2 +- .../module/ModuleComponentHelperTest.java | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/source/java/org/alfresco/repo/module/ModuleComponentHelper.java b/source/java/org/alfresco/repo/module/ModuleComponentHelper.java index b0d83abefd..b89ee7d00a 100644 --- a/source/java/org/alfresco/repo/module/ModuleComponentHelper.java +++ b/source/java/org/alfresco/repo/module/ModuleComponentHelper.java @@ -135,7 +135,7 @@ public class ModuleComponentHelper public void setApplyToTenants(boolean applyToTenants) { - this.applyToTenants = applyToTenants; + throw new UnsupportedOperationException("Applying modules to individual tenants is unsupported. See ALF-19207: MT module startup does not work"); } /** diff --git a/source/java/org/alfresco/repo/module/ModuleComponentHelperTest.java b/source/java/org/alfresco/repo/module/ModuleComponentHelperTest.java index b057ca05ec..0e1073045a 100644 --- a/source/java/org/alfresco/repo/module/ModuleComponentHelperTest.java +++ b/source/java/org/alfresco/repo/module/ModuleComponentHelperTest.java @@ -80,7 +80,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase }; private RegistryService registryService; - private TenantAdminService tenantDeployerService; + private TenantAdminService tenantAdminService; private DescriptorService descriptorService; private DummyModuleService moduleService; private ModuleComponentHelper helper; @@ -92,7 +92,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase super.setUp(); registryService = (RegistryService) ctx.getBean("RegistryService"); - tenantDeployerService = (TenantAdminService) ctx.getBean("tenantAdminService"); + tenantAdminService = (TenantAdminService) ctx.getBean("tenantAdminService"); descriptorService = serviceRegistry.getDescriptorService(); @@ -102,7 +102,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase helper.setRegistryService(registryService); helper.setServiceRegistry(serviceRegistry); helper.setDescriptorService(descriptorService); - helper.setTenantAdminService(tenantDeployerService); + helper.setTenantAdminService(tenantAdminService); // Register the components components = new DummyModuleComponent[3][3]; // i,j @@ -118,7 +118,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase component.setServiceRegistry(serviceRegistry); component.setAuthenticationComponent(authenticationComponent); component.setModuleService(moduleService); - component.setTenantAdminService(tenantDeployerService); + component.setTenantAdminService(tenantAdminService); // Don't initialize the component as that will do the registration. We do it manually. helper.registerComponent(component); // Add to array @@ -141,17 +141,20 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase moduleService.setCurrentVersion(moduleVersion); // Start them helper.startModules(); - - int tenantCount = 0; - if (tenantDeployerService.isEnabled()) - { - tenantCount = tenantDeployerService.getTenants(true).size(); - } + +// ALF-19207: MT module startup does not work +// int tenantCount = 0; +// if (tenantDeployerService.isEnabled()) +// { +// tenantCount = tenantDeployerService.getTenants(true).size(); +// } +// // Check +// assertEquals( +// "Incorrent number of executions (version " + moduleVersion + ")", +// expectedCount + (expectedCount * tenantCount), +// executed); // Check - assertEquals( - "Incorrent number of executions (version " + moduleVersion + ")", - expectedCount + (expectedCount * tenantCount), - executed); + assertEquals("Incorrent number of executions (version " + moduleVersion + ")", expectedCount, executed); } public void testStartComponentsV00() @@ -286,7 +289,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase super.setServiceRegistry(serviceRegistry); super.setAuthenticationComponent(authenticationComponent); super.setModuleService(moduleService); - super.setTenantAdminService(tenantDeployerService); + super.setTenantAdminService(tenantAdminService); super.setModuleId(moduleId); super.setName(name);