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
This commit is contained in:
Derek Hulley
2013-07-09 14:03:20 +00:00
parent 5c06b15604
commit 3184f8fa8b
2 changed files with 19 additions and 16 deletions

View File

@@ -135,7 +135,7 @@ public class ModuleComponentHelper
public void setApplyToTenants(boolean applyToTenants) 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");
} }
/** /**

View File

@@ -80,7 +80,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase
}; };
private RegistryService registryService; private RegistryService registryService;
private TenantAdminService tenantDeployerService; private TenantAdminService tenantAdminService;
private DescriptorService descriptorService; private DescriptorService descriptorService;
private DummyModuleService moduleService; private DummyModuleService moduleService;
private ModuleComponentHelper helper; private ModuleComponentHelper helper;
@@ -92,7 +92,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase
super.setUp(); super.setUp();
registryService = (RegistryService) ctx.getBean("RegistryService"); registryService = (RegistryService) ctx.getBean("RegistryService");
tenantDeployerService = (TenantAdminService) ctx.getBean("tenantAdminService"); tenantAdminService = (TenantAdminService) ctx.getBean("tenantAdminService");
descriptorService = serviceRegistry.getDescriptorService(); descriptorService = serviceRegistry.getDescriptorService();
@@ -102,7 +102,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase
helper.setRegistryService(registryService); helper.setRegistryService(registryService);
helper.setServiceRegistry(serviceRegistry); helper.setServiceRegistry(serviceRegistry);
helper.setDescriptorService(descriptorService); helper.setDescriptorService(descriptorService);
helper.setTenantAdminService(tenantDeployerService); helper.setTenantAdminService(tenantAdminService);
// Register the components // Register the components
components = new DummyModuleComponent[3][3]; // i,j components = new DummyModuleComponent[3][3]; // i,j
@@ -118,7 +118,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase
component.setServiceRegistry(serviceRegistry); component.setServiceRegistry(serviceRegistry);
component.setAuthenticationComponent(authenticationComponent); component.setAuthenticationComponent(authenticationComponent);
component.setModuleService(moduleService); component.setModuleService(moduleService);
component.setTenantAdminService(tenantDeployerService); component.setTenantAdminService(tenantAdminService);
// Don't initialize the component as that will do the registration. We do it manually. // Don't initialize the component as that will do the registration. We do it manually.
helper.registerComponent(component); helper.registerComponent(component);
// Add to array // Add to array
@@ -141,17 +141,20 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase
moduleService.setCurrentVersion(moduleVersion); moduleService.setCurrentVersion(moduleVersion);
// Start them // Start them
helper.startModules(); helper.startModules();
int tenantCount = 0; // ALF-19207: MT module startup does not work
if (tenantDeployerService.isEnabled()) // int tenantCount = 0;
{ // if (tenantDeployerService.isEnabled())
tenantCount = tenantDeployerService.getTenants(true).size(); // {
} // tenantCount = tenantDeployerService.getTenants(true).size();
// }
// // Check
// assertEquals(
// "Incorrent number of executions (version " + moduleVersion + ")",
// expectedCount + (expectedCount * tenantCount),
// executed);
// Check // Check
assertEquals( assertEquals("Incorrent number of executions (version " + moduleVersion + ")", expectedCount, executed);
"Incorrent number of executions (version " + moduleVersion + ")",
expectedCount + (expectedCount * tenantCount),
executed);
} }
public void testStartComponentsV00() public void testStartComponentsV00()
@@ -286,7 +289,7 @@ public class ModuleComponentHelperTest extends BaseAlfrescoTestCase
super.setServiceRegistry(serviceRegistry); super.setServiceRegistry(serviceRegistry);
super.setAuthenticationComponent(authenticationComponent); super.setAuthenticationComponent(authenticationComponent);
super.setModuleService(moduleService); super.setModuleService(moduleService);
super.setTenantAdminService(tenantDeployerService); super.setTenantAdminService(tenantAdminService);
super.setModuleId(moduleId); super.setModuleId(moduleId);
super.setName(name); super.setName(name);