[ https://jira.codehaus.org/browse/SUREFIRE-620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tibor Digana reassigned SUREFIRE-620: ------------------------------------- Assignee: Tibor Digana > Ability to access manifest resource while running unit tests > ------------------------------------------------------------ > > Key: SUREFIRE-620 > URL: https://jira.codehaus.org/browse/SUREFIRE-620 > Project: Maven Surefire > Issue Type: Improvement > Components: Junit 4.x support, Maven Surefire Plugin > Affects Versions: 2.5 > Environment: n/a > Reporter: Ernst de Haan > Assignee: Tibor Digana > Priority: Minor > > Use case: > - my code calls getClass().getPackage().getImplementationVersion() to > determine the version specified in the manifest > - I would like to test this code, for example making sure the returned string > is not null > Currently, when I run "mvn test" it does not generate the JAR, nor does it > not make the META-INF/MANIFEST.MF file available in the classpath. > First question is whether this is a *unit* test or an *integration* test. I > would say a unit test, because no other code bases are involved, this should > be within a single module, and not testing any dependencies. > Secondly, is the test valid at all if it uses a resource. I would say "yes", > because it is even standard functionality offered by J2SE and I consider this > a good approach to determining meta data from the codebase self. > Thirdly, should the Surefire plugin depend on the JAR being created or should > it just generate the manifest (and copy/generate other resources?) and stick > them where the compiled classes go? -- This message was sent by Atlassian JIRA (v6.1.6#6162)