public class AspectJUnit4Runner
extends org.junit.runners.BlockJUnit4ClassRunner
Use this JUnit Runner if you want to enable AspectJ load time weaving in your test. To use this runner place this annotation on your test class:
@RunWith(AspectJUnit4Runner.class)
AspectJConfig| 构造器和说明 |
|---|
AspectJUnit4Runner(Class<?> clazz) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected List<org.junit.runners.model.FrameworkMethod> |
computeTestMethods() |
protected org.junit.runners.model.TestClass |
createTestClass(Class<?> clazz) |
protected Class<? extends Throwable> |
getExpectedException(org.junit.runners.model.FrameworkMethod frameworkMethod)
Get the
exception that the supplied test method is expected to throw. |
protected org.junit.runners.model.Statement |
possiblyExpectingExceptions(org.junit.runners.model.FrameworkMethod frameworkMethod,
Object testInstance,
org.junit.runners.model.Statement next)
Perform the same logic as
BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement)
except that the expected exception is retrieved using
getExpectedException(FrameworkMethod). |
void |
run(org.junit.runner.notification.RunNotifier notifier) |
protected org.junit.runners.model.Statement |
withAfterClasses(org.junit.runners.model.Statement statement) |
protected org.junit.runners.model.Statement |
withAfters(org.junit.runners.model.FrameworkMethod method,
Object target,
org.junit.runners.model.Statement statement) |
protected org.junit.runners.model.Statement |
withBeforeClasses(org.junit.runners.model.Statement statement) |
protected org.junit.runners.model.Statement |
withBefores(org.junit.runners.model.FrameworkMethod method,
Object target,
org.junit.runners.model.Statement statement) |
collectInitializationErrors, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withPotentialTimeoutpublic AspectJUnit4Runner(Class<?> clazz) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationErrorprotected org.junit.runners.model.TestClass createTestClass(Class<?> clazz)
createTestClass 在类中 org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>protected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
computeTestMethods 在类中 org.junit.runners.BlockJUnit4ClassRunnerprotected org.junit.runners.model.Statement possiblyExpectingExceptions(org.junit.runners.model.FrameworkMethod frameworkMethod,
Object testInstance,
org.junit.runners.model.Statement next)
BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement)
except that the expected exception is retrieved using
getExpectedException(FrameworkMethod).possiblyExpectingExceptions 在类中 org.junit.runners.BlockJUnit4ClassRunnerprotected Class<? extends Throwable> getExpectedException(org.junit.runners.model.FrameworkMethod frameworkMethod)
exception that the supplied test method is expected to throw.
Supports JUnit's @Test(expected=...) annotation.
Can be overridden by subclasses.
null if none was specifiedpublic void run(org.junit.runner.notification.RunNotifier notifier)
run 在类中 org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>protected org.junit.runners.model.Statement withBeforeClasses(org.junit.runners.model.Statement statement)
withBeforeClasses 在类中 org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>protected org.junit.runners.model.Statement withAfterClasses(org.junit.runners.model.Statement statement)
withAfterClasses 在类中 org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>protected org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method,
Object target,
org.junit.runners.model.Statement statement)
withBefores 在类中 org.junit.runners.BlockJUnit4ClassRunnerprotected org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod method,
Object target,
org.junit.runners.model.Statement statement)
withAfters 在类中 org.junit.runners.BlockJUnit4ClassRunnerCopyright © 2011-2019–2019 Azolla. All rights reserved.