So passing it in explicitly from both the view main page and from the Maven module set modules page.
A more automatic solution might be to make getRelativeDisplayNameFrom use Ancestor.
Added a listener that gets called at the end of the test to provide opportunity for a cleanup.
This avoids the code duplication between HudsonTestCase vs JenkinsRule, too.
Links are now correct, thanks to Ancestor.getRelativePath as called from getRelativeLinkTo being correct.
But getRelativeNameFrom is not working, so anchor texts are ‘project » module’ rather than simply ‘module’.
https://ci.jenkins-ci.org/job/jenkins_main_trunk/2602/testReport/junit/hudson.model/JobTest/readPermission/
com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 404 Not Found for http://localhost:47898/jenkins//j_acegi_security_check
at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:549)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:333)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:357)
at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:196)
at org.jvnet.hudson.test.JenkinsRule$WebClient.login(JenkinsRule.java:1776)
at org.jvnet.hudson.test.JenkinsRule$WebClient.login(JenkinsRule.java:1788)
at hudson.model.JobTest.readPermission(JobTest.java:182)
As Jesse pointed out, contextual information is often useful in authenticating the build, which means we need to take Queue.Item (initially AbstractBuild was the parameter, which provided the context, and I failed to accommodate that in transition to AbstractProject.)
To still allow Queue.Tasks to provide a meaningful value fallback to Queue.Task.getDefaultAuthentication() as opposed to hard code it to ACL.SYSTEM. This allow plugins like remote-terminal-access to supply a meaningful secure value without forcing a configuration change to the user.
This came up with a conversation with JFrog folks who neede to insert a
custom Plexus component to tweak the behaviour.
This scheme allows the caller to insert additional jar files into the
Maven process.