All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lithium.classloadertest.annotation.TestVisible Maven / Gradle / Ivy

The newest version!
package lithium.classloadertest.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import lithium.classloadertest.FunctionalTestClassLoader;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * Marks a field in a test class to be available for proxied calls from a "test" classloader to a "child" classloader
 * created with {@link FunctionalTestClassLoader}.  
 *
 * This annotation is designed for cases when Spring is being used and there are injected {@link Autowired} Spring fields
 * in the test class that need to be automatically copied up from the child classloader to the parent for easy manipulation.
 * 
 * Example:
 * 
 * @TestVisible
 * @Autowired
 * private final MyInterface myDependencyInjectedValue = null;
 * 
 * ...
 * {
 * 		...
 * 		myTestClass.myDependencyInjectedValue.getValue();
 * 		...
 * }
 * 
 * @author jeff.collins
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface TestVisible {

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy