org.jboss.arquillian.test.api
Annotation Type ArquillianResource


@Inherited
@Documented
@Retention(value=RUNTIME)
@Target(value={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
 Class<?> value
          Defines the resource target for this injection.
 

value

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


Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.