You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sidart Kurias <si...@yahoo.com> on 2006/03/09 15:29:00 UTC
m2:Locating testdata
Hi
I am using Jtestcase to define testdata in an xml
file. Jtestcase will try to find the xml defining the
data either by using the file name, or if that fails
using the classpath. Currently my tests use the
classpath to locate the xml files. These xmls reside
under src/test/resources.
How do I get this directory to be part of my
classpath. I have to assume that it is not part of my
classpath, since the tests cannot find the data
files.
I am using maven 2.0.2 .
I do have the following in my pom,
<testResources>
<testResource>
<directory>src/test/resources/</directory>
<targetPath>target/test</target> (same as
testOutputDirectory)
</testResource>
but it seems not to do what I want. I want it to be
able to locate the resource while the test is run. I
could always provide the path name, but would prefer
that I pick it up from the classpath. Any suggestions
on what I should do are welcome.
Thanks
Sid
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: m2:Locating testdata
Posted by Sidart Kurias <si...@yahoo.com>.
As an update I noticed that if you put a value under
targetPath, it creates a directory with that value
under testOutputDirectory specified in the build tag.
So I removed the targetPath information, since maven
put the files in the right place. I still cannot find
the files.
Sid
--- Sidart Kurias <si...@yahoo.com> wrote:
> Hi
>
> I am using Jtestcase to define testdata in an xml
> file. Jtestcase will try to find the xml defining
> the
> data either by using the file name, or if that fails
> using the classpath. Currently my tests use the
> classpath to locate the xml files. These xmls
> reside
> under src/test/resources.
> How do I get this directory to be part of my
> classpath. I have to assume that it is not part of
> my
> classpath, since the tests cannot find the data
> files.
>
> I am using maven 2.0.2 .
>
> I do have the following in my pom,
>
> <testResources>
> <testResource>
>
> <directory>src/test/resources/</directory>
> <targetPath>target/test</target> (same as
> testOutputDirectory)
> </testResource>
>
> but it seems not to do what I want. I want it to be
> able to locate the resource while the test is run. I
> could always provide the path name, but would prefer
> that I pick it up from the classpath. Any
> suggestions
> on what I should do are welcome.
>
> Thanks
> Sid
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> For additional commands, e-mail:
> users-help@maven.apache.org
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org