提交 726564c8 编写于 作者: S Sam Brannen

Polishing and fixed broken support for @IfProfileValue in AbstractJpaTests...

Polishing and fixed broken support for @IfProfileValue in AbstractJpaTests (even though it's deprecated).
上级 d6be4c5a
......@@ -70,7 +70,7 @@ public abstract class ConditionalTestCase extends TestCase {
// getName will return the name of the method being run
if (isDisabledInThisEnvironment(getName())) {
recordDisabled();
this.logger.info("**** " + getClass().getName() + "." + getName() + " disabled in this environment: "
this.logger.info("**** " + getClass().getName() + "." + getName() + " is disabled in this environment: "
+ "Total disabled tests = " + getDisabledTestCount());
return;
}
......
......@@ -67,6 +67,8 @@ import org.springframework.util.Assert;
* @author Sam Brannen
* @author Juergen Hoeller
* @since 2.0
* @deprecated as of Spring 3.0, in favor of using the listener-based test context framework
* ({@link org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests})
*/
public abstract class AbstractAnnotationAwareTransactionalTests extends
AbstractTransactionalDataSourceSpringContextTests {
......@@ -151,7 +153,7 @@ public abstract class AbstractAnnotationAwareTransactionalTests extends
if (isDisabledInThisEnvironment(testMethod)) {
recordDisabled();
this.logger.info("**** " + getClass().getName() + "." + getName() + " disabled in this environment: "
this.logger.info("**** " + getClass().getName() + "." + getName() + " is disabled in this environment: "
+ "Total disabled tests=" + getDisabledTestCount());
return;
}
......
......@@ -77,6 +77,8 @@ import org.springframework.util.StringUtils;
* @author Rob Harrop
* @author Juergen Hoeller
* @since 2.0
* @deprecated as of Spring 3.0, in favor of using the listener-based test context framework
* ({@link org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests})
*/
public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactionalTests {
......@@ -157,13 +159,31 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void runBare() throws Throwable {
if (!shouldUseShadowLoader()) {
// getName will return the name of the method being run.
if (isDisabledInThisEnvironment(getName())) {
// Let superclass log that we didn't run the test.
super.runBare();
return;
}
final Method testMethod = getTestMethod();
if (isDisabledInThisEnvironment(testMethod)) {
recordDisabled();
this.logger.info("**** " + getClass().getName() + "." + getName() + " is disabled in this environment: "
+ "Total disabled tests=" + getDisabledTestCount());
return;
}
if (!shouldUseShadowLoader()) {
super.runBare();
return;
}
String combinationOfContextLocationsForThisTestClass = cacheKeys();
ClassLoader classLoaderForThisTestClass = getClass().getClassLoader();
// save the TCCL
......@@ -305,6 +325,7 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio
private final LoadTimeWeaver ltw;
@SuppressWarnings("unused")
public LoadTimeWeaverInjectingBeanPostProcessor(LoadTimeWeaver ltw) {
this.ltw = ltw;
}
......@@ -325,6 +346,7 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio
private final ClassLoader shadowingClassLoader;
@SuppressWarnings("unused")
public ShadowingLoadTimeWeaver(ClassLoader shadowingClassLoader) {
this.shadowingClassLoader = shadowingClassLoader;
}
......
......@@ -70,7 +70,7 @@ public abstract class ConditionalTestCase extends TestCase {
// getName will return the name of the method being run
if (isDisabledInThisEnvironment(getName())) {
recordDisabled();
this.logger.info("**** " + getClass().getName() + "." + getName() + " disabled in this environment: "
this.logger.info("**** " + getClass().getName() + "." + getName() + " is disabled in this environment: "
+ "Total disabled tests = " + getDisabledTestCount());
return;
}
......
......@@ -143,6 +143,7 @@ public abstract class AbstractAnnotationAwareTransactionalTests extends
*/
@Override
public void runBare() throws Throwable {
// getName will return the name of the method being run.
if (isDisabledInThisEnvironment(getName())) {
// Let superclass log that we didn't run the test.
......@@ -154,7 +155,7 @@ public abstract class AbstractAnnotationAwareTransactionalTests extends
if (isDisabledInThisEnvironment(testMethod)) {
recordDisabled();
this.logger.info("**** " + getClass().getName() + "." + getName() + " disabled in this environment: "
this.logger.info("**** " + getClass().getName() + "." + getName() + " is disabled in this environment: "
+ "Total disabled tests=" + getDisabledTestCount());
return;
}
......
......@@ -163,6 +163,23 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void runBare() throws Throwable {
// getName will return the name of the method being run.
if (isDisabledInThisEnvironment(getName())) {
// Let superclass log that we didn't run the test.
super.runBare();
return;
}
final Method testMethod = getTestMethod();
if (isDisabledInThisEnvironment(testMethod)) {
recordDisabled();
this.logger.info("**** " + getClass().getName() + "." + getName() + " is disabled in this environment: "
+ "Total disabled tests=" + getDisabledTestCount());
return;
}
if (!shouldUseShadowLoader()) {
super.runBare();
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册