M
michau
Hi,
I'm testing a method which uses the following statement:
myObject.getClass().getClassLoader().getResourceAsStream("resource-
name1").
I have set a classpath element entry (in .classpath file for my
project), that specifies the location of this resource so that the
resource is found correctly. However for the purpose of testing I'm
using a different name of the resource (resource-name2) and I want to
place that resource in one of my folders allocated only for testing.
I know I could add another classpath entry to my .classpath file, that
would specify the location of resource-name2, but that would make it
visible to the whole project, whereas I would want that setting to be
only within "the scope" of junit tests. So do people know if it's
possible to somehow specify a classpath entry in my junit tests, or in
some junit properties?
Thanks for any help,
Michal.
I'm testing a method which uses the following statement:
myObject.getClass().getClassLoader().getResourceAsStream("resource-
name1").
I have set a classpath element entry (in .classpath file for my
project), that specifies the location of this resource so that the
resource is found correctly. However for the purpose of testing I'm
using a different name of the resource (resource-name2) and I want to
place that resource in one of my folders allocated only for testing.
I know I could add another classpath entry to my .classpath file, that
would specify the location of resource-name2, but that would make it
visible to the whole project, whereas I would want that setting to be
only within "the scope" of junit tests. So do people know if it's
possible to somehow specify a classpath entry in my junit tests, or in
some junit properties?
Thanks for any help,
Michal.