From 26da1978f5b0319ab02f71dc74082ded5ae5ef0a Mon Sep 17 00:00:00 2001 From: Oscar Gonzalez Fernandez Date: Wed, 29 May 2013 18:49:44 +0200 Subject: [PATCH] Use the same configuration as in other tests Otherwise it creates a new Spring context instead of keeping using the previous one. This doesn't seem specially dangerous, but in some circumstances can lead to idle transactions with associated locks that hang up the execution of the tests. This happened with PostgreSQL version 9.1 in WorkReportServiceTest.importValidDescriptionValuesToWorkReport(). --- .../web/test/ws/basecalendars/BaseCalendarServiceTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libreplan-webapp/src/test/java/org/libreplan/web/test/ws/basecalendars/BaseCalendarServiceTest.java b/libreplan-webapp/src/test/java/org/libreplan/web/test/ws/basecalendars/BaseCalendarServiceTest.java index 69b819ea5..f2b9642e9 100644 --- a/libreplan-webapp/src/test/java/org/libreplan/web/test/ws/basecalendars/BaseCalendarServiceTest.java +++ b/libreplan-webapp/src/test/java/org/libreplan/web/test/ws/basecalendars/BaseCalendarServiceTest.java @@ -25,7 +25,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.libreplan.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE; import static org.libreplan.web.WebappGlobalNames.WEBAPP_SPRING_CONFIG_FILE; +import static org.libreplan.web.WebappGlobalNames.WEBAPP_SPRING_SECURITY_CONFIG_FILE; import static org.libreplan.web.test.WebappGlobalNames.WEBAPP_SPRING_CONFIG_TEST_FILE; +import static org.libreplan.web.test.WebappGlobalNames.WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE; import static org.libreplan.web.test.ws.common.Util.getUniqueName; import java.util.ArrayList; @@ -73,9 +75,10 @@ import org.springframework.transaction.annotation.Transactional; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { BUSINESS_SPRING_CONFIG_FILE, - WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE }) + WEBAPP_SPRING_CONFIG_FILE, WEBAPP_SPRING_CONFIG_TEST_FILE, + WEBAPP_SPRING_SECURITY_CONFIG_FILE, + WEBAPP_SPRING_SECURITY_CONFIG_TEST_FILE }) @Transactional - public class BaseCalendarServiceTest { @Autowired