Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1771

Putting custom annotation on Drone creates multiple instances

    XMLWordPrintable

Details

    Description

      I have a test case like this

      @RunWith(Arquillian.class)
      @RunAsClient
      public class SomeTestCase
      {
          @Drone
          @Mobile
          @Custom
          private WebDriver mobile;
      
          // tests
      }
      

      where @Custom is just an annotation:

      @Retention(RetentionPolicy.RUNTIME)
      @Target({ ElementType.FIELD, ElementType.PARAMETER })
      public @interface Custom {
      }
      

      it is not annotated with @Qualifier.

      Realize that the same problem arise when using @OperateOnDeployment from Arquillian which is not annotated with @Qualifier neither.

      I am getting this:

      http://pastebin.com/raw.php?i=i9DVqeaC

      You see that InstrumentationPerformDecider.decidePerformingInstrumentation observes BeforeDroneInstantiated so when it is treated twice, you are going to instantiate two Drones which is another argument why Drone does it wrong.

      When I declare Drone injection like that, it results into two instances of WebDrivers so that means it instruments Android package twice with two Selendroids so that mean I am getting NoUniqueWebDriverException when I want to start some activity because from now on you have "by accident" two webdrivers instrumenting the same deployment as a result of a bug where putting custom annotation on Drone instantiates it twice.

      Attachments

        Activity

          People

            Unassigned Unassigned
            smikloso Stefan Miklosovic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: