Skip to content
Permalink
Browse files

[JENKINS-28972] Added tests to reproduce JENKINS-28972, fails to load…

… configuration pages when SimpleBuildSelectorDescriptor is used in other plugins.
  • Loading branch information...
ikedam committed Jun 28, 2015
1 parent fab46fd commit e4f0b5dd46a03394cd4053a3d137789669c90fe0
@@ -76,11 +76,13 @@
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.ExtractResourceSCM;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.CaptureEnvironmentBuilder;
import org.jvnet.hudson.test.FailureBuilder;
import org.jvnet.hudson.test.MockFolder;
import org.jvnet.hudson.test.UnstableBuilder;
import org.jvnet.hudson.test.recipes.LocalData;
import org.jvnet.hudson.test.recipes.WithPlugin;

import com.cloudbees.hudson.plugins.folder.Folder;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
@@ -1792,4 +1794,33 @@ public void testQueueItemAuthenticator() throws Exception {
assertBuildStatus(Result.FAILURE, copier.scheduleBuild2(0).get(TIMEOUT, TimeUnit.SECONDS));
}
}

@Issue("JENKINS-28972")
@LocalData
@WithPlugin("copyartifact-extension-test.hpi") // JENKINS-28792 reproduces only when classes are located in different class loaders.
public void testSimpleBuildSelectorDescriptorInOtherPlugin() throws Exception {
WebClient wc = createWebClient();

// An extension using SimpleBuildSelectorDescriptorSelector
{
FreeStyleProject p = jenkins.getItemByFullName("UsingSimpleBuildSelectorDescriptorSelector", FreeStyleProject.class);
assertNotNull(p);
wc.getPage(p, "configure");
}

// An extension using SimpleBuildSelectorDescriptorSelector without configuration pages.
{
FreeStyleProject p = jenkins.getItemByFullName("NoConfigPageSimpleBuildSelectorDescriptorSelector", FreeStyleProject.class);
assertNotNull(p);
wc.getPage(p, "configure");
}

// An extension extending SimpleBuildSelectorDescriptorSelector.
// (Even though generally it is useless)
{
FreeStyleProject p = jenkins.getItemByFullName("ExtendingSimpleBuildSelectorDescriptorSelector", FreeStyleProject.class);
assertNotNull(p);
wc.getPage(p, "configure");
}
}
}
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<version>1.580.1</version>
</hudson>
@@ -0,0 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.35">
<project>ExtendingSimpleBuildSelectorDescriptorSelector</project>
<filter>**/*</filter>
<target></target>
<excludes></excludes>
<selector class="org.jenkinsci.plugins.copyartifactextensiontest.ExtendingSimpleBuildSelectorDescriptorSelector" plugin="copyartifact-extension-test@1.0-SNAPSHOT">
<field>test</field>
</selector>
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
</hudson.plugins.copyartifact.CopyArtifact>
</builders>
<publishers/>
<buildWrappers/>
</project>
@@ -0,0 +1,26 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.35">
<project>NoConfigPageSimpleBuildSelectorDescriptorSelector</project>
<filter>**/*</filter>
<target></target>
<excludes></excludes>
<selector class="org.jenkinsci.plugins.copyartifactextensiontest.NoConfigPageSimpleBuildSelectorDescriptorSelector" plugin="copyartifact-extension-test@1.0-SNAPSHOT"/>
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
</hudson.plugins.copyartifact.CopyArtifact>
</builders>
<publishers/>
<buildWrappers/>
</project>
@@ -0,0 +1,28 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.35">
<project>UsingSimpleBuildSelectorDescriptorSelector</project>
<filter>**/*</filter>
<target></target>
<excludes></excludes>
<selector class="org.jenkinsci.plugins.copyartifactextensiontest.UsingSimpleBuildSelectorDescriptorSelector" plugin="copyartifact-extension-test@1.0-SNAPSHOT">
<field>test</field>
</selector>
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
</hudson.plugins.copyartifact.CopyArtifact>
</builders>
<publishers/>
<buildWrappers/>
</project>
@@ -0,0 +1,3 @@
* copyartifact-extension-test.hpi
* A plugin to test plugins depending copyartifact-plugin.
* You can get sources at https://github.com/ikedam/copyartifact-extension-test.
Binary file not shown.

0 comments on commit e4f0b5d

Please sign in to comment.
You can’t perform that action at this time.