[arquillian-issues] [JBoss JIRA] (ARQ-1757) Move @Instrumentable annotation from @Deployment method to @Drone injections

Stefan Miklosovic (JIRA) issues at jboss.org
Fri Apr 11 07:28:15 EDT 2014


Stefan Miklosovic created ARQ-1757:
--------------------------------------

             Summary: Move @Instrumentable annotation from @Deployment method to @Drone injections
                 Key: ARQ-1757
                 URL: https://issues.jboss.org/browse/ARQ-1757
             Project: Arquillian
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: Extension - Droidium
    Affects Versions: droidium_1.0.0.Alpha5
            Reporter: Stefan Miklosovic


Right now it is like

{code}
@RunWith(Arquillian.class)
@RunAsClient
public class TestCase
{
    @Drone
    private WebDriver driver;

    @Deployment
    @Instrumentable
    public static Archive<?> getAndroidDeployment()
    {
        return APK;
    }
}
{code}

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

{code}
@RunWith(Arquillian.class)
@RunAsClient
public class TestCase
{
    @Drone
    @Droidium
    private WebDriver driver;

    @Deployment
    public static Archive<?> getAndroidDeployment()
    {
        return APK 
    }
}
{code}

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:

{code}
@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() {}
}
{code}

{{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:

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

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

{code}
@RunWith(Arquillian.class)
@RunAsClient
public class TestCase
{
    @Droidium(type = DroidiumType.WEB)
    private WebDriver driver;

    @Deployment
    public static Archive<?> getJBossASDeployment() { return WAR }
}
{code}

--
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


More information about the arquillian-issues mailing list