From 3fb7dc299338b7365c22df6f4956256f172c6a4e Mon Sep 17 00:00:00 2001 From: magenoxx Date: Tue, 15 May 2012 11:54:47 +0400 Subject: [PATCH] minor changes in test logging level --- .../test/cards/single/BurntheImpureTest.java | 2 +- .../serverside/base/CardTestPlayerBase.java | 19 ++++++++++--------- .../serverside/base/MageTestPlayerBase.java | 11 ++++------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java index 45007a9ae8..2d8f004243 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/BurntheImpureTest.java @@ -12,6 +12,7 @@ import org.mage.test.serverside.base.CardTestBase; * * @ayratn */ +@Ignore public class BurntheImpureTest extends CardTestBase { /** @@ -25,7 +26,6 @@ public class BurntheImpureTest extends CardTestBase { * @throws Exception */ @Test - @Ignore public void testVersusInfectCreature() throws Exception { // $include red.default useRedDefault(); 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 f80c659704..01c7b9d356 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 @@ -1,7 +1,5 @@ package org.mage.test.serverside.base; -import java.io.File; -import java.io.FileNotFoundException; import mage.Constants; import mage.Constants.PhaseStep; import mage.cards.Card; @@ -19,6 +17,9 @@ import org.junit.Before; import org.mage.test.player.TestPlayer; import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl; +import java.io.File; +import java.io.FileNotFoundException; + /** * Base class for testing single cards and effects. * @@ -47,7 +48,7 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { @Before public void reset() throws GameException, FileNotFoundException { if (currentGame != null) { - logger.info("Resetting previous game and creating new one!"); + logger.debug("Resetting previous game and creating new one!"); currentGame = null; System.gc(); } @@ -56,9 +57,9 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { playerA = createNewPlayer("PlayerA"); playerA.setTestMode(true); - logger.info("Loading deck..."); + logger.debug("Loading deck..."); Deck deck = Deck.load(DeckImporterUtil.importDeck("RB Aggro.dck")); - logger.info("Done!"); + logger.debug("Done!"); if (deck.getCards().size() < 40) { throw new IllegalArgumentException("Couldn't load deck, deck size=" + deck.getCards().size()); } @@ -103,7 +104,7 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { } if (currentGame != null) { - logger.info("Resetting previous game and creating new one!"); + logger.debug("Resetting previous game and creating new one!"); currentGame = null; System.gc(); } @@ -159,8 +160,8 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { gameOptions.stopAtStep = stopAtStep; currentGame.start(activePlayer.getId(), gameOptions); long t2 = System.nanoTime(); - logger.info("Winner: " + currentGame.getWinner()); - logger.info("Time: " + (t2 - t1) / 1000000 + " ms"); + logger.debug("Winner: " + currentGame.getWinner()); + logger.info("Test has been executed. Execution time: " + (t2 - t1) / 1000000 + " ms"); assertTheResults(); } @@ -169,7 +170,7 @@ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { * Assert expected and actual results. */ private void assertTheResults() { - logger.info("Matching expected results:"); + logger.debug("Matching expected results:"); for (String line : expectedResults) { boolean ok = false; try { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java index d4d299a7fa..a22f48abdf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java @@ -1,16 +1,14 @@ package org.mage.test.serverside.base; import mage.Constants; +import mage.Constants.PhaseStep; import mage.cards.Card; import mage.game.Game; import mage.game.match.MatchType; import mage.game.permanent.PermanentCard; import mage.game.tournament.TournamentType; import mage.players.Player; -import mage.server.game.DeckValidatorFactory; import mage.server.game.GameFactory; -import mage.server.game.PlayerFactory; -import mage.server.tournament.TournamentFactory; import mage.server.util.ConfigSettings; import mage.server.util.PluginClassLoader; import mage.server.util.config.GamePlugin; @@ -20,6 +18,7 @@ import mage.util.Copier; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.junit.BeforeClass; +import org.mage.test.player.TestPlayer; import java.io.File; import java.io.FileNotFoundException; @@ -27,8 +26,6 @@ import java.io.FilenameFilter; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import mage.Constants.PhaseStep; -import org.mage.test.player.TestPlayer; /** * Base class for all tests. @@ -101,8 +98,8 @@ public abstract class MageTestPlayerBase { @BeforeClass public static void init() { Logger.getRootLogger().setLevel(Level.DEBUG); - logger.info("Starting MAGE tests"); - logger.info("Logging level: " + logger.getLevel()); + logger.debug("Starting MAGE tests"); + logger.debug("Logging level: " + logger.getLevel()); deleteSavedGames(); ConfigSettings config = ConfigSettings.getInstance(); for (GamePlugin plugin : config.getGameTypes()) {