mirror of
https://github.com/magefree/mage.git
synced 2026-01-19 18:00:01 -08:00
Extra tests to catch card creation errors;
This commit is contained in:
parent
e77b21f4e9
commit
b9b8415c99
3 changed files with 43 additions and 6 deletions
|
|
@ -37,8 +37,16 @@ public class ExportJsonGameplayDataTest {
|
|||
Collection<ExpansionSet> sets = Sets.getInstance().values();
|
||||
for (ExpansionSet set : sets) {
|
||||
for (ExpansionSet.SetCardInfo setInfo : set.getSetCardInfo()) {
|
||||
cards.add(CardImpl.createCard(setInfo.getCardClass(), new CardSetInfo(setInfo.getName(), set.getCode(),
|
||||
setInfo.getCardNumber(), setInfo.getRarity(), setInfo.getGraphicInfo())));
|
||||
// catch cards creation errors and report (e.g. on wrong card code)
|
||||
try {
|
||||
Card card = CardImpl.createCard(setInfo.getCardClass(), new CardSetInfo(setInfo.getName(), set.getCode(),
|
||||
setInfo.getCardNumber(), setInfo.getRarity(), setInfo.getGraphicInfo()));
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
logger.error("Can't create card " + setInfo.getName() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
JsonObject res = new JsonObject();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue