Exemplo n.º 1
0
  public void testCreatePlayer() {
    Player player = new Player();
    player.setName("name");
    player.setType("type");
    player.setUsername("username");
    player.setIpAddress("ipaddress");
    player.setDynamicIp(false);
    player.setAutoControlEnabled(false);
    player.setTechnology(PlayerTechnology.EXTERNAL_WITH_PLAYLIST);
    player.setClientId("android");
    player.setLastSeen(new Date());
    player.setTranscodeScheme(TranscodeScheme.MAX_160);

    playerDao.createPlayer(player);
    Player newPlayer = playerDao.getAllPlayers().get(0);
    assertPlayerEquals(player, newPlayer);

    Player newPlayer2 = playerDao.getPlayerById(newPlayer.getId());
    assertPlayerEquals(player, newPlayer2);
  }
Exemplo n.º 2
0
  public void testUpdatePlayer() {
    Player player = new Player();
    playerDao.createPlayer(player);
    assertPlayerEquals(player, playerDao.getAllPlayers().get(0));

    player.setName("name");
    player.setType("Winamp");
    player.setTechnology(PlayerTechnology.WEB);
    player.setClientId("foo");
    player.setUsername("username");
    player.setIpAddress("ipaddress");
    player.setDynamicIp(true);
    player.setAutoControlEnabled(false);
    player.setLastSeen(new Date());
    player.setTranscodeScheme(TranscodeScheme.MAX_160);

    playerDao.updatePlayer(player);
    Player newPlayer = playerDao.getAllPlayers().get(0);
    assertPlayerEquals(player, newPlayer);
  }