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)
{
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 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);