This commit is contained in:
jeffwadsworth 2021-08-27 15:17:42 -05:00
commit b6acaed99d
7 changed files with 105 additions and 11 deletions

1
.gitignore vendored
View file

@ -15,6 +15,7 @@ Mage.Client/target
Mage.Common/target
# Mage.Plugins
Mage.Plugins/target
Mage.Plugins/Mage.Card.Plugin/target
Mage.Plugins/Mage.Counter.Plugin/target
Mage.Plugins/Mage.Theme.Plugin/target

View file

@ -110,7 +110,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
<version>1.14.2</version>
</dependency>
<dependency>
<artifactId>truevfs-profile-base</artifactId>

View file

@ -81,9 +81,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View file

@ -0,0 +1,47 @@
package org.mage.test.cards.single.stx;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseWithAIHelps;
/**
* @author JayDi85
*/
public class DaemogothTitanTest extends CardTestPlayerBaseWithAIHelps {
@Test
public void test_Attack_Manual() {
// Whenever Daemogoth Titan attacks or blocks, sacrifice a creature.
addCard(Zone.BATTLEFIELD, playerA, "Daemogoth Titan"); // 11/10
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
attack(1, playerA, "Daemogoth Titan");
addTarget(playerA, "Grizzly Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertLife(playerB, 20 - 11);
assertGraveyardCount(playerA, "Grizzly Bears", 1);
}
@Test
public void test_Attack_AI() {
// Whenever Daemogoth Titan attacks or blocks, sacrifice a creature.
addCard(Zone.BATTLEFIELD, playerA, "Daemogoth Titan"); // 11/10
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
aiPlayStep(1, PhaseStep.DECLARE_ATTACKERS, playerA);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertLife(playerB, 20 - 11);
assertGraveyardCount(playerA, "Grizzly Bears", 1);
}
}

View file

@ -1683,8 +1683,8 @@ public class TestPlayer implements Player {
mustAttackByAction = true;
madeAttackByAction = true;
this.computerPlayer.selectAttackers(game, attackingPlayerId);
it.remove();
break;
// play step action will be removed on step end
continue;
}
if (action.getTurnNum() == game.getTurnNum() && action.getAction().startsWith("attack:")) {
@ -1774,8 +1774,8 @@ public class TestPlayer implements Player {
if (action.getTurnNum() == game.getTurnNum() && action.getAction().equals(AI_PREFIX + AI_COMMAND_PLAY_STEP)) {
mustBlockByAction = true;
this.computerPlayer.selectBlockers(source, game, defendingPlayerId);
actions.remove(action);
break;
// play step action will be removed on step end
continue;
}
if (action.getTurnNum() == game.getTurnNum() && action.getAction().startsWith("block:")) {

View file

@ -64,9 +64,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

52
pom.xml
View file

@ -51,16 +51,52 @@
</archive>
</configuration>
</plugin>
<!-- JaCoCo Code Coverage report generation -->
<!-- Examples: http://tdongsi.github.io/blog/2017/09/23/jacoco-in-maven-project/ -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<!-- prepare command line to inject in java agent (collect code executing stats) -->
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<!-- generate current module's report -->
<id>generate-code-coverage-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<!-- generate combined report (current and dependency modules) -->
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<!--
for compatible with jacoco code coverage - argLine moved to properties section
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
-->
</plugin>
</plugins>
</pluginManagement>
@ -99,8 +135,24 @@
<properties>
<mage-version>1.4.49</mage-version>
<argLine>-Dfile.encoding=UTF-8</argLine>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
<!--
JaCoCo code coverage disabled by default. If you need to generate
execute stats and reports then run tests by maven command
like "mvn install -Djacoco.skip=false".
Stats:
- load coverage data for IntelliJ IDEA from ./target/jacoco.exec
- web report in ./target/site/jacoco/index.html
- for sonar support see below
-->
<jacoco.skip>true</jacoco.skip>
<!-- Sonar settings for code coverage. Must be only one report for all modules (use report-aggregate goal report from JaCoCo) -->
<aggregate.report.dir>Mage.Verify/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<dependencyManagement>