Unit tests depending on manifest

2010-05-24 Thread Ernst de Haan
How can I make sure the manifest file gets generated before the unit tests are executed? My use case is: - a Java code base, under src/main/java - unit tests under src/test/java - pom.xml specifies packaging jar - JUnit 4.8.1 is a dependency - Java code uses a property from the manifest to

Re: Unit tests depending on manifest

2010-05-24 Thread Wayne Fay
How can I make sure the manifest file gets generated before the unit tests are executed? - the unit tests attempt to validate that Java code, but the manifest file is not generated, it's only part of the JAR Instead of running that test in this module's build, add another module alongside

Re: Unit tests depending on manifest

2010-05-24 Thread Ernst de Haan
Wayne, How can I make sure the manifest file gets generated before the unit tests are executed? - the unit tests attempt to validate that Java code, but the manifest file is not generated, it's only part of the JAR Instead of running that test in this module's build, add another

Re: Unit tests depending on manifest

2010-05-24 Thread Justin Edelson
On 5/24/10 1:04 PM, Ernst de Haan wrote: Wayne, How can I make sure the manifest file gets generated before the unit tests are executed? - the unit tests attempt to validate that Java code, but the manifest file is not generated, it's only part of the JAR Instead of running that test

Re: Unit tests depending on manifest

2010-05-24 Thread Ernst de Haan
Instead of running that test in this module's build, add another module alongside it that depends on this artifact, and run this test there. It will bring in the jar which, as you said, has the manifest in it. You will need a parent pom as well over both modules, and always build your project

Re: Unit tests depending on manifest

2010-05-24 Thread kristian
run your tests after the package phase, i.e. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId version2.5/version executions execution phaseintegration-test/phase goals

Re: Unit tests depending on manifest

2010-05-24 Thread Stephen Connolly
better off using maven-failsafe-plugin for that On 24 May 2010 20:00, kristian m.krist...@web.de wrote: run your tests after the package phase, i.e. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId version2.5/version

Re: Unit tests depending on manifest

2010-05-24 Thread Ernst de Haan
better off using maven-failsafe-plugin for that Stephen, thanks for the pointer. Will give that a try. I was getting nowhere (yet) with all sorts of variants of the snippet Kristian sent. An alternative route is welcomed :) /me struggles on... Cheers, Ernst

Re: Unit tests depending on manifest

2010-05-24 Thread Ernst de Haan
better off using maven-failsafe-plugin for that How do I know for sure verify is using my JAR? I tried the failsafe plugin, but it still /appears/ to be using the classes, not the JAR, even from my new LibraryIT.java integration test. It does execute, but the test fails. Here's my POM for

Re: Unit tests depending on manifest

2010-05-24 Thread Stephen Connolly
failsafe is surefire just bound to theintegration-test phase. changing surefire to be bound to the integration-test phase can cause subtle issues as you use more plugins. we should be able to convince failsafe to use the jars if they are available... can you file an enhancement request in JIRA?

Re: Unit tests depending on manifest

2010-05-24 Thread Justin Edelson
On 5/24/10 5:54 PM, Ernst de Haan wrote: better off using maven-failsafe-plugin for that How do I know for sure verify is using my JAR? You could inspect the classloader. Something like: URLClassLoader ucl = (URLClassLoader) getClass().getClassLoader();