From 59a0061c93094d0e0873e497675b78556da967b9 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Thu, 16 Jun 2022 10:18:03 -0700 Subject: [PATCH 1/3] [JENKINS-48466] Provide JUnit 5 support for `JenkinsRule` --- test/pom.xml | 27 ++++++++++++++++++- .../console/ExceptionAnnotationTest.java | 12 ++++----- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/test/pom.xml b/test/pom.xml index 3bb7f0e85dca..7ff927e544bd 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -85,7 +85,8 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 1753.v45c760e2400f + + 1785.v779d34f50ea_0 test @@ -178,6 +179,30 @@ THE SOFTWARE. 318.va_f3ccb_729b_71 test + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-api + ${junit.jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit.jupiter.version} + test + org.mockito mockito-inline diff --git a/test/src/test/java/hudson/console/ExceptionAnnotationTest.java b/test/src/test/java/hudson/console/ExceptionAnnotationTest.java index 5bbc8c23b4f8..c347bbe1c22b 100644 --- a/test/src/test/java/hudson/console/ExceptionAnnotationTest.java +++ b/test/src/test/java/hudson/console/ExceptionAnnotationTest.java @@ -5,21 +5,19 @@ import hudson.model.BuildListener; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.TestBuilder; +import org.jvnet.hudson.test.junit.jupiter.EnableJenkins; /** * @author Kohsuke Kawaguchi */ -public class ExceptionAnnotationTest { - - @Rule - public JenkinsRule j = new JenkinsRule(); +class ExceptionAnnotationTest { + @EnableJenkins @Test - public void test() throws Exception { + void test(JenkinsRule j) throws Exception { FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().add(new TestBuilder() { @Override From 6db10fda8d41746852a8aa2655b565f9dfd87eb4 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 18 Jul 2022 10:32:35 -0700 Subject: [PATCH 2/3] https://github.com/jenkinsci/jenkins-test-harness/pull/438 was released --- test/pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/pom.xml b/test/pom.xml index fef17504681e..998b3955a302 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -90,8 +90,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - - 1819.vb_34b_c3898b_7e + 1813.v14f5db_a_f2b_d3 test From 7c054229d14e9a7f1efd1cab95175bb031448929 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 20 Jul 2022 08:56:58 -0700 Subject: [PATCH 3/3] Update test harness --- test/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pom.xml b/test/pom.xml index 41c541a0162a..06e8bad471f1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -90,7 +90,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 1813.v14f5db_a_f2b_d3 + 1816.v8138d8056949 test