Annotation Type ArquillianResource


  • @Inherited
    @Documented
    @Retention(RUNTIME)
    @Target({FIELD,PARAMETER})
    public @interface ArquillianResource
    Arquillian has support for multiple injection points like @EJB, @Resources and @Inject, but there are also non standard component model objects available within the Arquillian runtime that can be of useful during testing.

    Arquillian can expose these objects to the test case using the @ArquillianResource injection annotation.

    Usage Example of Field injection:

    
     @ArquillianResource
     private InitialContext context;
    
     @Test
     public void shouldBeAbleToGetContext() {
          context.lookup("");
     }
     

    Usage Example of Argument injection:

    
     @Test
     public void shouldBeAbleToGetContext(@ArquillianResource InitialContext context) {
          context.lookup("");
     }
     
    Version:
    $Revision: $
    Author:
    Aslak Knutsen
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?> value
      Defines the resource target for this injection. e.g.
    • Element Detail

      • value

        Class<?> value
        Defines the resource target for this injection. e.g. Servlet.
        Returns:
        The Target Resource Type
        Default:
        org.jboss.arquillian.test.api.ArquillianResource.class