mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
93367: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud) 93292: Merged DEV (5.0.1) to 5.0.N (5.0.1) 93020: MNT-13089: RepoAdminServiceImplTest hangs on SQL Server Disabled org.alfresco.repo.admin.RepoAdminServiceImplTest#testConcurrentDynamicModelCreate in case of SQL Server. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94953 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -53,6 +53,7 @@ import org.alfresco.test_category.OwnJVMTestsCategory;
|
|||||||
import org.alfresco.util.ApplicationContextHelper;
|
import org.alfresco.util.ApplicationContextHelper;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.hibernate.dialect.*;
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
@@ -75,7 +76,8 @@ public class RepoAdminServiceImplTest extends TestCase
|
|||||||
private ContentService contentService;
|
private ContentService contentService;
|
||||||
private SearchService searchService;
|
private SearchService searchService;
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
|
private Dialect dialect;
|
||||||
|
|
||||||
final String modelPrefix = "model-";
|
final String modelPrefix = "model-";
|
||||||
final static String MKR = "{MKR}";
|
final static String MKR = "{MKR}";
|
||||||
|
|
||||||
@@ -117,7 +119,7 @@ public class RepoAdminServiceImplTest extends TestCase
|
|||||||
protected void setUp() throws Exception
|
protected void setUp() throws Exception
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
dialect = (Dialect) ctx.getBean("dialect");
|
||||||
repoAdminService = (RepoAdminService) ctx.getBean("RepoAdminService");
|
repoAdminService = (RepoAdminService) ctx.getBean("RepoAdminService");
|
||||||
dictionaryService = (DictionaryService) ctx.getBean("DictionaryService");
|
dictionaryService = (DictionaryService) ctx.getBean("DictionaryService");
|
||||||
transactionService = (TransactionService) ctx.getBean("TransactionService");
|
transactionService = (TransactionService) ctx.getBean("TransactionService");
|
||||||
@@ -579,41 +581,46 @@ public class RepoAdminServiceImplTest extends TestCase
|
|||||||
|
|
||||||
public void testConcurrentDynamicModelCreate() throws Exception
|
public void testConcurrentDynamicModelCreate() throws Exception
|
||||||
{
|
{
|
||||||
final int n = 2;
|
// disable in case of SQL Server
|
||||||
|
// see MNT-13089
|
||||||
undeployModels(n);
|
if (!(dialect instanceof SQLServerDialect))
|
||||||
|
|
||||||
int deployedModelCount = repoAdminService.getModels().size();
|
|
||||||
logger.info("Before deploy: deployed custom model count: "+deployedModelCount);
|
|
||||||
|
|
||||||
int dictModelCount = getModelCount();
|
|
||||||
logger.info("Before deploy: dictionary model count: "+dictModelCount);
|
|
||||||
|
|
||||||
// concurrently deploy N models
|
|
||||||
runConcurrentOps(n, 1);
|
|
||||||
|
|
||||||
int newDeployedModelCount = repoAdminService.getModels().size();
|
|
||||||
logger.info("After deploy: deployed custom model count: "+newDeployedModelCount);
|
|
||||||
assertEquals(deployedModelCount+n, newDeployedModelCount);
|
|
||||||
|
|
||||||
for (int i = 1; i <= n; i++)
|
|
||||||
{
|
{
|
||||||
assertTrue(isModelDeployed(modelPrefix+i));
|
final int n = 2;
|
||||||
|
|
||||||
|
undeployModels(n);
|
||||||
|
|
||||||
|
int deployedModelCount = repoAdminService.getModels().size();
|
||||||
|
logger.info("Before deploy: deployed custom model count: "+deployedModelCount);
|
||||||
|
|
||||||
|
int dictModelCount = getModelCount();
|
||||||
|
logger.info("Before deploy: dictionary model count: "+dictModelCount);
|
||||||
|
|
||||||
|
// concurrently deploy N models
|
||||||
|
runConcurrentOps(n, 1);
|
||||||
|
|
||||||
|
int newDeployedModelCount = repoAdminService.getModels().size();
|
||||||
|
logger.info("After deploy: deployed custom model count: "+newDeployedModelCount);
|
||||||
|
assertEquals(deployedModelCount+n, newDeployedModelCount);
|
||||||
|
|
||||||
|
for (int i = 1; i <= n; i++)
|
||||||
|
{
|
||||||
|
assertTrue(isModelDeployed(modelPrefix+i));
|
||||||
|
}
|
||||||
|
|
||||||
|
int newDictModelCount = getModelCount();
|
||||||
|
logger.info("After deploy: dictionary model count: "+newDictModelCount);
|
||||||
|
assertEquals(dictModelCount+n, newDictModelCount);
|
||||||
|
|
||||||
|
undeployModels(n);
|
||||||
|
|
||||||
|
newDeployedModelCount = repoAdminService.getModels().size();
|
||||||
|
logger.info("After undeploy: deployed custom model count: "+newDeployedModelCount);
|
||||||
|
assertEquals(deployedModelCount, newDeployedModelCount);
|
||||||
|
|
||||||
|
newDictModelCount = getModelCount();
|
||||||
|
logger.info("After undeploy: dictionary model count: "+newDictModelCount);
|
||||||
|
assertEquals(dictModelCount, newDictModelCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
int newDictModelCount = getModelCount();
|
|
||||||
logger.info("After deploy: dictionary model count: "+newDictModelCount);
|
|
||||||
assertEquals(dictModelCount+n, newDictModelCount);
|
|
||||||
|
|
||||||
undeployModels(n);
|
|
||||||
|
|
||||||
newDeployedModelCount = repoAdminService.getModels().size();
|
|
||||||
logger.info("After undeploy: deployed custom model count: "+newDeployedModelCount);
|
|
||||||
assertEquals(deployedModelCount, newDeployedModelCount);
|
|
||||||
|
|
||||||
newDictModelCount = getModelCount();
|
|
||||||
logger.info("After undeploy: dictionary model count: "+newDictModelCount);
|
|
||||||
assertEquals(dictModelCount, newDictModelCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConcurrentDynamicModelDelete() throws Exception
|
public void testConcurrentDynamicModelDelete() throws Exception
|
||||||
|
Reference in New Issue
Block a user