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

94232: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      94116: MNT-13089 Reinstate the tests that had been disabled on SQLServer, before we understood the problem was with transaction isolation
      Reverted following commits:
         93292: Disabled org.alfresco.repo.admin.RepoAdminServiceImplTest#testConcurrentDynamicModelCreate in case of SQL Server
         93342: Disabled org.alfresco.repo.admin.RepoAdminServiceImplTest#testConcurrentDynamicModelDelete in case of MS SQl Server.
         93522: Disabled org.alfresco.repo.node.archive.ArchiveAndRestoreTest#testInTransactionRestore and org.alfresco.repo.node.archive.ArchiveAndRestoreTest#testInTransactionPurge in case of MS SQL Server.
         93680: Disabled org.alfresco.repo.rendition.RenditionServiceIntegrationTest.testCompositeReformatAndResizeRendition in case of SQL Server
         93772: Disabled for MS SQL Server AuthenticationTest.testLoginNotExistingTenant, RenditionServiceIntegrationTest.testALF3733, RenditionServiceIntegrationTest.testJavascriptAPI.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@95059 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 15:35:56 +00:00
parent 1811553da1
commit 3929596255
5 changed files with 91 additions and 140 deletions

View File

@@ -53,7 +53,6 @@ import org.alfresco.test_category.OwnJVMTestsCategory;
import org.alfresco.util.ApplicationContextHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.dialect.*;
import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
@@ -76,7 +75,6 @@ public class RepoAdminServiceImplTest extends TestCase
private ContentService contentService;
private SearchService searchService;
private NamespaceService namespaceService;
private Dialect dialect;
final String modelPrefix = "model-";
final static String MKR = "{MKR}";
@@ -119,7 +117,7 @@ public class RepoAdminServiceImplTest extends TestCase
protected void setUp() throws Exception
{
super.setUp();
dialect = (Dialect) ctx.getBean("dialect");
repoAdminService = (RepoAdminService) ctx.getBean("RepoAdminService");
dictionaryService = (DictionaryService) ctx.getBean("DictionaryService");
transactionService = (TransactionService) ctx.getBean("TransactionService");
@@ -580,10 +578,6 @@ public class RepoAdminServiceImplTest extends TestCase
}
public void testConcurrentDynamicModelCreate() throws Exception
{
// disable in case of SQL Server
// see MNT-13089
if (!(dialect instanceof SQLServerDialect))
{
final int n = 2;
@@ -621,13 +615,8 @@ public class RepoAdminServiceImplTest extends TestCase
logger.info("After undeploy: dictionary model count: "+newDictModelCount);
assertEquals(dictModelCount, newDictModelCount);
}
}
public void testConcurrentDynamicModelDelete() throws Exception
{
// disable in case of SQL Server
// see MNT-13089
if (!(dialect instanceof SQLServerDialect))
{
final int n = 2;
@@ -662,7 +651,6 @@ public class RepoAdminServiceImplTest extends TestCase
assertEquals(dictModelCount, getModelCount());
}
}
private int getModelCount()
{

View File

@@ -58,8 +58,6 @@ import org.alfresco.test_category.OwnJVMTestsCategory;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.ScriptPagingDetails;
import org.alfresco.util.TestWithUserUtils;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.SQLServerDialect;
import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
@@ -91,7 +89,6 @@ public class ArchiveAndRestoreTest extends TestCase
private MutableAuthenticationService authenticationService;
private OwnableService ownableService;
private TransactionService transactionService;
private Dialect dialect;
private UserTransaction txn;
private StoreRef workStoreRef;
@@ -127,7 +124,6 @@ public class ArchiveAndRestoreTest extends TestCase
authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
ownableService = (OwnableService) ctx.getBean("ownableService");
transactionService = serviceRegistry.getTransactionService();
dialect = (Dialect) ctx.getBean("dialect");
// Start a transaction
txn = transactionService.getUserTransaction();
@@ -614,10 +610,6 @@ public class ArchiveAndRestoreTest extends TestCase
}
public void testInTransactionRestore() throws Exception
{
// disable in case of SQL Server
// see MNT-13089
if (!(dialect instanceof SQLServerDialect))
{
RestoreNodeReport report = nodeArchiveService.restoreArchivedNode(a_);
// expect a failure due to missing archive node
@@ -625,19 +617,13 @@ public class ArchiveAndRestoreTest extends TestCase
// check that our transaction was not affected
assertEquals("Transaction should still be valid", Status.STATUS_ACTIVE, txn.getStatus());
}
}
public void testInTransactionPurge() throws Exception
{
// disable in case of SQL Server
// see MNT-13089
if (!(dialect instanceof SQLServerDialect))
{
nodeArchiveService.purgeArchivedNode(a_);
// the node should still be there (it was not available to the purge transaction)
assertEquals("Transaction should still be valid", Status.STATUS_ACTIVE, txn.getStatus());
}
}
private void commitAndBeginNewTransaction() throws Exception
{

View File

@@ -2002,12 +2002,9 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
public void testALF3733() throws Exception
{
// disable in case of SQL Server
// see MNT-13089
if (dialect instanceof SQLServerDialect)
{
return;
}
setComplete();
endTransaction();
// ALF-3733 was caused by ${cwd} evaluating to the empty string and a path "//sourceNodeName"
// being passed to the FileFolderService for creation. This then splits the string using '/' as
// a delimiter which leads to the attempted creation of nodes with the empty string as a name,
@@ -2469,12 +2466,8 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
public void testJavascriptAPI() throws Exception
{
// disable in case of SQL Server
// see MNT-13089
if (dialect instanceof SQLServerDialect)
{
return;
}
setComplete();
endTransaction();
Map<String, Object> model = new HashMap<String, Object>();
model.put("testSourceNode", this.nodeWithImageContent);

View File

@@ -384,32 +384,18 @@ public class RenditionServicePermissionsTest
testSiteInfo.doclib,
"quick.jpg",
AuthenticationUtil.getFullyAuthenticatedUser());
return imgNode;
}
});
// This is what ScriptNode.createThumbnail does
final ThumbnailDefinition details = thumbnailRegistry.getThumbnailDefinition("doclib");
final Action action = transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Action>()
{
@Override
public Action execute() throws Throwable
{
return ThumbnailHelper.createCreateThumbnailAction(details, services);
}
});
ThumbnailDefinition details = thumbnailRegistry.getThumbnailDefinition("doclib");
Action action = ThumbnailHelper.createCreateThumbnailAction(details, services);
transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
// Creation of thumbnail
services.getActionService().executeAction(action, imgNode, true, false);
// The node in question should now have a thumbnail/rendition.
assertEquals(1, renditionService.getRenditions(imgNode).size());
return null;
return imgNode;
}
});

View File

@@ -72,7 +72,6 @@ import org.alfresco.test_category.OwnJVMTestsCategory;
import org.alfresco.util.ApplicationContextHelper;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
import org.springframework.extensions.webscripts.GUID;
@@ -1733,12 +1732,11 @@ public class AuthenticationTest extends TestCase
public void testLoginNotExistingTenant() throws Exception
{
// disable in case of SQL Server
// split the transactions to pass on SQL Server
// see MNT-13089
if (dialect instanceof SQLServerDialect)
{
return;
}
userTransaction.commit();
userTransaction = transactionService.getUserTransaction();
userTransaction.begin();
boolean wasEnabled = AuthenticationUtil.isMtEnabled();
try