提交 ad9d191c 编写于 作者: T tfennelly

[FIXED JENKINS-27256] Added functional test for stapler fix to handle...

[FIXED JENKINS-27256] Added functional test for stapler fix to handle dispatcher methods for getX(long) model methods
上级 80e9f3f5
......@@ -39,7 +39,7 @@ THE SOFTWARE.
<properties>
<staplerFork>true</staplerFork>
<stapler.version>1.234</stapler.version>
<stapler.version>1.235-20150312.163208-1</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>1.8.9</groovy.version>
</properties>
......
......@@ -26,6 +26,7 @@ package hudson.model;
import com.gargoylesoftware.htmlunit.html.HtmlFileInput;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.xml.XmlPage;
import hudson.Launcher;
import hudson.XmlFile;
import hudson.matrix.AxisList;
......@@ -421,6 +422,27 @@ public class QueueTest {
assert task.exec instanceof OneOffExecutor : task.exec;
}
@Issue("JENKINS-27256")
@Test public void inQueueTaskLookupByAPI() throws Exception {
FreeStyleProject p = r.createFreeStyleProject();
Label label = Label.get("unknown-slave");
// Give the project an "unknown-slave" label, forcing it to
// stay in the queue after we schedule it, allowing us to query it.
p.setAssignedLabel(label);
p.scheduleBuild2(0);
JenkinsRule.WebClient webclient = r.createWebClient();
XmlPage queueItems = webclient.goToXml("queue/api/xml");
String queueTaskId = queueItems.getXmlDocument().getElementsByTagName("id").item(0).getTextContent();
assertNotNull(queueTaskId);
XmlPage queueItem = webclient.goToXml("queue/item/" + queueTaskId + "/api/xml");
assertNotNull(queueItem);
String tagName = queueItem.getDocumentElement().getTagName();
assertTrue(tagName.equals("blockedItem") || tagName.equals("buildableItem"));
}
private static class TestFlyweightTask extends TestTask implements Queue.FlyweightTask {
Executor exec;
private final Label assignedLabel;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册