public void testDefaultValues() {
    playerDao.createPlayer(new Player());
    Player player = playerDao.getAllPlayers().get(0);

    assertTrue("Player should have dynamic IP by default.", player.isDynamicIp());
    assertTrue("Player should be auto-controlled by default.", player.isAutoControlEnabled());
    assertNull("Player client ID should be null by default.", player.getClientId());
  }
Exemplo n.º 2
0
 private void assertPlayerEquals(Player expected, Player actual) {
   assertEquals("Wrong ID.", expected.getId(), actual.getId());
   assertEquals("Wrong name.", expected.getName(), actual.getName());
   assertEquals("Wrong technology.", expected.getTechnology(), actual.getTechnology());
   assertEquals("Wrong client ID.", expected.getClientId(), actual.getClientId());
   assertEquals("Wrong type.", expected.getType(), actual.getType());
   assertEquals("Wrong username.", expected.getUsername(), actual.getUsername());
   assertEquals("Wrong IP address.", expected.getIpAddress(), actual.getIpAddress());
   assertEquals("Wrong dynamic IP.", expected.isDynamicIp(), actual.isDynamicIp());
   assertEquals(
       "Wrong auto control enabled.",
       expected.isAutoControlEnabled(),
       actual.isAutoControlEnabled());
   assertEquals("Wrong last seen.", expected.getLastSeen(), actual.getLastSeen());
   assertEquals(
       "Wrong transcode scheme.", expected.getTranscodeScheme(), actual.getTranscodeScheme());
 }