From 135c76ed71bf64c9e0037462bfc862c7bfa1ac74 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 23:23:26 +0200 Subject: [PATCH] Added possibility to set a specific deck for a test. --- Mage.Tests/CommanderDuel_UW.dck | 70 +++++++++++++++++++ .../base/CardTestCommanderDuelBase.java | 10 ++- .../serverside/base/CardTestPlayerBase.java | 9 ++- .../base/impl/CardTestPlayerAPIImpl.java | 11 +++ 4 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 Mage.Tests/CommanderDuel_UW.dck diff --git a/Mage.Tests/CommanderDuel_UW.dck b/Mage.Tests/CommanderDuel_UW.dck new file mode 100644 index 0000000000..795b083a07 --- /dev/null +++ b/Mage.Tests/CommanderDuel_UW.dck @@ -0,0 +1,70 @@ +NAME:Geoff's Daxos of Meletis +1 [THS:58] Ordeal of Thassa +1 [5ED:388] Mana Vault +1 [THS:14] Gift of Immortality +1 [PC2:12] Spirit Mantle +1 [M13:36] Sublime Archangel +1 [M13:206] Gilded Lotus +1 [M11:5] Armored Ascension +1 [ALA:27] Sigiled Paladin +1 [ALA:26] Sighted-Caste Sorcerer +1 [CON:2] Asha's Favor +1 [M14:210] Fireshrieker +1 [GTC:17] Holy Mantle +1 [CHK:65] Hinder +1 [DGM:96] Render Silent +1 [M13:74] Tricks of the Trade +1 [ISD:229] Mask of Avacyn +1 [GPT:28] Infiltrator's Magemark +14 [THS:234] Island +1 [CMD:261] Sol Ring +1 [THS:25] Ordeal of Heliod +1 [5DN:131] Helm of Kaldra +1 [M12:24] Lifelink +1 [AVR:50] Elgaud Shieldmate +19 [THS:230] Plains +1 [M14:23] Indestructibility +1 [M14:5] Archangel of Thune +1 [CMD:265] Azorius Chancery +1 [ARB:3] Ethercaste Knight +1 [ARB:1] Ardent Plea +1 [M13:18] Guardians of Akrasa +1 [CMD:40] Brainstorm +1 [UDS:139] Thran Dynamo +1 [M12:219] Swiftfoot Boots +1 [THS:39] Aqueous Form +1 [M13:6] Aven Squire +1 [MMA:25] Path to Exile +1 [M13:4] Angelic Benediction +1 [CMD:253] Lightning Greaves +1 [SHM:150] Steel of the Godhead +1 [M13:225] Glacial Fortress +1 [10E:40] Serra's Embrace +1 [JUD:31] Unquestioned Authority +1 [M13:221] Cathedral of War +1 [RTR:9] Ethereal Armor +1 [DDL:27] Battle Mastery +1 [DDL:24] Bonds of Faith +1 [ISD:53] Dissipate +1 [DKA:148] Executioner's Hood +1 [DIS:159] Azorius Signet +1 [GTC:37] Hands of Binding +1 [PC2:112] Quietus Spike +1 [MRD:144] Banshee's Blade +1 [AVR:36] Silverblade Paladin +1 [PC2:115] Whispersilk Cloak +1 [M12:73] Ponder +1 [M13:29] Rhox Faithmender +1 [ALA:1] Akrasan Squire +1 [M13:213] Ring of Thune +1 [UDS:46] Sigil of Sleep +1 [M13:211] Ring of Evos Isle +1 [RTR:241] Hallowed Fountain +1 [7ED:67] Counterspell +1 [ISD:49] Curiosity +1 [SOM:229] Seachrome Coast +1 [PC2:10] Mammoth Umbra +1 [MBS:104] Darksteel Plate +1 [M13:21] Knight of Glory +1 [M13:22] Oblivion Ring +SB: 1 [THS:191] Daxos of Meletis diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java index c31449aa0e..df244f549d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java @@ -42,12 +42,18 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl; public abstract class CardTestCommanderDuelBase extends CardTestPlayerAPIImpl { + public CardTestCommanderDuelBase() { + super(); + this.deckNameA = "CommanderDuel.dck"; + this.deckNameB = "CommanderDuel.dck"; + } + @Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { Game game = new CommanderDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 40); - playerA = createPlayer(game, playerA, "PlayerA","CommanderDuel.dck"); - playerB = createPlayer(game, playerB, "PlayerB","CommanderDuel.dck"); + playerA = createPlayer(game, playerA, "PlayerA",deckNameA); + playerB = createPlayer(game, playerB, "PlayerB",deckNameB); return game; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java index e3435c3d3f..5c92e59006 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java @@ -15,12 +15,17 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl; */ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { + public CardTestPlayerBase() { + deckNameA = "RB Aggro.dck"; + deckNameB = "RB Aggro.dck"; + } + @Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { Game game = new TwoPlayerDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 20); - playerA = createPlayer(game, playerA, "PlayerA"); - playerB = createPlayer(game, playerB, "PlayerB"); + playerA = createPlayer(game, playerA, "PlayerA", deckNameA); + playerB = createPlayer(game, playerB, "PlayerB", deckNameB); return game; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index dc059ca7cf..8b910600cb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -44,6 +44,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement protected GameOptions gameOptions; + protected String deckNameA; + protected String deckNameB; + protected enum ExpectedType { TURN_NUMBER, RESULT, @@ -1009,6 +1012,14 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement player.addTarget("targetPlayer="+targetPlayer.getName()); } + public void setDecknamePlayerA(String deckname) { + deckNameA = deckname; + } + + public void setDecknamePlayerB(String deckname) { + deckNameB = deckname; + } + protected void skipInitShuffling() { gameOptions.skipInitShuffling = true; }