Step one completed -- the resources are being built/copied correctly.
I used a little JUnit test to exercise the difference between using
ClassLoader.getSystemResourceAsStream() and Kierans suggestion above.
In Eclipse, both tests pass, but in Maven, the ClassLoader method fails, as
you're obser
Kieran Brady-2 wrote:
>
> this.getClass().getClassLoader().getResourceAsStream(...
>
> rather than using the system classloader and it works in both Eclipse and
> Maven.
>
Ah, beautiful - that does it! Thank you!
Out of interest, why does one work and the other not?
Martin
--
View this mes
Edelson, Justin wrote:
>
> Depending on how much flexability you have to move files around, I would
> suggest moving these property and xml files to src/test/resources and
> removing the testResources block entirely.
>
Yeah, I did that, actually; however, the maven testrunner still can't find
Martin Aspeli wrote:
>
> I have some unit tests that do things like this:
>
> InputStream stream =
> ClassLoader.getSystemResourceAsStream("TestDBSetup.properties");
> assertNotNull("Could not load TestDBSetup.properties from classpath",
> stream);
> Properties dbProperties = new Properties();
Oooppps, I misspoke...you have overridden the default test resources
directory, but I don't think you've done so correctly.
On 6/1/06, Doug Douglass <[EMAIL PROTECTED]> wrote:
On 6/1/06, Martin Aspeli <[EMAIL PROTECTED]> wrote:
>
> TestDBSetup.properties lives in src/main/test/resources.
>
>
On 6/1/06, Martin Aspeli <[EMAIL PROTECTED]> wrote:
TestDBSetup.properties lives in src/main/test/resources.
Martin,
I think your problem is that the above path is not the default test
resources location, and it appears you have not overridden this in your POM.
The default test resources di
Depending on how much flexability you have to move files around, I would
suggest moving these property and xml files to src/test/resources and
removing the testResources block entirely.
-Original Message-
From: Martin Aspeli [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 01, 2006 10:39 A
I use
this.getClass().getClassLoader().getResourceAsStream(...
rather than using the system classloader and it works in both Eclipse and
Maven.
HTH
- Original Message -
From: "Martin Aspeli" <[EMAIL PROTECTED]>
To:
Sent: Thursday, June 01, 2006 3:38 PM
Subject: Referencing .propert