Help with Locations

(fabio.ebner) #1

Hi. can someone help me? i need to change where gradle will find my test class, i dont want to use ‘/src/test/java/’ i want to use src/teste/. another thing, i have my applicationContext.xml on my ‘WebContent/WEB-INF/arquivos/applicationContext.xml’ and when i try to run some test case i got FileNotFoundExeception because on my test class i use:

@RunWith(SpringJUnit4ClassRunner.class) @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class }) @ContextConfiguration(locations = “classpath:applicationContext.xml”)

how i fix this in gradle?


(Peter Niederwieser) #2

For how to change the source directory for tests, see the Gradle User Guide (look for information on “source sets”). The second question isn’t really related to Gradle. Only files in ‘WEB-INF/classes’ and ‘WEB-INF/lib’ are available on the class path. So one solution might be to move the application context into ‘src/main/resources’.