0

I'm trying to run JUnit tests directly in IntelliJ. Problem is, my project is a Maven multi-module project using Spring.

Here my main application-context file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

        <!-- Spring : Chargement des contextes de l'application -->
        <import resource="classpath*:spring/applicationContext-spring.xml"/>
        <import resource="classpath*:spring/applicationContext-fwk.xml"/>
        <import resource="classpath*:spring/applicationContext-model.xml"/>
        <import resource="classpath*:spring/applicationContext-service.xml"/>
        <import resource="classpath*:spring/applicationContext-facade.xml"/>
        <import resource="classpath*:spring/applicationContext-web.xml"/>

</beans>

My JUnit test is in a sub-project unable to access directly applicationContext-fwk.xml, but it needs beans from that context. And of course, the tests should still be running fine with Maven. How could it be done?

Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124

0 Answers0