Details
Description
This worked in 1.0.4, but does not seem to work in 1.1-RC1. I'd like to load a file from the test/unit or test/integration directory via ClasspathResource. If there's a better place to put test files, let me know.
Here are the steps to re-create:
1. grails create-app fileloader
2. grails create-service FileLoader
3. add the following code to FileLoaderServiceTests.testSomething()
Resource resource = new ClassPathResource('file.txt')
File f = resource.getFile()
Reader r = f.newReader()
r.eachLine
4. create file file.txt in test/unit directory. contains a single line of text 'hello'
5. grails test-app fails w/ the following:
class path resource [file.txt] cannot be resolved to URL because it does not exist
java.io.FileNotFoundException: class path resource [file.txt] cannot be resolved to URL because it does not exist
I'd prefer a dedicated directory for resources, much like Maven has. Something like test/resources.