-
-
Notifications
You must be signed in to change notification settings - Fork 107
Update plugin parent POM and forward compatibility for tests #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
8a4763f
a3fd790
7e40b24
f862167
6082680
d773fd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| <parent> | ||
| <groupId>org.jenkins-ci.plugins</groupId> | ||
| <artifactId>plugin</artifactId> | ||
| <version>4.38</version> | ||
| <version>4.40</version> | ||
| <relativePath /> | ||
| </parent> | ||
|
|
||
|
|
@@ -29,10 +29,9 @@ | |
| <properties> | ||
| <revision>3.10.0</revision> | ||
| <changelist>-SNAPSHOT</changelist> | ||
| <gitHubRepo>jenkinsci/config-file-provider-plugin</gitHubRepo> | ||
| <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I was here, improving this bit of logic to be consistent with the canonical format in |
||
| <maven.javadoc.skip>true</maven.javadoc.skip> | ||
| <jenkins.version>2.303.3</jenkins.version> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that we are not bumping the baseline here. This is to support my efforts to switch jenkinsci/bom to JENKINS-45047. This also is friendlier to users by allowing new releases to be adopted by older consumers. |
||
| <java.level>8</java.level> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As of the update to parent POM 4.40, |
||
| <hpi.compatibleSinceVersion>2.15</hpi.compatibleSinceVersion> | ||
| </properties> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| import com.gargoylesoftware.htmlunit.html.HtmlInput; | ||
| import com.gargoylesoftware.htmlunit.html.HtmlPage; | ||
| import com.gargoylesoftware.htmlunit.html.HtmlRadioButtonInput; | ||
| import hudson.util.VersionNumber; | ||
| import org.jenkinsci.plugins.configfiles.custom.CustomConfig; | ||
| import org.junit.Rule; | ||
| import org.junit.Test; | ||
|
|
@@ -55,7 +56,8 @@ public void regularCaseStillWorking() throws Exception { | |
| assertThat(store.getConfigs(), hasSize(1)); | ||
|
|
||
| HtmlPage configFiles = wc.goTo("configfiles"); | ||
| HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]"); | ||
| String attribute = j.jenkins.getVersion().isOlderThan(new VersionNumber("2.324")) ? "onclick" : "data-url"; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here and elsewhere, we make the test compatible with both old and new versions of Jenkins by choosing the correct attribute based on the Jenkins version of the code under test. |
||
| HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@" + attribute + ", 'removeConfig?id=" + CONFIG_ID + "')]"); | ||
|
|
||
| AtomicReference<Boolean> confirmCalled = new AtomicReference<>(false); | ||
| wc.setConfirmHandler((page, s) -> { | ||
|
|
@@ -87,7 +89,8 @@ public void xssPrevention() throws Exception { | |
| JenkinsRule.WebClient wc = j.createWebClient(); | ||
|
|
||
| HtmlPage configFiles = wc.goTo("configfiles"); | ||
| HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@onclick, 'removeConfig?id=" + CONFIG_ID + "')]"); | ||
| String attribute = j.jenkins.getVersion().isOlderThan(new VersionNumber("2.324")) ? "onclick" : "data-url"; | ||
| HtmlAnchor removeAnchor = configFiles.getDocumentElement().getFirstByXPath("//a[contains(@" + attribute + ", 'removeConfig?id=" + CONFIG_ID + "')]"); | ||
|
|
||
| AtomicReference<Boolean> confirmCalled = new AtomicReference<>(false); | ||
| AtomicReference<Boolean> alertCalled = new AtomicReference<>(false); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed to allow testing with Java 17 in
jenkinsci/bom.