Skip to content

Commit

Permalink
Improve assertion message for Windows failure diagnosis
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Jan 22, 2025
1 parent 4144978 commit f092c69
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1057,13 +1057,30 @@ private SCM getGitSCM(String... urls) {
return new GitSCM(configs, null, null, null, null);
}

private String itemValues(ItemsErrorModel items) {
String values = "";
for (int i = 0; i < items.size(); i++) {
values = values + " " + items.get(i).value;
}
return values;
}

private String itemNames(ItemsErrorModel items) {
String names = "";
for (int i = 0; i < items.size(); i++) {
names = names + " " + items.get(i).name;
}
return names;
}

private boolean isListBoxItem(ItemsErrorModel items, String item) {
boolean itemExists = false;
for (int i = 0; i < items.size(); i++) {
if (items.get(i).value.contains(item)) {
itemExists = true;
}
}
assertTrue("Item '" + item + "' not found in values '" + itemValues(items) + "'", itemExists);
return itemExists;
}

Expand All @@ -1074,6 +1091,7 @@ private boolean isListBoxItemName(ItemsErrorModel items, String item) {
itemExists = true;
}
}
assertTrue("Item '" + item + "' not found in names '" + itemNames(items) + "'", itemExists);
return itemExists;
}
}

0 comments on commit f092c69

Please sign in to comment.