From ae34a8cb1b4a418bf4fbe0f049b8910229e4f6d4 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 20 Nov 2008 21:33:08 +0000 Subject: [PATCH] basic JUnit 4.5 compatibility (accepting use of deprecated SPI) --- org.springframework.test/ivy.xml | 2 +- .../test/context/junit4/SpringJUnit4ClassRunner.java | 5 +++-- .../test/context/junit4/SpringMethodRoadie.java | 2 +- org.springframework.test/template.mf | 2 +- org.springframework.test/test.iml | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/org.springframework.test/ivy.xml b/org.springframework.test/ivy.xml index e5ce4d5ea0..89e29293e7 100644 --- a/org.springframework.test/ivy.xml +++ b/org.springframework.test/ivy.xml @@ -25,7 +25,7 @@ - + diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java b/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java index 6092ab6ce4..6f8cfb8a5e 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java +++ b/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.LogFactory; import org.junit.internal.runners.InitializationError; import org.junit.internal.runners.JUnit4ClassRunner; import org.junit.runner.Description; +import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunNotifier; import org.springframework.test.annotation.ProfileValueUtils; @@ -148,11 +149,11 @@ public class SpringJUnit4ClassRunner extends JUnit4ClassRunner { testInstance = createTest(); } catch (InvocationTargetException ex) { - notifier.testAborted(description, ex.getCause()); + notifier.fireTestFailure(new Failure(description, ex.getCause())); return; } catch (Exception ex) { - notifier.testAborted(description, ex); + notifier.fireTestFailure(new Failure(description, ex)); return; } diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringMethodRoadie.java b/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringMethodRoadie.java index 1dc1eb46e1..cca9685277 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringMethodRoadie.java +++ b/org.springframework.test/src/main/java/org/springframework/test/context/junit4/SpringMethodRoadie.java @@ -29,10 +29,10 @@ import java.util.concurrent.TimeoutException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.Assume.AssumptionViolatedException; import org.junit.runner.Description; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunNotifier; +import org.junit.internal.AssumptionViolatedException; import org.springframework.test.annotation.Repeat; import org.springframework.test.annotation.Timed; diff --git a/org.springframework.test/template.mf b/org.springframework.test/template.mf index 5d8aed0208..b534064ac2 100644 --- a/org.springframework.test/template.mf +++ b/org.springframework.test/template.mf @@ -13,7 +13,7 @@ Import-Template: org.apache.commons.logging.*;version="[1.1.1, 2.0.0)", org.apache.taglibs.standard.*;version="[1.1.2, 2.0.0)";resolution:=optional, org.aspectj.weaver.*;version="[1.5.4, 2.0.0)";resolution:=optional, - org.junit.*;version="[4.4.0, 5.0.0)";resolution:=optional, + org.junit.*;version="[4.5.0, 5.0.0)";resolution:=optional, org.springframework.*;version="[2.5.5.A, 2.5.5.A]";resolution:=optional, org.testng.*;version="[5.8.0, 6.0.0)";resolution:=optional Unversioned-Imports: diff --git a/org.springframework.test/test.iml b/org.springframework.test/test.iml index e3f020edcb..eee5ecbbf4 100644 --- a/org.springframework.test/test.iml +++ b/org.springframework.test/test.iml @@ -76,11 +76,11 @@ - + - +