You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JenkinsRule tests commonly use @TestExtension to define mock implementations of various APIs, which is a very powerful system. For RealJenkinsRule, there is no direct equivalent. As
* <li>Possibly {@link ExtensionList#add(Object)} can be used as an alternative to {@link TestExtension}.
hints at, you can define new types in test sources and load them in a Jenkins JVM, and even register them programmatically with ExtensionList.add (suppressing the deprecation warning), but they will be defined in an unusual class loader (not UberClassLoader) and there may be other reasons why the test cannot be made to pass or would not be convincing if it did.
🤔 There could be a system whereby you could define a src/test/java/some/dedicated/pkg/package-info.java with a SOURCE-retention annotation directing a processor to create a target/test-classes/plugins/some-dedicated-pkg.jpi which could be included in addPlugins.
JenkinsRule
tests commonly use@TestExtension
to define mock implementations of various APIs, which is a very powerful system. ForRealJenkinsRule
, there is no direct equivalent. Asjenkins-test-harness/src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java
Line 140 in 787a641
ExtensionList.add
(suppressing the deprecation warning), but they will be defined in an unusual class loader (notUberClassLoader
) and there may be other reasons why the test cannot be made to pass or would not be convincing if it did.🤔 There could be a system whereby you could define a
src/test/java/some/dedicated/pkg/package-info.java
with aSOURCE
-retention annotation directing a processor to create atarget/test-classes/plugins/some-dedicated-pkg.jpi
which could be included inaddPlugins
.jenkins-test-harness/src/main/java/org/jvnet/hudson/test/RealJenkinsRule.java
Lines 222 to 227 in 787a641
The text was updated successfully, but these errors were encountered: