Navigation Menu

Skip to content

Commit

Permalink
[FIXED JENKINS-25424] Register the descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza committed Dec 6, 2014
1 parent 2cb6669 commit 8040741
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/xvnc/DisplayAllocator.java
@@ -1,13 +1,14 @@
package hudson.plugins.xvnc;

import hudson.Extension;
import hudson.model.Node;
import hudson.slaves.NodeProperty;
import hudson.slaves.NodePropertyDescriptor;

import java.util.HashSet;
import java.util.Random;
import java.util.Set;

import hudson.slaves.NodePropertyDescriptor;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

Expand Down Expand Up @@ -83,6 +84,7 @@ private Object readResolve() {
return this;
}

@Extension
public static class DescriptorImpl extends NodePropertyDescriptor {

@Override
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/hudson/plugins/xvnc/XvncTest.java
Expand Up @@ -23,11 +23,13 @@
*/
package hudson.plugins.xvnc;

import static org.junit.Assert.assertTrue;
import hudson.Launcher;
import hudson.model.BuildListener;
import hudson.model.FreeStyleBuild;
import hudson.model.Result;
import hudson.model.AbstractBuild;
import hudson.model.Descriptor;
import hudson.model.FreeStyleProject;
import hudson.model.Hudson;
import hudson.plugins.xvnc.Xvnc.DescriptorImpl;
Expand Down Expand Up @@ -125,6 +127,12 @@ public void avoidNpeAfterDeserialiation() throws Exception {
j.buildAndAssertSuccess(p);
}

@Test @Bug(25424)
public void jenkins25424() {
Descriptor<?> desc = j.jenkins.getDescriptorOrDie(DisplayAllocator.Property.class);
assertTrue(desc instanceof DisplayAllocator.Property.DescriptorImpl);
}

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

0 comments on commit 8040741

Please sign in to comment.