Package org.jboss.arquillian.test.api
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
-
Element Details
-
value
Class<?> valueDefines the resource target for this injection. e.g. Servlet.- Returns:
- The Target Resource Type
- Default:
org.jboss.arquillian.test.api.ArquillianResource.class
-