deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: A question on ProjectStage and CdiTestSuiteRunner
Date Wed, 12 Oct 2016 19:22:53 GMT
hi ludovic,

it isn't intended, however, what you can do is e.g.:

@RunWith(CdiTestRunner.class)
@TestControl(projectStage = ProjectStage.UnitTest.class)
public class UTTest
{
    @Test
    public void case1()
    {
        //project-stage unit-test is active
    }
}

@RunWith(CdiTestRunner.class)
@TestControl(projectStage = ProjectStage.IntegrationTest.class)
public class ITTest extends UTTest
{
    //project-stage integration-test is active
    //(no test-methods here, because you would like to re-use the
test-methods provided by UTTest)
}

->

@RunWith(CdiTestSuiteRunner.class)
@Suite.SuiteClasses({UTTest.class})
public class UTTestSuite {
}

and

@RunWith(CdiTestSuiteRunner.class)
@Suite.SuiteClasses({ITTest.class})
public class ITTestSuite {
}

regards,
gerhard



2016-10-12 14:00 GMT+02:00 l.penet@senat.fr <l.penet@senat.fr>:

> Hi,
>
>
> I have a question on using ProjectStage in test to discriminate UnitTest
> and IntegrationTest.
>
> It seems to me that in previous releases of DS, I could set the project
> stage in tests using the system property org.apache.deltaspike.ProjectS
> tage.
>
> Today, when I launch tests driven by the CdiTestSuiteRunner, it overrrides
> this setting. I can of course set it using an annotation, but I use the
> same tests configuration for unit test and integration test, so I would
> like to be able to do that with properties.
>
> Thanks in advance,
>
> Ludovic
>
>
> |
> | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
> |
>
>

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