[arquillian-issues] [JBoss JIRA] (ARQ-918) Pick a better name for testable attribute on @Deployment annotation

Dan Allen (JIRA) jira-events at lists.jboss.org
Fri May 11 03:20:30 EDT 2012


    [ https://issues.jboss.org/browse/ARQ-918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12692055#comment-12692055 ] 

Dan Allen commented on ARQ-918:
-------------------------------

Awesome.

I played around with a prototype tonight, and I'm excited to say that it just feels right.

Here's the code from the prototype:

{code:java}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ExcludeServices {
    String[] value() default { ServiceType.ALL };
}
{code}

Here's a set of built-in constants representing categories of services.

{code:java}
public interface ServiceType {
    public static final String ALL = "*";
    public static final String TEST_RUNNER = "test-runner";
    public static final String INSTRUMENTATION = "instrumentation";
    public static final String DEPLOYERS = "deployers";
}
{code}

Notice that the value of ALL is "*". This opens the door for exclude patterns, if we need them.

Btw, an alternative to ALL would be a separate annotation @ExcludeDefaultServices. However, I sort of like it how it is now.

I decided to change "TESTING" to "TEST_RUNNER" since it more accurately describes the service being provided (not what is packaged, as that is implied).

I chose the word instrumentation since the definition (from the JDK) seemed to fit this emerging use case:

"Instrumentation is the addition of code for the purpose of gathering data to be utilized by tools. Since the changes are purely additive, these tools do not modify application state or behavior. Examples include monitoring agents, profilers, coverage analyzers, and event loggers."

Next up, a pull request ;)
                
> Pick a better name for testable attribute on @Deployment annotation
> -------------------------------------------------------------------
>
>                 Key: ARQ-918
>                 URL: https://issues.jboss.org/browse/ARQ-918
>             Project: Arquillian
>          Issue Type: Enhancement
>      Security Level: Public(Everyone can see) 
>          Components: Base Implementation
>    Affects Versions: 1.0.0.Final
>            Reporter: Dan Allen
>
> @Deployment(testable = false) sends the wrong message for a testing platform and is subject to a wide variety of interpretations. We need a better name for this attribute.
> The purpose of this attribute is to determine if this deployment should be wrapped up based on the protocol so the test case can be executed inside the container.
> I'd be content if we gave it a very explicit name, even if that name wasn't tremendously fluent. Here are some suggestions:
> * transportsTest : Indicates whether this deployment will transport the test as part of the deployment so the it can be executed inside the container
> * testRunner : Indicates whether this deployment is itself a test runner, which by definition means it will be run inside the container
> * providesTestRunner : Mixed mode tests are possible, so this most accurately indicates whether this deployment will provide an additional test runner inside the container
> * hostsTest : Indicates whether the deployment will be a host to the test, so the test can be run inside the container
> * packageWithTest : Indicates whether this deployment will be packaged with the test and deployed to the server; when false, the deployment is left alone (not packaged with test)
> The hard part is that when the test is run in container, the @Deployment archive, the test and the test infrastructure often go into another archive that's the real deployment. So this is more of a directive of how to handle the @Deployment than it is about what role it will serve directly.
> I think that "testRunner" or "providesTestRunner" are the most clear options of the ones listed above.
> We can support this attribute as an alias to maintain backwards compatibility, marking testable as deprecated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the arquillian-issues mailing list