Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

93988: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      93891: MNT-13089: RepoAdminServiceImplTest hangs on SQL Server
         - Disabled SubscriptionServiceActivitiesTest.testFollowingActivity and MultiTServiceImplTest.testGetUserDomain in case of MS SQL Server.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@95028 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 15:28:53 +00:00
parent ab8fb3979d
commit 35771b4879
2 changed files with 23 additions and 1 deletions

View File

@@ -58,6 +58,8 @@ import org.alfresco.util.test.junitrules.TemporarySites;
import org.apache.commons.lang.mutable.MutableInt; import org.apache.commons.lang.mutable.MutableInt;
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.Dialect;
import org.hibernate.dialect.SQLServerDialect;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONTokener; import org.json.JSONTokener;
@@ -114,7 +116,8 @@ public class SubscriptionServiceActivitiesTest
protected static FeedGenerator feedGenerator; protected static FeedGenerator feedGenerator;
protected static RetryingTransactionHelper transactionHelper; protected static RetryingTransactionHelper transactionHelper;
protected static NodeArchiveService nodeArchiveService; protected static NodeArchiveService nodeArchiveService;
protected static Dialect dialect;
private static Scheduler QUARTZ_SCHEDULER; private static Scheduler QUARTZ_SCHEDULER;
// Test Sites - these are all created by USER_ONE & hence USER_ONE is the SiteManager. // Test Sites - these are all created by USER_ONE & hence USER_ONE is the SiteManager.
@@ -143,6 +146,7 @@ public class SubscriptionServiceActivitiesTest
contentService = (ContentService) ctx.getBean("ContentService"); contentService = (ContentService) ctx.getBean("ContentService");
nodeArchiveService = (NodeArchiveService)ctx.getBean("nodeArchiveService"); nodeArchiveService = (NodeArchiveService)ctx.getBean("nodeArchiveService");
transactionHelper = (RetryingTransactionHelper) ctx.getBean("retryingTransactionHelper"); transactionHelper = (RetryingTransactionHelper) ctx.getBean("retryingTransactionHelper");
dialect = (Dialect) ctx.getBean("dialect");
ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory) ctx.getBean("ActivitiesFeed"); ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory) ctx.getBean("ActivitiesFeed");
ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext(); ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext();
@@ -232,6 +236,13 @@ public class SubscriptionServiceActivitiesTest
@Test public void testFollowingActivity() throws Exception @Test public void testFollowingActivity() throws Exception
{ {
// disable in case of SQL Server
// see MNT-13089
if (dialect instanceof SQLServerDialect)
{
return;
}
// We'll change things in the system in order to cause the generation of activity events and compare the feeds with these totals as we go. // We'll change things in the system in order to cause the generation of activity events and compare the feeds with these totals as we go.
// Initially, both users have zero activity feed entries. // Initially, both users have zero activity feed entries.
// Java's requirement for final modifiers on variables accessed within inner classes means we can't use simple ints here. // Java's requirement for final modifiers on variables accessed within inner classes means we can't use simple ints here.

View File

@@ -42,6 +42,8 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService; import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper; import org.alfresco.util.ApplicationContextHelper;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.SQLServerDialect;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@@ -65,6 +67,7 @@ public class MultiTServiceImplTest
private NodeService nodeService; private NodeService nodeService;
private SearchService searchService; private SearchService searchService;
private NamespaceService namespaceService; private NamespaceService namespaceService;
private Dialect dialect;
private UserTransaction txn; private UserTransaction txn;
@@ -113,6 +116,7 @@ public class MultiTServiceImplTest
nodeService = ctx.getBean("NodeService", NodeService.class); nodeService = ctx.getBean("NodeService", NodeService.class);
searchService = ctx.getBean("SearchService", SearchService.class); searchService = ctx.getBean("SearchService", SearchService.class);
namespaceService = ctx.getBean("NamespaceService", NamespaceService.class); namespaceService = ctx.getBean("NamespaceService", NamespaceService.class);
dialect = ctx.getBean("dialect", Dialect.class);
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName()); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
@@ -586,6 +590,13 @@ public class MultiTServiceImplTest
@Test @Test
public void testGetUserDomain() public void testGetUserDomain()
{ {
// disable in case of SQL Server
// see MNT-13089
if (dialect instanceof SQLServerDialect)
{
return;
}
String result = tenantService.getUserDomain(USER1); String result = tenantService.getUserDomain(USER1);
assertEquals("The user domain should be the default one for a non tenant user without a tenant in name.", TenantService.DEFAULT_DOMAIN, result); assertEquals("The user domain should be the default one for a non tenant user without a tenant in name.", TenantService.DEFAULT_DOMAIN, result);