Skip to content
Permalink
Browse files
[JENKINS-25424] End-to-end test
  • Loading branch information
olivergondza committed Dec 11, 2014
1 parent 39ec1bd commit c68619dd57d7b048b25dd449a26c8cf4e6c95818
Showing 1 changed file with 22 additions and 1 deletion.
@@ -32,6 +32,7 @@
import hudson.model.Descriptor;
import hudson.model.FreeStyleProject;
import hudson.model.Hudson;
import hudson.model.Node;
import hudson.plugins.xvnc.Xvnc.DescriptorImpl;
import hudson.slaves.DumbSlave;
import hudson.tasks.Builder;
@@ -75,7 +76,7 @@ public void distinctDisplaySpaceForSlaves() throws Exception {
public void reuseDisplayNumberOnSameSlave() throws Exception {
FreeStyleProject p = j.jenkins.createProject(FreeStyleProject.class, "project");

runXvnc(p).cleanUp = true;;
runXvnc(p).cleanUp = true;

j.buildAndAssertSuccess(p);
j.buildAndAssertSuccess(p);
@@ -133,6 +134,26 @@ public void jenkins25424() {
assertTrue(desc instanceof DisplayAllocator.Property.DescriptorImpl);
}

@Test @Bug(25424)
public void saveComputerWithDisplayAllocatorProperty() throws Exception {
DumbSlave slave = j.createOnlineSlave();

configRoundtrip(slave); // Without property

FreeStyleProject p = j.jenkins.createProject(FreeStyleProject.class, "project");
p.setAssignedNode(slave);
runXvnc(p).cleanUp = true;
j.buildAndAssertSuccess(p);

configRoundtrip(slave); // With property
}

// TODO available since 1.479 in JenkinsRule
private <N extends Node> N configRoundtrip(N node) throws Exception {
j.submit(j.createWebClient().goTo("/computer/" + node.getNodeName() + "/configure").getFormByName("config"));
return (N)j.jenkins.getNode(node.getNodeName());
}

private Xvnc fakeXvncRun(FreeStyleProject p) throws Exception {
final Xvnc xvnc = new Xvnc(false, false);
p.getBuildWrappersList().add(xvnc);

0 comments on commit c68619d

Please sign in to comment.