You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Falko Modler (JIRA)" <ji...@apache.org> on 2016/05/30 07:14:13 UTC

[jira] [Commented] (DELTASPIKE-1116) allow conditional injection-point customization in test-classes

    [ https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306322#comment-15306322 ] 

Falko Modler commented on DELTASPIKE-1116:
------------------------------------------

[~gpetracek]: Works as expected, thanks!

> allow conditional injection-point customization in test-classes
> ---------------------------------------------------------------
>
>                 Key: DELTASPIKE-1116
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: TestControl
>    Affects Versions: 1.6.0
>         Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Falko Modler
>            Assignee: Gerhard Petracek
>            Priority: Minor
>             Fix For: 1.6.1
>
>         Attachments: DELTASPIKE-1116.zip
>
>
> {{CdiTestRunner}} first injects into {{@Inject}} fields of the test class in {{CdiTestRunner.createTest()}}. I'm absolutely fine with that as this makes it possible to use injected beans in a {{@Before}} method or even in a JUnit {{TestRule}}.
> But shortly before executing the actual test method, {{CdiTestRunner.ContainerAwareMethodInvoker.evaluate()}} *injects again*, overwriting any changes that have been made to the fields in a JUnit {{TestRule}} or a {{@Before}} method in the test.
> The second injection was introduced by DELTASPIKE-342:
> https://git-wip-us.apache.org/repos/asf?p=deltaspike.git;a=commitdiff;h=2d44e7d2980f8ab0b0a2a388255c0f0944c85098
> I don't know why there needs to be a second injection at all.
> All tests pass when I remove the second {{BeanProvider.injectFields(...)}}.
> PS: {{deltaspike.testcontrol.use_test_class_as_cdi_bean}} is {{false}}, which is the default value.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)