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

Move @Instrumentable annotation from @Deployment method to @Drone injections

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: droidium_1.0.0.Alpha5
    • Fix Version/s: None
    • Component/s: Extension - Droidium
    • Labels:
      None

      Description

      Right now it is like

      @RunWith(Arquillian.class)
      @RunAsClient
      public class TestCase
      {
          @Drone
          private WebDriver driver;
      
          @Deployment
          @Instrumentable
          public static Archive<?> getAndroidDeployment()
          {
              return APK;
          }
      }
      

      There is a need to move @Instrumentable from @Deployment method to @Drone injections since once someone has WAR deployment deployed to AS and he wants to test it from Android, putting @Instrumentable on @Deployment method in this context does not make any sense.

      First attempt to attack this problem is to implement it like this for APK instrumentations

      @RunWith(Arquillian.class)
      @RunAsClient
      public class TestCase
      {
          @Drone
          @Droidium
          private WebDriver driver;
      
          @Deployment
          public static Archive<?> getAndroidDeployment()
          {
              return APK 
          }
      }
      

      In case there is only one deployment method, it will be automatically resolved to instrument that one deployment.

      In case there are multiple deployment methods, it will follow this logic:

      @RunWith(Arquillian.class)
      @RunAsClient
      public class TestCase
      {
          @Drone
          @Droidium
          @OperatesOnDeployment("android-deployment")
          private WebDriver driver;
      
          @Deployment("android-deployment")
          public static Archive<?> getAndroidDeployment() {}
      
          @Deployment(jboss-as-deployment")
          public static Archive<?> getJBossDeployment() {}
      }
      

      Droidium annotation could extend @Drone annotation so it would simplify marking Drone injection as Droidium-related.

      Additionally, Droidium annotation would have default instrumentation port which could be specified manually and it will have two modes of operations:

      @Droidium(mode = DroidiumType.NATIVE) // default mode
      @Droidium(mode = DroidiumType.WEB)
      

      "Instrumenting" web deployment and running tests from Android device would eventually look like this:

      @RunWith(Arquillian.class)
      @RunAsClient
      public class TestCase
      {
          @Droidium(type = DroidiumType.WEB)
          private WebDriver driver;
      
          @Deployment
          public static Archive<?> getJBossASDeployment() { return WAR }
      }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                smikloso Stefan Miklosovic
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: