deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dessie K <desmond.kirr...@gmail.com>
Subject Re: deltaspike set ProjectStage in unit test
Date Mon, 19 Oct 2015 17:40:34 GMT
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.
> >
>

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