I have a project as following:
Project
Project-A/
src/test/java/
someTests.java
src/test/resources
database/
create.sql
insert.sql
spring/
test-config.xml
project-B/
src/test/java
otherTests.java
pom.xml of Project-B:
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>Project-A</artifactId>
</dependency>
And in someTests.java, my configuration is:
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/webapp-config.xml", "classpath:spring/test-dao-config.xml" })
public class DacsDAOImplTest
I want to reuse test-config.xml, create.sql and insert.sql in otherTests.java.
I have already tried in otherTests.java
@ContextConfiguration(locations = {"classpath*:spring/test-dao-config.xml"})
But this doesn't seem to work...
Edit: Geoand's answer help, I have no more exception related to beans, but now I have a
FileNotFoundException: class path resource
[exception-messages.properties] cannot be opened because it does not
exist.
Since I don't understand exactly what changes have done, I don't know how to fix this...
exception-messages are used in webapp-config.xml as <context:property-placeholder location="classpath:exception-messages.properties" />