[jira] [Updated] (DELTASPIKE-1116) CdiTestRunner injects test class fields twice

2016-04-16 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-1116:
-
Fix Version/s: 1.6.1

> CdiTestRunner injects test class fields twice
> -
>
> Key: DELTASPIKE-1116
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
> Project: DeltaSpike
>  Issue Type: Bug
>  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)


[jira] [Updated] (DELTASPIKE-1116) CdiTestRunner injects test class fields twice

2016-04-16 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-1116:
-
Affects Version/s: (was: 1.5.4)
   (was: 1.0.2)

> CdiTestRunner injects test class fields twice
> -
>
> Key: DELTASPIKE-1116
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
> Project: DeltaSpike
>  Issue Type: Bug
>  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)


[jira] [Updated] (DELTASPIKE-1116) CdiTestRunner injects test class fields twice

2016-04-06 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-1116:
-
Assignee: Gerhard Petracek
Priority: Minor  (was: Major)

changed to minor, because only fields annotated with @Inject are touched - 
those fields shouldn't get changed manually

> CdiTestRunner injects test class fields twice
> -
>
> Key: DELTASPIKE-1116
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
> Project: DeltaSpike
>  Issue Type: Bug
>  Components: TestControl
>Affects Versions: 1.0.2, 1.5.4, 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
> 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)


[jira] [Updated] (DELTASPIKE-1116) CdiTestRunner injects test class fields twice

2016-04-06 Thread Falko Modler (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Falko Modler updated DELTASPIKE-1116:
-
Attachment: DELTASPIKE-1116.zip

> CdiTestRunner injects test class fields twice
> -
>
> Key: DELTASPIKE-1116
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
> Project: DeltaSpike
>  Issue Type: Bug
>  Components: TestControl
>Affects Versions: 1.0.2, 1.5.4, 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
> 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)


[jira] [Updated] (DELTASPIKE-1116) CdiTestRunner injects test class fields twice

2016-04-06 Thread Falko Modler (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Falko Modler updated DELTASPIKE-1116:
-
Attachment: (was: DELTASPIKE-1116.zip)

> CdiTestRunner injects test class fields twice
> -
>
> Key: DELTASPIKE-1116
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
> Project: DeltaSpike
>  Issue Type: Bug
>  Components: TestControl
>Affects Versions: 1.0.2, 1.5.4, 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
> 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)


[jira] [Updated] (DELTASPIKE-1116) CdiTestRunner injects test class fields twice

2016-04-06 Thread Falko Modler (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-1116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Falko Modler updated DELTASPIKE-1116:
-
Attachment: DELTASPIKE-1116.zip

Please see attached maven project which contains a showcase test for this 
problem:
A bean is injected and is wrapped into a mockito spy via {{@Spy}} and 
{{MockitoJUnitRule}}.
The {{@Before}} method "sees" the spy as expected, but in the actual test 
method it's gone (overwritten with the Weld proxy by the second injection).

> CdiTestRunner injects test class fields twice
> -
>
> Key: DELTASPIKE-1116
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1116
> Project: DeltaSpike
>  Issue Type: Bug
>  Components: TestControl
>Affects Versions: 1.0.2, 1.5.4, 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
> 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)