Skip to content

Commit

Permalink
JENKINS-45137 fix xml migration
Browse files Browse the repository at this point in the history
Set build card to standard build card, if not defined
  • Loading branch information
Dan Alvizu committed Jun 27, 2017
1 parent 90f1c07 commit ea5f659
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Expand Up @@ -298,9 +298,9 @@ protected Object readResolve() {
} else {
rowHeaders = new SimpleRowHeader();
}
if (buildCard == null) {
buildCard = new StandardBuildCard();
}
}
if (buildCard == null) {
buildCard = new StandardBuildCard();
}
return this;
}
Expand Down
Expand Up @@ -222,6 +222,24 @@ public void testMigration() throws IOException {
assertEquals(SimpleColumnHeader.class, testView.getColumnHeaders().getClass());
assertNotNull(testView.getBuildCard());
assertEquals(StandardBuildCard.class, testView.getBuildCard().getClass());

testView = new BuildPipelineView("My Build Pipeline Name",
"My Build Pipeline Title", new DownstreamProjectGridBuilder("Sample Project"),
"3", false, false,
false /* showPipelineParameters */,
false /* showPipelineParametersInHeaders */,
true /* showPipelineDefinitionHeader */,
3,
null,
null,
new SimpleColumnHeader(),
new SimpleRowHeader(),
null);
testView.readResolve();
assertNotNull(testView.getColumnHeaders());
assertEquals(SimpleColumnHeader.class, testView.getColumnHeaders().getClass());
assertNotNull(testView.getBuildCard());
assertEquals(StandardBuildCard.class, testView.getBuildCard().getClass());
}

@Test
Expand Down

0 comments on commit ea5f659

Please sign in to comment.