org.apache.sling.junit.annotations
Annotation Type TestReference


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface TestReference

Annotation used to inject services in test classes. Similar to the Felix @Reference annotation, but we need RetentionPolicy.RUNTIME so we cannot use that one.


Optional Element Summary
 java.lang.String name
          The local name of the reference.
 java.lang.Class<?> referenceInterface
          The name of the service interface.
 

name

public abstract java.lang.String name
The local name of the reference. Default value is the name of the field to which the annotation applies.

Default:
""

referenceInterface

public abstract java.lang.Class<?> referenceInterface
The name of the service interface. This name is used by the Service Component Runtime to access the service on behalf of the component. The default value for is the type of the field to which the annotation applies.

Default:
org.apache.sling.junit.annotations.AutoDetect.class


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.