-
-
Notifications
You must be signed in to change notification settings - Fork 77
[JENKINS-48924, JENKINS-48995] - Fix plugin compatibility with Jenkins 2.102+ #29
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
Merged
kinow
merged 7 commits into
jenkinsci:master
from
oleg-nenashev:bug/JENKINS-48924-jep-200
Jan 25, 2018
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d8e49b6
Stop serializing Build fields in TestLinkBuildAction and TestLinkResult
oleg-nenashev 9bf81a9
[JENKINS-48924] - Whitelist TestLink Java API classes being used in T…
oleg-nenashev 8b93d29
[JENKINS-48924] - Forgot some deprecated API
oleg-nenashev c3b85cd
[JENKINS-48995] - Stop storing TestNG parsers in XML
oleg-nenashev 2429714
[JENKINS-48924] - Whitelist TestNG objects for TestLink
oleg-nenashev a92f258
[JENKINS-48924] - Use MasterToSlaveFileCallable
oleg-nenashev b56640e
[JENKINS-48924] - Test case is not finished && makes no sense in the …
oleg-nenashev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -25,32 +25,52 @@ | |
|
|
||
| import hudson.model.Action; | ||
| import hudson.model.AbstractBuild; | ||
| import hudson.model.Run; | ||
| import hudson.plugins.testlink.util.TestLinkHelper; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| import jenkins.model.RunAction2; | ||
| import org.kohsuke.stapler.StaplerProxy; | ||
|
|
||
| /** | ||
| * @author Bruno P. Kinoshita - http://www.kinoshita.eti.br | ||
| * @since 1.0 | ||
| */ | ||
| public class TestLinkBuildAction implements Action, Serializable, StaplerProxy { | ||
| public class TestLinkBuildAction implements RunAction2, Serializable, StaplerProxy { | ||
|
|
||
| private static final long serialVersionUID = -914904584770393909L; | ||
|
|
||
| public static final String DISPLAY_NAME = "TestLink"; | ||
| public static final String ICON_FILE_NAME = "/plugin/testlink/icons/testlink-24.png"; | ||
| public static final String URL_NAME = "testLinkResult"; | ||
|
|
||
| private AbstractBuild<?, ?> build; | ||
| private transient Run<?, ?> build; | ||
|
Member
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. Good, making this |
||
| private TestLinkResult result; | ||
|
|
||
| public TestLinkBuildAction(TestLinkResult result) { | ||
| this.result = result; | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated Use {@link #TestLinkBuildAction(TestLinkResult)} without build definition. | ||
| */ | ||
| @Deprecated | ||
| public TestLinkBuildAction(AbstractBuild<?, ?> build, TestLinkResult result) { | ||
| this.build = build; | ||
| this.result = result; | ||
| } | ||
|
|
||
| @Override | ||
| public void onLoad(Run<?, ?> r) { | ||
| this.build = r; | ||
| } | ||
|
|
||
| @Override | ||
| public void onAttached(Run<?, ?> r) { | ||
| this.build = r; | ||
| } | ||
|
|
||
| public String getDisplayName() { | ||
| return DISPLAY_NAME; | ||
| } | ||
|
|
@@ -67,10 +87,25 @@ public Object getTarget() { | |
| return this.result; | ||
| } | ||
|
|
||
| public AbstractBuild<?, ?> getBuild() { | ||
| /** | ||
| * Gets Run to which the action is attached. | ||
| * @return Run instance | ||
| * @since TODO | ||
| */ | ||
| public Run<?, ?> getRun() { | ||
| return build; | ||
| } | ||
|
|
||
| /** | ||
| * @deprecated Use {@link #getRun()} | ||
| */ | ||
| public AbstractBuild<?, ?> getBuild() { | ||
| if (build instanceof AbstractBuild<?, ?>) { | ||
| return (AbstractBuild<?, ?>)build; | ||
| } | ||
| throw new IllegalStateException("Calling old API against a non-AbstractBuild run type. Run: " + build); | ||
| } | ||
|
|
||
| /** | ||
| * @return TestLink job execution result | ||
| */ | ||
|
|
@@ -107,7 +142,7 @@ public TestLinkResult getPreviousResult() { | |
| */ | ||
| public TestLinkBuildAction getPreviousAction() { | ||
| if (this.build != null) { | ||
| AbstractBuild<?, ?> previousBuild = this.build.getPreviousBuild(); | ||
| Run<?, ?> previousBuild = this.build.getPreviousBuild(); | ||
| if (previousBuild != null) { | ||
| return previousBuild.getAction(TestLinkBuildAction.class); | ||
| } | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,9 @@ | ||
| # In TestCaseWrapper, contains only base classes | ||
| br.eti.kinoshita.testlinkjavaapi.model.Attachment | ||
|
|
||
| # Test case and nested classes which may need whitelisting, no deserialization logic there | ||
| br.eti.kinoshita.testlinkjavaapi.model.TestCase | ||
| br.eti.kinoshita.testlinkjavaapi.model.TestCaseStep | ||
| br.eti.kinoshita.testlinkjavaapi.model.CustomField | ||
| br.eti.kinoshita.testlinkjavaapi.model.Platform | ||
|
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Surprisingly, #25 does not do that