From 1bf958afb196d0c56b37f00681027a549d0c9189 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 25 Mar 2013 12:53:27 -0400 Subject: [PATCH] [JENKINS-17337] Added test for NPE. --- .../hudson/matrix/MatrixProjectTest.groovy | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/src/test/groovy/hudson/matrix/MatrixProjectTest.groovy b/test/src/test/groovy/hudson/matrix/MatrixProjectTest.groovy index bf4079ea7d..85f0db0b1e 100644 --- a/test/src/test/groovy/hudson/matrix/MatrixProjectTest.groovy +++ b/test/src/test/groovy/hudson/matrix/MatrixProjectTest.groovy @@ -471,4 +471,20 @@ public class MatrixProjectTest { assertNull(defaultExecutionStrategy.getSorter()); } + @Bug(17337) + @Test public void reload() throws Exception { + MatrixProject p = j.createMatrixProject(); + AxisList axes = new AxisList(); + axes.add(new TextAxis("p", "only")); + p.setAxes(axes); + String n = p.getFullName(); + j.buildAndAssertSuccess(p); + j.jenkins.reload(); + p = j.jenkins.getItemByFullName(n, MatrixProject.class); + assertNotNull(p); + MatrixConfiguration c = p.getItem("p=only"); + assertNotNull(c); + assertNotNull(c.getBuildByNumber(1)); + } + } -- GitLab