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().
This commit is contained in:
parent
1045a1a171
commit
26da1978f5
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue