Thanks Jerome,
I have tried this but the main problem is that
if (forkMode=once) {
getResource() method does not looking for resources in
"test-clesses" folder
}else if (forkmode=never) {
getResource() method looking for resources in
"test-clesses" folder - as I want
}
So the question is how can I force surefire to search resources in
"test-classes" folder if forkMode=once.
So it does not looking for resources in "test-classes" folder neither with
getClass(), no with Thread.currentThread.getContextClassloader().
Jerome Lacoste-2 wrote:
>
> On Dec 18, 2007 8:21 PM, vetalok <[EMAIL PROTECTED]> wrote:
>>
>> Hi all
>> I have maven 2.0.7 and the latest surefire plugin.
>> Surefire can't find resource if forkMode=once ( if forkMode=never it
>> works)
>> Here is snip of code:
>> BaseStandaloneTest.class.getResource("/login.conf").toString();
>
> Class#getResource delegates to the class ClassLoader getResource method.
>
> I.e. the above code is similar to:
>
> BaseStandaloneTest.class.getClassLoader().getResource()...
>
> Try using the Context ClassLoader.
>
> i.e.
>
> Thread.currentThread().getContextClassLoader().getResource(....)
>
> J
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Surefire-can%27t-find-resource-if-forkMode%3Donce-tp14403769s177p14412956.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]