[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159065#comment-14159065 ] Mark Struberg commented on DELTASPIKE-736: -- The problem is that the ProducerT is responsible for interceptors and decorators as per the spec. So if you plugin in your own ProducerT then this would also need to properly need to handle them itself. If you have a unit test for me then I can check whether we can handle this a bit different in OWB. Nonetheless this is probably leaving the path of portable behaviour... MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159067#comment-14159067 ] Gerhard Petracek commented on DELTASPIKE-736: - yes - but it's just a wrapper which delegates to the instance created by owb and if owb is using an instanceof check, we should improve/change the approach. if it isn't possible right now, cdi2 has to address interceptors as well as wrappers for such custom parts in a better way (since the setter is provided by the spi and therefore wrappers are self-evident). @roland: for such cases you can use org.apache.deltaspike.testcontrol.spi.mock.MockFilter MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159070#comment-14159070 ] Romain Manni-Bucau commented on DELTASPIKE-736: --- [~struberg] I fixed it yesterday on OWB 1.5 BTW I agree the wrapper should be added *only* when needed and not everywhere (can use apache-deltaspike.properties or a MockMatcher configurable in apache-deltaspike.properties). This would also make the skip warnings disappear which is quite nice on big apps where these logs are just too long to keep logs useful. wdyt? MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159076#comment-14159076 ] Gerhard Petracek commented on DELTASPIKE-736: - @romain: then we would need to deprecate org.apache.deltaspike.testcontrol.spi.mock.MockFilter since both would do almost the same (just white-list vs black-listing). i wouldn't do both, since it's just confusing for users... MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159106#comment-14159106 ] Romain Manni-Bucau commented on DELTASPIKE-736: --- well issue for me isnot isStereotypeWithInterceptor/isInterceptedBean. Contract should just be shouldMock(...). No more. The check should be done internally and shouldn't be in the contract finally a bean can be intercepted and mocked. MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159109#comment-14159109 ] Gerhard Petracek commented on DELTASPIKE-736: - not sure what you mean. #1 you fixed the issue in owb (thx for that) #2 we don't wrap beans already which can't be mocked (maybe we need to cover more here) #3 there is already MockFilter#isMockedImplementationSupported which can be used to skip the wrapper for all beans you don't like to mock (if there is an issue) #4 users don't have to care if there is a wrapper or not if it works technically (if something doesn't work: see #2 and #3) it's really just about white- vs blacklisting. and that's more a matter of taste - like the discussion configuration by exception vs. config everything explicitly. with blacklisting we are closer to the ee-style. since we have it already and you can work with it (if you need to), i wouldn't confuse users by adding/changing something. MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159123#comment-14159123 ] Gerhard Petracek commented on DELTASPIKE-736: - thx ronald - since romain fixed it for owb 1.5.x, we might need to backport it to owb 1.2.x. i'll use the demo as base for an additional test - our ci-builds will show which version fail and based on that we should think about a solution. MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger Attachments: ds-736-demo.tgz The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159124#comment-14159124 ] Romain Manni-Bucau commented on DELTASPIKE-736: --- [~gpetracek] I agree it is black vs white list but since it is something which breaks easily containers and which can't work on most of old ones I'm for white list. Then the log should be rework to not pollute as much as today. Finally last point is it is better to ensure you know you mock something and activate it in this case cause by default you suppose you mock all beans (and mocking is not testing most of the time so it shouldn't be a default). MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger Attachments: ds-736-demo.tgz The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159127#comment-14159127 ] Gerhard Petracek commented on DELTASPIKE-736: - we should check which versions are really affected (besides owb 1.2) and continue the discussion afterwards. we just need to ensure that it works for the majority of versions, otherwise we would need to drop most features just because some old servers are broken. we agreed against that already - so let's see which versions are affected in detail. MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger Attachments: ds-736-demo.tgz The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (DELTASPIKE-736) MockAwareInjectionTargetWrapper breaks interceptors in unit tests
[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14158531#comment-14158531 ] Gerhard Petracek commented on DELTASPIKE-736: - please test it with weld or provide a demo-application which illustrates that issue (so we can test it with weld). if it's just an issue with owb, we might need to fix it there. MockAwareInjectionTargetWrapper breaks interceptors in unit tests - Key: DELTASPIKE-736 URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 Project: DeltaSpike Issue Type: Bug Components: TestControl Affects Versions: 1.0.3 Environment: OpenWebBeans 1.2.6 Reporter: Ronald Steininger The automatic usage of MockAwareInjectionTargetWrapper breaks method-level interceptors under OWB: org.apache.webbeans.config.BeansDeployer#validate creates the interceptor stack of all beans while validating the deployment (Line 474). This code depends on owbBean.getProducer() returning an AbstractProducer (Line 462). TestControl replaces that AbstractProducer in some circumstances with an instance of MockAwareInjectionTargetWrapper, completely deactivating the if-branch which would active the interceptors. It seems that, depending where the interceptor binding is defined on the intercepted bean, interceptors work or don't work: using the annotation on the class level results in getProducer returning a AbstractProducer - interceptors work. Defining interceptors only on methods shows the broken behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)