-
Enhancement
-
Resolution: Won't Do
-
Critical
-
None
-
None
-
None
-
None
Presume these 2 beans.xml files:
Production code: beans.xml:
<beans xmlns="http://java.sun.com/xml/ns/javaee" ...>
<!-- 100 lines that change regularly during development -->
</beans>
Test addition: test-beans.xml:
<beans xmlns="http://java.sun.com/xml/ns/javaee" ...> <alternatives> <class>org.drools.guvnor.server.repository.TestRepositoryStartupService</class> </alternatives> </beans>
Now, for non-test runs (such as in the IDE or in production), only the beans.xml is activated through weld and the test-only alternative should not be activated.
For test runs, the test-only alternative should be activated, yet the rest of the content from beans.xml should be in there too.
So it should be merged to something like this:
<beans xmlns="http://java.sun.com/xml/ns/javaee" ...> <!-- 100 lines that change regularly during development --> <alternatives> <class>org.drools.guvnor.server.repository.TestRepositoryStartupService</class> </alternatives> </beans>
It would be nice if we do something like mergeAsResource(), shown in this example:
public static WebArchive createDeployment() { WebArchive webArchive = ShrinkWrap.create(ExplodedImporter.class, "guvnor-webapp-5.3.0-SNAPSHOT.war") .importDirectory(new File("target/guvnor-webapp-5.3.0-SNAPSHOT/")) .as(WebArchive.class) .mergeAsResource(new File("target/test-classes/META-INF/test-beans.xml"), "META-INF/beans.xml") .addAsResource(new File("target/test-classes/"), ArchivePaths.create("")) .addAsLibraries( DependencyResolvers.use(MavenDependencyResolver.class) .includeDependenciesFromPom("pom.xml") .resolveAsFiles(new ScopeFilter("test"))); return webArchive; }
Because of maintenance, copying everything from beans.xml to test-beans.xml on every change to beans.xml is NOT an option.
- is blocked by
-
WELD-953 WEB-INF/beans.xml is ignored on jetty 6 (and GWT hosted mode)
-
- Resolved
-
- relates to
-
SHRINKWRAP-329 Arquillian should fail-fast when adding the same resource twice to an archive made with ExplodedImporter.class
-
- Closed
-