Skip to content
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

XStreamSerializable #881

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Dec 2, 2024

Occasionally a RealJenkinsRule-based test utility needs to pass and/or return a structured object which is not Serializable. This is currently awkward; you can try to move the code to create/assert the object inside the Jenkins JVM, or find some ad-hoc way of passing it. Since XStream does not require objects to implement Serializable, and many types used in Jenkins are safe to round-trip via XML but are not marked Serializable, it is convenient to be able to work with them directly. (I considered just relaxing the signatures of the various runRemotely overloads to tolerate any Object, and magically wrap them if not already Serializable, but this seemed complicated and prone to abuse. It is better to be conscious of the fact that you are serializing objects somehow.)

@jglick jglick requested a review from Vlatombe December 2, 2024 18:49
pom.xml Show resolved Hide resolved
* <li>{@code static} state cannot be shared between the top-level test code and test bodies (though the compiler will not catch this mistake).
* <li>When using a snapshot dep on Jenkins core, you must build {@code jenkins.war} to test core changes (there is no “compile-on-save” support for this).
* <li>{@link TestExtension} is not available.
* <li>{@link TestExtension} is not available (but try {@link #addSyntheticPlugin}).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(forgotten in #659)

@jglick jglick requested a review from Vlatombe December 3, 2024 13:24
@Vlatombe Vlatombe merged commit 163897b into jenkinsci:master Dec 3, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants