public class HK2Runner extends Object
This behavior can be customized by overriding the before method and calling the super of one of the other methods available for customization
Modifier and Type | Field and Description |
---|---|
protected ServiceLocator |
testLocator
Test classes can use this service locator as their private test locator
|
Constructor and Description |
---|
HK2Runner() |
Modifier and Type | Method and Description |
---|---|
void |
before()
This will generate the default testLocator for this test
class, which will search the package of the test itself for
classes annotated with @Service.
|
protected void |
initialize(String name,
List<String> packages,
List<Class<?>> clazzes)
This method initializes the service locator with services from the given list
of packages (in "." format) and with the set of classes given.
|
protected void |
setVerbosity(boolean verbose) |
protected ServiceLocator testLocator
public void before()
protected void initialize(String name, List<String> packages, List<Class<?>> clazzes)
name
- The name of the service locator to create. If there is already a
service locator of this name then the remaining fields will be ignored and the existing
locator with this name will be returned. May not be nullpackages
- The list of packages (in "." format, i.e. "com.acme.test.services") that
we should hunt through the classpath for in order to find services. If null this is considered
to be the empty setclazzes
- A set of classes that should be analyzed as services, whether they declare
@Service or not. If null this is considered to be the empty setprotected void setVerbosity(boolean verbose)
Copyright © 2015 Oracle Corporation. All rights reserved.