ACS-1033 : Spring upgrade to 5.3.2 (#213)

- Update test as per 5de549d7d4
- before spring 5.3.0, AbstractFallbackSQLExceptionTranslator was translating org.postgresql.util.PSQLException as UncategorizedSQLException - now it returns null (ref. e9cded560d (diff-c6aa1c6a4b11e8a722808e945c4c5b6ef471c42871c7ce830554dde81ad7f2c2L89))

Co-authored-by: CezarLeahu <35226487+CezarLeahu@users.noreply.github.com>
This commit is contained in:
Denis Ungureanu
2020-12-23 12:21:03 +02:00
committed by GitHub
parent a79f782a91
commit f786f4ffaf
4 changed files with 23 additions and 11 deletions

View File

@@ -29,8 +29,6 @@ import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.UserTransaction;
import junit.framework.TestCase;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.domain.dialect.Dialect;
import org.alfresco.repo.domain.dialect.PostgreSQLDialect;
@@ -45,17 +43,12 @@ import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.ReadOnlyServerException;
import org.alfresco.test_category.OwnJVMTestsCategory;
import org.alfresco.util.ApplicationContextHelper;
import org.alfresco.util.BaseSpringTest;
import org.alfresco.util.PropertyMap;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.dao.TransientDataAccessResourceException;
import org.springframework.jdbc.UncategorizedSQLException;
import org.springframework.transaction.PlatformTransactionManager;
/**
@@ -192,7 +185,7 @@ public class TransactionServiceImplTest extends BaseSpringTest
@SuppressWarnings("unused")
int i = 0;
}
catch (UncategorizedSQLException e)
catch (Exception e)
{
// or this - for PostgreSQL (org.postgresql.util.PSQLException: ERROR: transaction is read-only)
if (dialect instanceof PostgreSQLDialect)