コード例 #1
0
  @Test
  public void lifeCycle() {
    Game aGame = TestFixture.aGame();
    aGame.dealInitialCards();

    JsonPersistenceAssembler<Game> assembler = store.assembler();
    JsonPersistenceObject<Game> persistenceGame = assembler.toPersistence(aGame);
    store.create(persistenceGame);

    JsonPersistenceObject<Game> retrievedPGame =
        store.find((PersistenceObjectId<GameID>) persistenceGame.id());

    Game retrievedGame = assembler.toDomain(retrievedPGame);

    assertEquals(aGame.getID(), retrievedGame.getID());
  }
コード例 #2
0
 @Override
 public void create(PersistenceObject<Player> po) {
   JsonPersistenceObject<Player> mpg = (JsonPersistenceObject<Player>) po;
   jsonMap.put((StringPersistenceId<PlayerID>) mpg.id(), mpg.getJson());
 }