-
1. Loading a TestCase's Configuration failed
magnus.smith May 12, 2011 12:42 PM (in response to qtrin)If you have your properties file in your src/test/resources directory then you should be able to load it through the classloader by just using the simple filename.
Anything in src/test/resource should be on you test classpath at runtime - so won't need to add it to the archive.
-
2. Loading a TestCase's Configuration failed
qtrin May 13, 2011 12:22 AM (in response to magnus.smith)Hello Magnus,
It doesn't work. If i debug my TestCase then i see that the setup run in the container (remote jboss 5.1) and it load the resources from my test ear.
-
3. Loading a TestCase's Configuration failed
aslak May 13, 2011 4:29 AM (in response to qtrin)Try using the Thread.getCurrentThread.get Contexts class loader
-
4. Re: Loading a TestCase's Configuration failed
qtrin May 13, 2011 9:30 AM (in response to aslak)I have the mistake. I am working under Window and use a generic method to add all resources under a given directory like
File dir = new File(directory);
final File[] file = dir.listFiles();
for (File file: files) {
target = trimOffTheRootPath(file.getAbsolutePath());
archive.addAsResource(file, target);
}
target has the format 'resources\com\xyz\XYZTestCase.properties', because File.separtor under Windows is '\'.
At runtime i retrieve the resource by using
loader.getResourceAsStream("resources/com/xyz/XYZTestCase.properties");
and get nothing.
Is it not a mistake of archive.addAsResource(). It should normalize the target before uses it as name for the corresponding ZipEntry? -
5. Re: Loading a TestCase's Configuration failed
aslak Jun 12, 2011 11:12 AM (in response to qtrin)I don't have access to a windows box atm, but if you can create a test case for the ShrinkWrap issue showing how it is not working on Windows and create a issue at https://issues.jboss.org/browse/SHRINKWRAP we'll have a look.
-
6. Re: Loading a TestCase's Configuration failed
alrubinger Jun 14, 2011 4:12 PM (in response to aslak) -
7. Re: Loading a TestCase's Configuration failed
davided80 Jun 19, 2011 10:47 AM (in response to qtrin)Hi,
this issue should be fixed now: https://github.com/shrinkwrap/shrinkwrap/pull/18
Best regards,
Davide