Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIXES JENKINS-18434 - Added validation error to Parameterized build c…
…hoice, removed hard error.
- Loading branch information
Showing
6 changed files
with
52 additions
and
9 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
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
17 changes: 17 additions & 0 deletions
17
core/src/test/java/hudson/model/ChoiceParameterDefinitionTest.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,17 @@ | ||
package hudson.model; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class ChoiceParameterDefinitionTest { | ||
@Test | ||
public void shouldValidateChoices(){ | ||
assertFalse(ChoiceParameterDefinition.areValidChoices("")); | ||
assertFalse(ChoiceParameterDefinition.areValidChoices(" ")); | ||
assertTrue(ChoiceParameterDefinition.areValidChoices("abc")); | ||
assertTrue(ChoiceParameterDefinition.areValidChoices("abc\ndef")); | ||
assertTrue(ChoiceParameterDefinition.areValidChoices("abc\r\ndef")); | ||
} | ||
} |
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