*/
@Test
public void storeAndLoadCharacter() throws SQLException, IOException {
String username = "testUserCA";
String character = "testCharacterCA";
RPObject player = new RPObject();
player.put("one", "number one");
player.put("two", 2);
player.put("three", 3.0);
DBTransaction transaction = transactionPool.beginWork();
try {
assertFalse(accountDAO.hasPlayer(transaction, username));
accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
assertFalse(characterDAO.hasCharacter(transaction, username, character));
characterDAO.addCharacter(transaction, username, character, player);
RPObject loaded = characterDAO.loadCharacter(transaction, username, character);
assertEquals(player, loaded);
} finally {
transactionPool.rollback(transaction);
}
}