|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.akquinet.jbosscc.needle.NeedleTestcase
public abstract class NeedleTestcase
Abstract test case to process and initialize all fields annotated with
ObjectUnderTest. After initialization, InjectIntoMany and
InjectInto annotations are processed for optional additional
injections.
Supported injections are:
ObjectUnderTest,
InjectInto,
InjectIntoMany,
InjectionProvider| Constructor Summary | |
|---|---|
protected |
NeedleTestcase(InjectionProvider<?>... injectionProvider)
Create an instance of NeedleTestcase with optional additional
injection provider. |
| Method Summary | ||
|---|---|---|
protected void |
addInjectionProvider(InjectionProvider<?>... injectionProvider)
|
|
|
getInjectedObject(Object key)
Returns the injected object for the given key, or null if no object was injected with the given key. |
|
|
getMockProvider()
Returns an instance of the configured MockProvider |
|
protected void |
initInstance(Object instance)
Inject dependencies into the given instance. |
|
protected void |
initTestcase(Object test)
Initialize all fields annotated with ObjectUnderTest. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected NeedleTestcase(InjectionProvider<?>... injectionProvider)
NeedleTestcase with optional additional
injection provider.
injectionProvider - optional additional injection providerInjectionProvider| Method Detail |
|---|
protected final void addInjectionProvider(InjectionProvider<?>... injectionProvider)
protected final void initTestcase(Object test)
throws Exception
ObjectUnderTest. Is an
object under test annotated field already initialized, only the injection
of dependencies will executed.
After initialization, InjectIntoMany and InjectInto
annotations are processed for optional additional injections.
test - an instance of the test
Exception - thrown if an initialization error occurs.protected final void initInstance(Object instance)
InjectionProvider for the target.
Then the method injection is executed, if the injection annotation are
supported.
instance - the instance that is to initialize.public <X> X getInjectedObject(Object key)
key - the key of the injected object, see
InjectionProvider.getKey(InjectionTargetInformation)
public <X extends MockProvider> X getMockProvider()
MockProvider
MockProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||