[JBoss JIRA] (ARQ-1255) Multiple deployments is not working in Weld SE container
by Antonin Stefanutti (JIRA)
[ https://issues.jboss.org/browse/ARQ-1255?page=com.atlassian.jira.plugin.s... ]
Antonin Stefanutti commented on ARQ-1255:
-----------------------------------------
Karel,
I don't think it's possible to annotate arguments with the {{@Inject}} annotation. Only fields, constructors and initializer methods are allowed to be annotated with {{@Inject}} as per CDI specifications.
My understanding is that each deployment unit should be _deployed_ in the CDI container, like multiple JARs with {{META-INF/beans.xml}}, i.e. bean archives, present in the application classpath, are _deployed_ in the CDI container in a standard execution context (compared to Arquillian).
In case there exist multiple beans in each {{@Deployment}} eligible for injection to an injection point, i.e. an ambiguous dependency exists, the CDI container should throw an {{AmbiguousResolutionException}} as per CDI specifications.
As you mentioned, this may not be strictly Weld SE related. However, I think that the two use cases attached are well-defined, meaning that they are straightforward illustrations of the [Multiple Deployments|https://docs.jboss.org/author/display/ARQ/Multiple+Deployments] support provided by Arquillian and have general solutions in all cases by following the CDI specifications.
> Multiple deployments is not working in Weld SE container
> --------------------------------------------------------
>
> Key: ARQ-1255
> URL: https://issues.jboss.org/browse/ARQ-1255
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Weld Containers
> Affects Versions: 1.0.0.CR5
> Reporter: Antonin Stefanutti
> Attachments: Bean1.java, Bean2.java, MultipleDeploymentArquilianCdiTest.java, OperateOnDeploymentArquilianCdiTest.java, pom.xml, test_case_1_stacktrace.txt, test_case_2_stacktrace.txt
>
>
> As described in [Multiple Deployments|https://docs.jboss.org/author/display/ARQ/Multiple+Deployments], multiple {{@Deployment}} annotated methods can be declared in a test class. In addition, the {{@OperateOnDeployment}} annotation enables the selection of a particular _deployment_ per test method.
> However, when using Arquillian with a Weld SE container, the CDI container isn't deployed with the expected archives which ends up having {{DeploymentException}} thrown, as illustrated in the test cases below:
> *Test case 1:*
> {code}
> @RunWith(Arquillian.class)
> public class MultipleDeploymentArquilianCdiTest {
> @Inject
> private Bean1 bean1;
> @Inject
> private Bean2 bean2;
> @Deployment(name = "bean1-jar")
> public static Archive<?> createBean1Jar() {
> return ShrinkWrap.create(JavaArchive.class).addClass(Bean1.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> }
> @Deployment(name = "bean2-jar")
> public static Archive<?> createBean2Jar() {
> return ShrinkWrap.create(JavaArchive.class).addClass(Bean2.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> }
> @Test
> public void multiDeploymentTest() {
> assertNotNull(bean1);
> assertNotNull(bean2);
> }
> }
> {code}
> *Test case 2:*
> {code}
> @RunWith(Arquillian.class)
> public class OperateOnDeploymentArquilianCdiTest {
> @Inject
> private Bean1 bean1;
> @Inject
> private Bean2 bean2;
> @Deployment(name = "beans-jar")
> public static Archive<?> createBeansJar() {
> return ShrinkWrap.create(JavaArchive.class).addClass(Bean1.class).addClass(Bean2.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> }
> @Deployment(name = "bean1-jar")
> public static Archive<?> createBean1Jar() {
> return ShrinkWrap.create(JavaArchive.class).addClass(Bean1.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> }
> @Deployment(name = "bean2-jar")
> public static Archive<?> createBean2Jar() {
> return ShrinkWrap.create(JavaArchive.class).addClass(Bean2.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
> }
> @Test
> @OperateOnDeployment("beans-jar")
> public void singleDeploymentTest() {
> assertNotNull(bean1);
> assertNotNull(bean2);
> }
> }
> {code}
> In both cases, the following exception is thrown:
> {code}
> org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Bean2] with qualifiers [@Default] at injection point [[field] @Inject private arquillian.test.OperateOnDeploymentArquilianCdiTest.bean2]
> {code}
> Note that test case 2 is working when only {{@Deployment(name = "beans-jar")}} is declared.
> Test classes and the {{pom.xml}} are attached.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-72) Support parallel browser sessions API for Selenium 2
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-72?page=com.atlassian.jira.plugin.... ]
Lukáš Fryč updated ARQGRA-72:
-----------------------------
Priority: Blocker (was: Critical)
> Support parallel browser sessions API for Selenium 2
> ----------------------------------------------------
>
> Key: ARQGRA-72
> URL: https://issues.jboss.org/browse/ARQGRA-72
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Components: core
> Reporter: Lukáš Fryč
> Priority: Blocker
> Fix For: 2.0.0.Beta1
>
>
> In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
> In Selenium 2, this can be done by creating multiple WebDriver instances.
> There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-72) Support parallel browser sessions API for Selenium 2
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-72?page=com.atlassian.jira.plugin.... ]
Lukáš Fryč updated ARQGRA-72:
-----------------------------
Priority: Critical (was: Blocker)
> Support parallel browser sessions API for Selenium 2
> ----------------------------------------------------
>
> Key: ARQGRA-72
> URL: https://issues.jboss.org/browse/ARQGRA-72
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Components: core
> Reporter: Lukáš Fryč
> Priority: Critical
> Fix For: 2.0.0.Beta1
>
>
> In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
> In Selenium 2, this can be done by creating multiple WebDriver instances.
> There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-72) Support parallel browser sessions API for Selenium 2
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-72?page=com.atlassian.jira.plugin.... ]
Lukáš Fryč updated ARQGRA-72:
-----------------------------
Description:
In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
In Selenium 2, this can be done by creating multiple WebDriver instances.
There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
> Support parallel browser sessions API for Selenium 2
> ----------------------------------------------------
>
> Key: ARQGRA-72
> URL: https://issues.jboss.org/browse/ARQGRA-72
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Components: core
> Reporter: Lukáš Fryč
> Priority: Critical
> Fix For: 2.0.0.Beta1
>
>
> In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
> In Selenium 2, this can be done by creating multiple WebDriver instances.
> There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-253) Make a way to work with multiple different WebDriver instances
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-253?page=com.atlassian.jira.plugin... ]
Lukáš Fryč edited comment on ARQGRA-253 at 1/14/13 1:57 AM:
------------------------------------------------------------
Please vote for ARQGRA-72
was (Author: lfryc):
Please vote on ARQGRA-72
> Make a way to work with multiple different WebDriver instances
> --------------------------------------------------------------
>
> Key: ARQGRA-253
> URL: https://issues.jboss.org/browse/ARQGRA-253
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Reporter: Radek Falhar
> Assignee: Lukáš Fryč
> Priority: Optional
>
> In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
> In Selenium 2, this can be done by creating multiple WebDriver instances.
> There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-253) Make a way to work with multiple different WebDriver instances
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-253?page=com.atlassian.jira.plugin... ]
Lukáš Fryč resolved ARQGRA-253.
-------------------------------
Assignee: Lukáš Fryč
Resolution: Duplicate Issue
> Make a way to work with multiple different WebDriver instances
> --------------------------------------------------------------
>
> Key: ARQGRA-253
> URL: https://issues.jboss.org/browse/ARQGRA-253
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Reporter: Radek Falhar
> Assignee: Lukáš Fryč
> Priority: Optional
>
> In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
> In Selenium 2, this can be done by creating multiple WebDriver instances.
> There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (ARQGRA-253) Make a way to work with multiple different WebDriver instances
by Lukáš Fryč (JIRA)
[ https://issues.jboss.org/browse/ARQGRA-253?page=com.atlassian.jira.plugin... ]
Lukáš Fryč commented on ARQGRA-253:
-----------------------------------
Please vote on ARQGRA-72
> Make a way to work with multiple different WebDriver instances
> --------------------------------------------------------------
>
> Key: ARQGRA-253
> URL: https://issues.jboss.org/browse/ARQGRA-253
> Project: Arquillian Graphene
> Issue Type: Feature Request
> Reporter: Radek Falhar
> Assignee: Lukáš Fryč
> Priority: Optional
>
> In Selenium 1, it was possible to open multiple windows using browser.openWindow(url, windowId); and browser.selectWindow(windowId);
> In Selenium 2, this can be done by creating multiple WebDriver instances.
> There is no way to simply do this in Graphene 2. You can create 2 fields with @Drone, which will open 2 browsers with 2 WebDrivers, but all @FindBy and @Page will resolve against the first one.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months