deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Benevides <rbene...@redhat.com>
Subject Re: deltaspike set ProjectStage in unit test
Date Mon, 19 Oct 2015 18:01:03 GMT
Hi Dessie.

Maybe this code helps you to configure your Shrinkwrap deployment file:

https://github.com/apache/deltaspike/blob/master/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/SimpleRegistrationWarFileTest.java#L34-L46



On Mon, Oct 19, 2015 at 1:40 PM, Dessie K <desmond.kirrane@gmail.com> wrote:

> Ok I added META-INF/apache-deltaspike.properties
>
> Now I'm hitting a new issue picking up projectStage
>
> org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied
> dependencies for type [ProjectStage] with qualifiers [@Default] at
> injection point [[field] @Inject private
> com.avaya.ingensg.wa.common.cdi.config.AppConfigIT.projectStage]
> at
>
> org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
> at
>
> org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
> at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
> at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
> at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
> at
> org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
> at
>
> org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:380)
> at
>
> org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.TestContainer.startContainer(TestContainer.java:268)
> at
>
> org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer.deploy(WeldEEMockContainer.java:105)
>
>
> I've tried with a couple of different deployment configs but get the same
> error.
>
>
>     @Deployment
>     public static Archive<?> createDeployment() {
>         JavaArchive archive = ShrinkWrap.create(JavaArchive.class)
>                 .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
>                 .addAsResource(new
> File("src/test/resources/apache-deltaspike.properties"),
> "META-INF/apache-deltaspike.properties");
>         return archive;
>     }
>
>
>     @Deployment
>     public static Archive<?> createDeployment() {
>         WebArchive archive = ShrinkWrap.create(WebArchive.class)
>                 .addAsResource(new
> File("src/test/resources/apache-deltaspike.properties"),
> "META-INF/apache-deltaspike.properties")
>                 .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
>
>         PomEquippedResolveStage pom =
> Maven.resolver().loadPomFromFile("pom.xml");
>
>
> archive.addAsLibraries(pom.resolve("org.apache.deltaspike.core:deltaspike-core-api").withTransitivity().asFile());
>
>
> archive.addAsLibraries(pom.resolve("org.apache.deltaspike.core:deltaspike-core-impl").withTransitivity().asFile());
>
>         return archive;
>     }
>
>
>
>
> On Mon, Oct 19, 2015 at 4:34 PM, Gerhard Petracek <gpetracek@apache.org>
> wrote:
>
> > hi,
> >
> > that just works with ds-test-control.
> >
> > with arquillian, you have to add
> > META-INF/apache-deltaspike.properties
> > to your test-package
> > -> content: org.apache.deltaspike.ProjectStage=Development
> >
> > regards,
> > gerhard
> >
> >
> >
> > 2015-10-19 17:13 GMT+02:00 Dessie K <desmond.kirrane@gmail.com>:
> >
> > > Hi,
> > >
> > > I'm using arquillian+junit and I want to set the ProjectStage
> > > to Development for a test.
> > >
> > > I've tried
> > > add ProjectStageProducer.setProjectStage(ProjectStage.Development);
> > >
> > > But the test still uses the Production stage.
> > >
> >
>



-- 
*Rafael Benevides | Senior Software Engineer*
JBoss Developer Materials lead
M: +1-919-592-6255



Better technology. Faster innovation. Powered by community collaboration.
See how it works at www.redhat.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message