Access MainConfig.xml directly. The contents of the src/test/resources directory are placed at the root of your CLASSPATH.
More precisely: the contents of src/test/resources copied to target/test-classes , so if you have the following project structure:
. └── src └── test ├── java │ └── foo │ └── C.java └── resources ├── a.xml └── foo └── b.xml
This will result in the following CLASSPATH test content:
/foo/C.class/a.xml/foo/b.xml
To access files from a Java source, use getClass().getResource("/MainConfig.xml").getFile() .
Tomasz Nurkiewicz Sep 30 '11 at 16:37 2011-09-30 16:37
source share