本文整理了Java中org.springframework.test.context.TestContext.updateState()
方法的一些代码示例,展示了TestContext.updateState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestContext.updateState()
方法的具体详情如下:
包路径:org.springframework.test.context.TestContext
类名称:TestContext
方法名:updateState
[英]Update this test context to reflect the state of the currently executing test.
Caution: concurrent invocations of this method might not be thread-safe, depending on the underlying implementation.
[中]更新此测试上下文以反映当前正在执行的测试的状态。
警告:此方法的并发调用可能不是线程安全的,这取决于底层实现。
代码示例来源:origin: spring-projects/spring-framework
private void prepareForAfterCallback(String callbackName, Object testInstance, Method testMethod,
@Nullable Throwable exception) {
if (logger.isTraceEnabled()) {
logger.trace(String.format("%s(): instance [%s], method [%s], exception [%s]",
callbackName, testInstance, testMethod, exception));
}
getTestContext().updateState(testInstance, testMethod, exception);
}
代码示例来源:origin: spring-projects/spring-framework
private void prepareForBeforeCallback(String callbackName, Object testInstance, Method testMethod) {
if (logger.isTraceEnabled()) {
logger.trace(String.format("%s(): instance [%s], method [%s]", callbackName, testInstance, testMethod));
}
getTestContext().updateState(testInstance, testMethod, null);
}
代码示例来源:origin: spring-projects/spring-framework
logger.trace("prepareTestInstance(): instance [" + testInstance + "]");
getTestContext().updateState(testInstance, null, null);
代码示例来源:origin: spring-projects/spring-framework
logger.trace("afterTestClass(): class [" + testClass.getName() + "]");
getTestContext().updateState(null, null, null);
代码示例来源:origin: spring-projects/spring-framework
/**
* Hook for pre-processing a test class <em>before</em> execution of any
* tests within the class. Should be called prior to any framework-specific
* <em>before class methods</em> (e.g., methods annotated with JUnit 4's
* {@link org.junit.BeforeClass @BeforeClass}).
* <p>An attempt will be made to give each registered
* {@link TestExecutionListener} a chance to pre-process the test class
* execution. If a listener throws an exception, however, the remaining
* registered listeners will <strong>not</strong> be called.
* @throws Exception if a registered TestExecutionListener throws an
* exception
* @since 3.0
* @see #getTestExecutionListeners()
*/
public void beforeTestClass() throws Exception {
Class<?> testClass = getTestContext().getTestClass();
if (logger.isTraceEnabled()) {
logger.trace("beforeTestClass(): class [" + testClass.getName() + "]");
}
getTestContext().updateState(null, null, null);
for (TestExecutionListener testExecutionListener : getTestExecutionListeners()) {
try {
testExecutionListener.beforeTestClass(getTestContext());
}
catch (Throwable ex) {
logException(ex, "beforeTestClass", testExecutionListener, testClass);
ReflectionUtils.rethrowException(ex);
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test
private void prepareForAfterCallback(String callbackName, Object testInstance, Method testMethod,
@Nullable Throwable exception) {
if (logger.isTraceEnabled()) {
logger.trace(String.format("%s(): instance [%s], method [%s], exception [%s]",
callbackName, testInstance, testMethod, exception));
}
getTestContext().updateState(testInstance, testMethod, exception);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test
private void prepareForBeforeCallback(String callbackName, Object testInstance, Method testMethod) {
if (logger.isTraceEnabled()) {
logger.trace(String.format("%s(): instance [%s], method [%s]", callbackName, testInstance, testMethod));
}
getTestContext().updateState(testInstance, testMethod, null);
}
代码示例来源:origin: apache/servicemix-bundles
logger.trace("prepareTestInstance(): instance [" + testInstance + "]");
getTestContext().updateState(testInstance, null, null);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test
logger.trace("prepareTestInstance(): instance [" + testInstance + "]");
getTestContext().updateState(testInstance, null, null);
代码示例来源:origin: apache/servicemix-bundles
logger.trace("beforeTestMethod(): instance [" + testInstance + "], method [" + testMethod + "]");
getTestContext().updateState(testInstance, testMethod, null);
代码示例来源:origin: apache/servicemix-bundles
"], exception [" + exception + "]");
getTestContext().updateState(testInstance, testMethod, exception);
代码示例来源:origin: apache/servicemix-bundles
logger.trace("beforeTestClass(): class [" + testClass.getName() + "]");
getTestContext().updateState(null, null, null);
代码示例来源:origin: apache/servicemix-bundles
logger.trace("afterTestClass(): class [" + testClass.getName() + "]");
getTestContext().updateState(null, null, null);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test
logger.trace("afterTestClass(): class [" + testClass.getName() + "]");
getTestContext().updateState(null, null, null);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test
/**
* Hook for pre-processing a test class <em>before</em> execution of any
* tests within the class. Should be called prior to any framework-specific
* <em>before class methods</em> (e.g., methods annotated with JUnit 4's
* {@link org.junit.BeforeClass @BeforeClass}).
* <p>An attempt will be made to give each registered
* {@link TestExecutionListener} a chance to pre-process the test class
* execution. If a listener throws an exception, however, the remaining
* registered listeners will <strong>not</strong> be called.
* @throws Exception if a registered TestExecutionListener throws an
* exception
* @since 3.0
* @see #getTestExecutionListeners()
*/
public void beforeTestClass() throws Exception {
Class<?> testClass = getTestContext().getTestClass();
if (logger.isTraceEnabled()) {
logger.trace("beforeTestClass(): class [" + testClass.getName() + "]");
}
getTestContext().updateState(null, null, null);
for (TestExecutionListener testExecutionListener : getTestExecutionListeners()) {
try {
testExecutionListener.beforeTestClass(getTestContext());
}
catch (Throwable ex) {
logException(ex, "beforeTestClass", testExecutionListener, testClass);
ReflectionUtils.rethrowException(ex);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!