Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #37 from ikedam/feature/JENKINS-49210_NoSublist
[JENKINS-49210] [JENKINS-49017] Do not use RandomAccessSubList
- Loading branch information
Showing
7 changed files
with
136 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# For backward compatibility with 1.4.2- | ||
java.util.RandomAccessSubList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/test/java/jp/ikedam/jenkins/plugins/extensible_choice_parameter/IntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2018 IKEDA Yasuyuki | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package jp.ikedam.jenkins.plugins.extensible_choice_parameter; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.Issue; | ||
import org.jvnet.hudson.test.recipes.LocalData; | ||
|
||
import hudson.model.FreeStyleBuild; | ||
import hudson.model.FreeStyleProject; | ||
import hudson.model.TaskListener; | ||
|
||
/** | ||
* Tests using several {@link ChoiceListProvider}s | ||
*/ | ||
public class IntegrationTest { | ||
@Rule | ||
public ExtensibleChoiceParameterJenkinsRule j = new ExtensibleChoiceParameterJenkinsRule(); | ||
|
||
@Test | ||
@Issue("JENKINS-49210") | ||
@LocalData | ||
// This test explains why we need hudson.remoting.ClassFilter file with Jenkins 2.102+ | ||
public void testJEP200() throws Exception { | ||
FreeStyleProject p = j.jenkins.getItemByFullName("JobWithSublist", FreeStyleProject.class); | ||
FreeStyleBuild b = j.assertBuildStatusSuccess(p.scheduleBuild2(0)); | ||
assertEquals("ChoiceWithSublist1", b.getEnvironment(TaskListener.NULL).get("ChoiceWithSublist")); | ||
assertEquals("GlobalChoiceWithSublist1", b.getEnvironment(TaskListener.NULL).get("GlobalChoiceWithSublist")); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
.../ikedam/jenkins/plugins/extensible_choice_parameter/IntegrationTest/testJEP200/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<hudson> | ||
<version>1.580.1</version> | ||
</hudson> |
49 changes: 49 additions & 0 deletions
49
...ins/extensible_choice_parameter/IntegrationTest/testJEP200/jobs/JobWithSublist/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project> | ||
<actions/> | ||
<description></description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties> | ||
<hudson.model.ParametersDefinitionProperty> | ||
<parameterDefinitions> | ||
<jp.ikedam.jenkins.plugins.extensible__choice__parameter.ExtensibleChoiceParameterDefinition plugin="extensible-choice-parameter@1.4.2"> | ||
<name>ChoiceWithSublist</name> | ||
<description></description> | ||
<editable>false</editable> | ||
<choiceListProvider class="jp.ikedam.jenkins.plugins.extensible_choice_parameter.TextareaChoiceListProvider"> | ||
<choiceList class="java.util.RandomAccessSubList"> | ||
<l class="java.util.Arrays$ArrayList"> | ||
<a class="string-array"> | ||
<string>ChoiceWithSublist1</string> | ||
<string>ChoiceWithSublist2</string> | ||
<string>ChoiceWithSublist3</string> | ||
<string></string> | ||
</a> | ||
</l> | ||
<offset>0</offset> | ||
<size>3</size> | ||
</choiceList> | ||
</choiceListProvider> | ||
</jp.ikedam.jenkins.plugins.extensible__choice__parameter.ExtensibleChoiceParameterDefinition> | ||
<jp.ikedam.jenkins.plugins.extensible__choice__parameter.ExtensibleChoiceParameterDefinition plugin="extensible-choice-parameter@1.4.3-SNAPSHOT"> | ||
<name>GlobalChoiceWithSublist</name> | ||
<description></description> | ||
<editable>false</editable> | ||
<choiceListProvider class="jp.ikedam.jenkins.plugins.extensible_choice_parameter.GlobalTextareaChoiceListProvider"> | ||
<name>GlobalChoiceWithSublist</name> | ||
</choiceListProvider> | ||
</jp.ikedam.jenkins.plugins.extensible__choice__parameter.ExtensibleChoiceParameterDefinition> | ||
</parameterDefinitions> | ||
</hudson.model.ParametersDefinitionProperty> | ||
</properties> | ||
<scm class="hudson.scm.NullSCM"/> | ||
<canRoam>true</canRoam> | ||
<disabled>false</disabled> | ||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> | ||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> | ||
<triggers/> | ||
<concurrentBuild>false</concurrentBuild> | ||
<builders/> | ||
<publishers/> | ||
<buildWrappers/> | ||
</project> |
21 changes: 21 additions & 0 deletions
21
...p.ikedam.jenkins.plugins.extensible_choice_parameter.GlobalTextareaChoiceListProvider.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<jp.ikedam.jenkins.plugins.extensible__choice__parameter.GlobalTextareaChoiceListProvider_-DescriptorImpl plugin="extensible-choice-parameter@1.4.2"> | ||
<choiceListEntryList> | ||
<jp.ikedam.jenkins.plugins.extensible__choice__parameter.GlobalTextareaChoiceListEntry> | ||
<name>GlobalChoiceWithSublist</name> | ||
<choiceList class="java.util.RandomAccessSubList"> | ||
<l class="java.util.Arrays$ArrayList"> | ||
<a class="string-array"> | ||
<string>GlobalChoiceWithSublist1</string> | ||
<string>GlobalChoiceWithSublist2</string> | ||
<string>GlobalChoiceWithSublist3</string> | ||
<string></string> | ||
</a> | ||
</l> | ||
<offset>0</offset> | ||
<size>3</size> | ||
</choiceList> | ||
<allowAddEditedValue>false</allowAddEditedValue> | ||
</jp.ikedam.jenkins.plugins.extensible__choice__parameter.GlobalTextareaChoiceListEntry> | ||
</choiceListEntryList> | ||
</jp.ikedam.jenkins.plugins.extensible__choice__parameter.GlobalTextareaChoiceListProvider_-DescriptorImpl> |