diff --git a/forge-gui-desktop/src/test/java/forge/ai/simulation/SimulationTestCase.java b/forge-gui-desktop/src/test/java/forge/ai/simulation/SimulationTestCase.java index 7b7a8bfe108..4cac504d5f9 100644 --- a/forge-gui-desktop/src/test/java/forge/ai/simulation/SimulationTestCase.java +++ b/forge-gui-desktop/src/test/java/forge/ai/simulation/SimulationTestCase.java @@ -29,22 +29,13 @@ import forge.item.IPaperCard; import forge.model.FModel; import forge.properties.ForgePreferences; import forge.properties.ForgePreferences.FPref; + import junit.framework.TestCase; public class SimulationTestCase extends TestCase { private static boolean initialized = false; protected Game initAndCreateGame() { - List players = Lists.newArrayList(); - Deck d1 = new Deck(); - players.add(new RegisteredPlayer(d1).setPlayer(new LobbyPlayerAi("p2", null))); - Set options = new HashSet<>(); - options.add(AIOption.USE_SIMULATION); - players.add(new RegisteredPlayer(d1).setPlayer(new LobbyPlayerAi("p1", options))); - GameRules rules = new GameRules(GameType.Constructed); - Match match = new Match(rules, players, "Test"); - Game game = new Game(players, rules, match); - game.setAge(GameStage.Play); if (!initialized) { GuiBase.setInterface(new GuiDesktop()); @@ -57,6 +48,19 @@ public class SimulationTestCase extends TestCase { }); initialized = true; } + + // need to be done after FModel.initialize, or the Localizer isn't loaded yet + List players = Lists.newArrayList(); + Deck d1 = new Deck(); + players.add(new RegisteredPlayer(d1).setPlayer(new LobbyPlayerAi("p2", null))); + Set options = new HashSet<>(); + options.add(AIOption.USE_SIMULATION); + players.add(new RegisteredPlayer(d1).setPlayer(new LobbyPlayerAi("p1", options))); + GameRules rules = new GameRules(GameType.Constructed); + Match match = new Match(rules, players, "Test"); + Game game = new Game(players, rules, match); + game.setAge(GameStage.Play); + return game; }