mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Little improves for tests
This commit is contained in:
parent
e73a11cb12
commit
329f7fd609
5 changed files with 15 additions and 14 deletions
|
@ -1,5 +1,4 @@
|
|||
|
||||
package org.mage.test.cards.abilities.abilitywords;
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
|
@ -7,7 +6,6 @@ import org.junit.Test;
|
|||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ConvergeTest extends CardTestPlayerBase {
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
package org.mage.test.cards.abilities.abilitywords;
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
|
@ -7,7 +6,6 @@ import org.junit.Test;
|
|||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DomainTest extends CardTestPlayerBase {
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
package org.mage.test.cards.abilities.abilitywords;
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
|
@ -7,7 +6,6 @@ import org.junit.Test;
|
|||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class RevoltTest extends CardTestPlayerBase {
|
|
@ -51,7 +51,8 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implements CardTestAPI {
|
||||
|
||||
private static final boolean FAST_SCAN_WITHOUT_DATABASE_CREATE = false; // DEBUG only, enable it to fast startup tests without database create
|
||||
// DEBUG only, enable it to fast startup tests without database create (delete \db\ folder to force db recreate)
|
||||
private static final boolean FAST_SCAN_WITHOUT_DATABASE_CREATE = false;
|
||||
|
||||
public static final String ALIAS_PREFIX = "@"; // don't change -- it uses in user's tests
|
||||
public static final String CHECK_PARAM_DELIMETER = "#";
|
||||
|
@ -137,7 +138,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
public CardTestPlayerAPIImpl() {
|
||||
// load all cards to db from class list
|
||||
ArrayList<String> errorsList = new ArrayList<>();
|
||||
if (FAST_SCAN_WITHOUT_DATABASE_CREATE) {
|
||||
if (FAST_SCAN_WITHOUT_DATABASE_CREATE && CardRepository.instance.findCard("Mountain") != null) {
|
||||
CardScanner.scanned = true;
|
||||
}
|
||||
CardScanner.scan(errorsList);
|
||||
|
|
|
@ -223,14 +223,20 @@ public class ContinuousEffectsList<T extends ContinuousEffect> extends ArrayList
|
|||
effectAbilityMap.clear();
|
||||
}
|
||||
|
||||
public boolean contains(Effect effect) {
|
||||
@Override
|
||||
public boolean contains(Object object) {
|
||||
if (object == null || !(object instanceof ContinuousEffect)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// search by id
|
||||
ContinuousEffect need = (ContinuousEffect) object;
|
||||
for (Iterator<T> iterator = this.iterator(); iterator.hasNext(); ) {
|
||||
T test = iterator.next();
|
||||
if (effect.getId().equals(test.getId())) {
|
||||
if (need.equals(test)) {
|
||||
return true;
|
||||
}
|
||||
if (effect.equals(test)) {
|
||||
if (need.getId().equals(test.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue