mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Test framework: added test fails on errors in AI's simulated games;
This commit is contained in:
parent
7dcdc12c0f
commit
e25d287864
1 changed files with 6 additions and 0 deletions
|
@ -446,8 +446,14 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
logger.info("simulating - timed out");
|
||||
task.cancel(true);
|
||||
} catch (ExecutionException e) {
|
||||
// exception error in simulated game
|
||||
e.printStackTrace();
|
||||
task.cancel(true);
|
||||
// real games: must catch
|
||||
// unit tests: must raise again for test fail
|
||||
if (this.isTestsMode()) {
|
||||
throw new IllegalStateException("One of the simulated games raise the error: " + e.getCause());
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
task.cancel(true);
|
||||
|
|
Loading…
Reference in a new issue