
org.jglue.cdiunit.AdditionalPackages Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdi-unit Show documentation
Show all versions of cdi-unit Show documentation
JUnit runner for testing CDI based projects.
package org.jglue.cdiunit;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* @AdditionalPackages
adds all the classes in a particular package entry to the CDI environment that are not discovered automatically.
*
*
* @RunWith(CdiRunner.class)
* @AdditionalPackages(Enterprise.class) //WarpDrive is in the package that contains Enterprise.
* class TestStarship {
*
* @Inject
* Starship starship; //Starship has an engine in the same package as Enterprise.
*
* @Test
* void testStart() {
* starship.start(); // Going to warp!
* }
* }
*
*
* @author Bryn Cooke
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface AdditionalPackages {
/**
* @return Array of classes that belong to classpath entries to make discoverable during testing.
*/
public Class>[] value();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy