assertTrue("Unexpected Error Message for English single-player failure", e.getLocalizedMessage().equals( "ERROR: Calculating hand results failed while Running individual player simulations<br>CAUSE: " + e.getCause() ) );
}
}
private void doGermanExecuteTests() {
proph = new CalcEngineProphesier();
Hashtable<String, Object> opts = new Hashtable<String, Object>();
//Multi-player simulation failure
try {
//Create an invalid # of simulations in the options
opts.put( CalcEngineFactory.ENGINE_PROPH_SIMS, 0 );
td.setOptions(opts);
//add 2 players to the game
td.clearPlayers();
p = new Player();
p.addCard( new Card(3,3) );
p.addCard( new Card(4,4) );
td.addPlayer( p );
p = new Player();
p.addCard( new Card(1,2) );
p.addCard( new Card(4,3) );
td.addPlayer( p );
//setup the table data so configuration will pass (execution will fail with dup card on the table)
Table t = new Table();
td.setGameTable( t );
proph.setOtherOptions( opts );
proph.setGameData(td);
proph.getCalculationResults();
} catch (TransportException e) {
fail( "An unexpeced error occured while setting up the German GetCalculationResults multi-player Test: " + e.getMessage() );
} catch (CalcEngineException e ) {
//Test overriden version of getLocalizedMessage()
assertTrue("Unexpected Error Message for German multi-player failure", e.getLocalizedMessage().equals( "FEHLER: Berechnung der Ergebnisse konnte nicht w�hrend Ausf�hren von Multi-Player-Simulationen<br>URSACHE: " + e.getCause() ) );
}
//Single-player simulation failure
try {
//Create a valid # of simulations in the options
opts.put( CalcEngineFactory.ENGINE_PROPH_SIMS, 10000 );
td.setOptions(opts);
//add only 1 player to the game - will cause single player failure
td.clearPlayers();
p = new Player();
p.addCard( new Card(3,3) );
p.addCard( new Card(4,4) );
td.addPlayer( p );
p = new Player();
proph = new CalcEngineProphesier();
proph.setOtherOptions( opts );
proph.setGameData(td);
proph.getCalculationResults();