"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/test/java/hudson/model/RunParameterValueTest.java" between
jenkins-jenkins-2.302.tar.gz and jenkins-jenkins-2.303.tar.gz

About: Jenkins is a automation server (written in Java) which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software (for e.g. as Continuous Integration and Continuous Delivery server). Weekly release.

RunParameterValueTest.java  (jenkins-jenkins-2.302):RunParameterValueTest.java  (jenkins-jenkins-2.303)
skipping to change at line 30 skipping to change at line 30
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
package hudson.model; package hudson.model;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail; import static org.junit.Assert.assertThrows;
public class RunParameterValueTest { public class RunParameterValueTest {
@SuppressWarnings("ResultOfObjectAllocationIgnored") @SuppressWarnings("ResultOfObjectAllocationIgnored")
@Test public void robustness() throws Exception { @Test public void robustness() throws Exception {
RunParameterValue rpv = new RunParameterValue("whatever", "folder/job#57 "); RunParameterValue rpv = new RunParameterValue("whatever", "folder/job#57 ");
assertEquals("whatever", rpv.getName()); assertEquals("whatever", rpv.getName());
assertEquals("folder/job", rpv.getJobName()); assertEquals("folder/job", rpv.getJobName());
assertEquals("57", rpv.getNumber()); assertEquals("57", rpv.getNumber());
try {
new RunParameterValue("whatever", null); assertThrows(IllegalArgumentException.class, () -> new RunParameterValue
fail(); ("whatever", null));
} catch (IllegalArgumentException x) { assertThrows(IllegalArgumentException.class, () -> new RunParameterValue
// good ("whatever", "invalid"));
} assertThrows(IllegalArgumentException.class, () -> new RunParameterValue
try { ("whatever", "invalid", "desc"));
new RunParameterValue("whatever", "invalid");
fail();
} catch (IllegalArgumentException x) {
// good
}
try {
new RunParameterValue("whatever", "invalid", "desc");
fail();
} catch (IllegalArgumentException x) {
// good
}
rpv = (RunParameterValue) Run.XSTREAM2.fromXML("<hudson.model.RunParamet erValue><name>whatever</name><runId>bogus</runId></hudson.model.RunParameterValu e>"); rpv = (RunParameterValue) Run.XSTREAM2.fromXML("<hudson.model.RunParamet erValue><name>whatever</name><runId>bogus</runId></hudson.model.RunParameterValu e>");
assertEquals("whatever", rpv.getName()); assertEquals("whatever", rpv.getName());
assertNull(rpv.getJobName()); assertNull(rpv.getJobName());
assertNull(rpv.getNumber()); assertNull(rpv.getNumber());
} }
} }
 End of changes. 2 change blocks. 
19 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)