[JBoss JIRA] (ARQ-1975) Adds ServletContext as Arquillian Resource
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1975?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1975:
-------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/arquillian/arquillian-core/pull/92
> Adds ServletContext as Arquillian Resource
> ------------------------------------------
>
> Key: ARQ-1975
> URL: https://issues.jboss.org/browse/ARQ-1975
> Project: Arquillian
> Issue Type: Feature Request
> Components: Test Protocol SPIs and Implementation
> Reporter: Alex Soto
> Assignee: Alex Soto
> Fix For: 1.1.9.Final
>
>
> Adds ServletContext as Arquillian Resource so it can be used in the tests. In case of in-container tests, ServletContxt used is the one provided by the Servlet protocol.
> In case of client test, it only works in case of embedded containers and they are the responsible of provide the instance by producing the instance:
> {code:java}
> @Inject
> @ApplicationScoped
> private InstanceProducer<ServletContext> servletContextInstanceProducer;
> servletContextInstanceProducer.set(servletContext);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months
[JBoss JIRA] (ARQ-1975) Adds ServletContext as Arquillian Resource
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1975?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen commented on ARQ-1975:
------------------------------------
[~mjobanek] This is a separate issue. In ARQ-540 we want to support injecting @ArquillianResource URL in container. Currently it's only supported on the client side. That can be useful to get the URL of another deployment context. This issue is to support @ArquillianResource ServletContext, which would be the ServletContext used/created by the ServletTestRunner and the in container test is running within.
> Adds ServletContext as Arquillian Resource
> ------------------------------------------
>
> Key: ARQ-1975
> URL: https://issues.jboss.org/browse/ARQ-1975
> Project: Arquillian
> Issue Type: Feature Request
> Components: Test Protocol SPIs and Implementation
> Reporter: Alex Soto
> Assignee: Alex Soto
> Fix For: 1.1.9.Final
>
>
> Adds ServletContext as Arquillian Resource so it can be used in the tests. In case of in-container tests, ServletContxt used is the one provided by the Servlet protocol.
> In case of client test, it only works in case of embedded containers and they are the responsible of provide the instance by producing the instance:
> {code:java}
> @Inject
> @ApplicationScoped
> private InstanceProducer<ServletContext> servletContextInstanceProducer;
> servletContextInstanceProducer.set(servletContext);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months
[JBoss JIRA] (ARQ-1975) Adds ServletContext as Arquillian Resource
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1975?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1975:
-------------------------------
Fix Version/s: 1.1.9.Final
> Adds ServletContext as Arquillian Resource
> ------------------------------------------
>
> Key: ARQ-1975
> URL: https://issues.jboss.org/browse/ARQ-1975
> Project: Arquillian
> Issue Type: Feature Request
> Components: Test Protocol SPIs and Implementation
> Reporter: Alex Soto
> Assignee: Alex Soto
> Fix For: 1.1.9.Final
>
>
> Adds ServletContext as Arquillian Resource so it can be used in the tests. In case of in-container tests, ServletContxt used is the one provided by the Servlet protocol.
> In case of client test, it only works in case of embedded containers and they are the responsible of provide the instance by producing the instance:
> {code:java}
> @Inject
> @ApplicationScoped
> private InstanceProducer<ServletContext> servletContextInstanceProducer;
> servletContextInstanceProducer.set(servletContext);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months
[JBoss JIRA] (ARQ-1976) All ResourceProvider#canProvide implementations could try to inject subtypes
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1976?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1976:
-------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> All ResourceProvider#canProvide implementations could try to inject subtypes
> ----------------------------------------------------------------------------
>
> Key: ARQ-1976
> URL: https://issues.jboss.org/browse/ARQ-1976
> Project: Arquillian
> Issue Type: Bug
> Reporter: Radoslav Husar
> Fix For: 1.1.9.Final
>
>
> Currently the conditions seem to be the other way round as they normally would:
> {noformat}
> @Override
> public boolean canProvide(Class<?> type)
> {
> - return Deployer.class.isAssignableFrom(type);
> + return type.isAssignableFrom(Deployer.class);
> }
> {noformat}
> It does not seem to be intentional. This would not be usually spotted because usually the same class is injected and requested and no provider provides a subtype of other ResourceProvider, so the problem would never occur.
> The resulting exception would look like:
> {noformat}
> java.lang.RuntimeException: Could not set value on field protected ClassA TestClass.field using ClassB@19b89d4,
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months
[JBoss JIRA] (ARQ-1976) All ResourceProvider#canProvide implementations could try to inject subtypes
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1976?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1976:
-------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request: https://github.com/arquillian/arquillian-core/pull/93
> All ResourceProvider#canProvide implementations could try to inject subtypes
> ----------------------------------------------------------------------------
>
> Key: ARQ-1976
> URL: https://issues.jboss.org/browse/ARQ-1976
> Project: Arquillian
> Issue Type: Bug
> Reporter: Radoslav Husar
> Fix For: 1.1.9.Final
>
>
> Currently the conditions seem to be the other way round as they normally would:
> {noformat}
> @Override
> public boolean canProvide(Class<?> type)
> {
> - return Deployer.class.isAssignableFrom(type);
> + return type.isAssignableFrom(Deployer.class);
> }
> {noformat}
> It does not seem to be intentional. This would not be usually spotted because usually the same class is injected and requested and no provider provides a subtype of other ResourceProvider, so the problem would never occur.
> The resulting exception would look like:
> {noformat}
> java.lang.RuntimeException: Could not set value on field protected ClassA TestClass.field using ClassB@19b89d4,
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months
[JBoss JIRA] (ARQ-1976) All ResourceProvider#canProvide implementations could try to inject subtypes
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1976?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1976:
-------------------------------
Fix Version/s: 1.1.9.Final
> All ResourceProvider#canProvide implementations could try to inject subtypes
> ----------------------------------------------------------------------------
>
> Key: ARQ-1976
> URL: https://issues.jboss.org/browse/ARQ-1976
> Project: Arquillian
> Issue Type: Bug
> Reporter: Radoslav Husar
> Fix For: 1.1.9.Final
>
>
> Currently the conditions seem to be the other way round as they normally would:
> {noformat}
> @Override
> public boolean canProvide(Class<?> type)
> {
> - return Deployer.class.isAssignableFrom(type);
> + return type.isAssignableFrom(Deployer.class);
> }
> {noformat}
> It does not seem to be intentional. This would not be usually spotted because usually the same class is injected and requested and no provider provides a subtype of other ResourceProvider, so the problem would never occur.
> The resulting exception would look like:
> {noformat}
> java.lang.RuntimeException: Could not set value on field protected ClassA TestClass.field using ClassB@19b89d4,
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months
[JBoss JIRA] (ARQ-1976) All ResourceProvider#canProvide implementations could try to inject subtypes
by Richard Achmatowicz (JIRA)
[ https://issues.jboss.org/browse/ARQ-1976?page=com.atlassian.jira.plugin.s... ]
Richard Achmatowicz commented on ARQ-1976:
------------------------------------------
The issue https://issues.jboss.org/browse/WFLY-4255 is holding up testing of clean shutdown, so any help in getting this issue resolved as quickly as possible would be greatly appreciated and received with heartfelt thanks.
> All ResourceProvider#canProvide implementations could try to inject subtypes
> ----------------------------------------------------------------------------
>
> Key: ARQ-1976
> URL: https://issues.jboss.org/browse/ARQ-1976
> Project: Arquillian
> Issue Type: Bug
> Reporter: Radoslav Husar
>
> Currently the conditions seem to be the other way round as they normally would:
> {noformat}
> @Override
> public boolean canProvide(Class<?> type)
> {
> - return Deployer.class.isAssignableFrom(type);
> + return type.isAssignableFrom(Deployer.class);
> }
> {noformat}
> It does not seem to be intentional. This would not be usually spotted because usually the same class is injected and requested and no provider provides a subtype of other ResourceProvider, so the problem would never occur.
> The resulting exception would look like:
> {noformat}
> java.lang.RuntimeException: Could not set value on field protected ClassA TestClass.field using ClassB@19b89d4,
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 3 months