-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-introduce support for Junit5 tests not having JenkinsRule as param…
…eter (#909)
- Loading branch information
Showing
4 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/test/java/org/jvnet/hudson/test/junit/jupiter/JenkinsRuleResolverBeforeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.jvnet.hudson.test.junit.jupiter; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
import org.jvnet.hudson.test.recipes.LocalData; | ||
|
||
@WithJenkins | ||
class JenkinsRuleResolverBeforeTest { | ||
private JenkinsRule rule; | ||
|
||
@BeforeEach | ||
void before(JenkinsRule rule) { | ||
this.rule = rule; | ||
} | ||
|
||
@LocalData | ||
@Test | ||
void localData() { | ||
assertNotNull(rule.jenkins.getItem("testJob")); | ||
} | ||
|
||
@LocalData | ||
@Test | ||
void localDataZip() { | ||
assertNotNull(rule.jenkins.getItem("somejob")); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...hudson/test/junit/jupiter/JenkinsRuleResolverBeforeTest/localData/jobs/testJob/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project> | ||
<actions/> | ||
<description></description> | ||
<properties> | ||
<hudson.security.AuthorizationMatrixProperty> | ||
<useProjectSecurity>true</useProjectSecurity> | ||
<permission>hudson.model.Item.ExtendedRead:alice</permission> | ||
<permission>hudson.model.Item.Configure:alice</permission> | ||
<permission>hudson.model.Item.Configure:bob</permission> | ||
<permission>hudson.model.Item.ExtendedRead:charlie</permission> | ||
</hudson.security.AuthorizationMatrixProperty> | ||
</properties> | ||
<scm class="hudson.scm.NullSCM"/> | ||
<canRoam>true</canRoam> | ||
<disabled>false</disabled> | ||
<jdk>(Default)</jdk> | ||
<triggers class="vector"/> | ||
<builders/> | ||
<publishers/> | ||
<buildWrappers/> | ||
</project> |
Binary file added
BIN
+499 Bytes
...ources/org/jvnet/hudson/test/junit/jupiter/JenkinsRuleResolverBeforeTest/localDataZip.zip
Binary file not shown.