mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
minor changes in test logging level
This commit is contained in:
parent
cd7e10e186
commit
3fb7dc2993
3 changed files with 15 additions and 17 deletions
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue