You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by Mark Nuttall <mn...@apache.org> on 2009/12/24 13:12:14 UTC
mvn unit test advice please
Hello,
Being new to maven, this is hopefully an easy question for some of the
experts here. I've just committed
trunk/application/application-utils/src/test/java/org/apache/aries/application/utils/manifest/test/BundleManifestTest.java
which while functional is a bit ugly. I need to write out some files in the
course of the test. Ideally I'd like these to go into the src/test/resources
directory. However it looks as though unit tests run by default in the
application-utils/target directory. Hence I have code like,
new FileOutputStream("../src/test/resources/bundles/nonExploded.jar")
whereas I'd prefer,
new FileOutputStream("bundles/nonExploded.jar")
with some appropriate mvn config. I can see that for input stream work, we
have examples such as this in ManifestProcessorTest
InputStream in =
getClass().getClassLoader().getResourceAsStream("META-INF/APPLICATION.MF");
this reads from src/test/resources - but I can't see that there's an
equivalent for output. Please advise me - can I fix this with a line of mvn
config? If so where's the best place for that? Many thanks in advance for
any advice.
Regards,
Mark