public class NeedleRule extends NeedleTestcase implements org.junit.rules.MethodRule
MethodRule
for the initialization of the test. The Rule
processes and initializes all fields annotated with ObjectUnderTest
.
Example: public class UserDaoBeanTest { @Rule public NeedleRule needle = new NeedleRule(); @ObjectUnderTest private UserDaoBean userDao; @Test public void test() { ... userDao.someAction(); ... } }
NeedleTestcase
Constructor and Description |
---|
NeedleRule() |
NeedleRule(InjectionProvider<?>... injectionProviders) |
Modifier and Type | Method and Description |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
Object target)
Before evaluation of the base statement, the test instance
will initialized.
|
NeedleRule |
withOuter(org.junit.rules.MethodRule rule)
Encloses the added rule.
|
getInjectedObject, getMockProvider
public NeedleRule()
public NeedleRule(InjectionProvider<?>... injectionProviders)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target)
apply
in interface org.junit.rules.MethodRule
public NeedleRule withOuter(org.junit.rules.MethodRule rule)
rule
- - outer method ruleNeedleRule
Copyright © 2014. All rights reserved.