Package games.stendhal.server.entity.player

Examples of games.stendhal.server.entity.player.Player.events()


      assertEquals("active", accountDAO.getAccountStatus(transaction, player.getName()));
      assertEquals("active", accountDAO.getAccountStatus(transaction, admin.getName()));
      assertFalse(admin.events().isEmpty());
      assertThat(admin.events().get(0).toString(), containsString("RPEvent private_text with Attributes of Class(private_text): "));
      // not sure of a good way to reliably test the timestamping
      assertThat(admin.events().get(0).toString(), containsString("[text=You have banned account bobby (character: bobby) until "));
      assertThat(admin.events().get(0).toString(), containsString("for: We want to test the temporary bans"));
      assertThat(admin.events().get(0).toString(), containsString("[texttype=PRIVMSG]"));
 
      // just undo the changes so the next test starts clean
      TransactionPool.get().rollback(transaction);
View Full Code Here


      assertEquals("active", accountDAO.getAccountStatus(transaction, admin.getName()));
      assertFalse(admin.events().isEmpty());
      assertThat(admin.events().get(0).toString(), containsString("RPEvent private_text with Attributes of Class(private_text): "));
      // not sure of a good way to reliably test the timestamping
      assertThat(admin.events().get(0).toString(), containsString("[text=You have banned account bobby (character: bobby) until "));
      assertThat(admin.events().get(0).toString(), containsString("for: We want to test the temporary bans"));
      assertThat(admin.events().get(0).toString(), containsString("[texttype=PRIVMSG]"));
 
      // just undo the changes so the next test starts clean
      TransactionPool.get().rollback(transaction);
    } catch (Throwable e) {
View Full Code Here

      assertFalse(admin.events().isEmpty());
      assertThat(admin.events().get(0).toString(), containsString("RPEvent private_text with Attributes of Class(private_text): "));
      // not sure of a good way to reliably test the timestamping
      assertThat(admin.events().get(0).toString(), containsString("[text=You have banned account bobby (character: bobby) until "));
      assertThat(admin.events().get(0).toString(), containsString("for: We want to test the temporary bans"));
      assertThat(admin.events().get(0).toString(), containsString("[texttype=PRIVMSG]"));
 
      // just undo the changes so the next test starts clean
      TransactionPool.get().rollback(transaction);
    } catch (Throwable e) {
      TransactionPool.get().rollback(transaction);
View Full Code Here

  @Test
  public void testExecute() throws Exception {
    Player bob = PlayerTestHelper.createPlayer("bob");
    InfoAction info = new InfoAction();
    info.onAction(bob, null);
    assertFalse(bob.events().isEmpty());
    //assertEquals(null,bob.events().get(0));
   
  }
}
View Full Code Here

    final Player player = PlayerTestHelper.createPlayer("bob");
    final RPAction action = new RPAction();
    action.put("type", "wrap");
    action.put("args", "");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any null"));
    player.clearEvents();

    action.put("args", "blabla");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any null blabla"));
View Full Code Here

    assertThat(player.events().get(0).get("text"), is("You don't have any null"));
    player.clearEvents();

    action.put("args", "blabla");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any null blabla"));

    player.clearEvents();

    action.put("target", "what");
    action.put("args", "blabla");
View Full Code Here

    player.clearEvents();

    action.put("target", "what");
    action.put("args", "blabla");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any what blabla"));
  }

  /**
   * Tests for onActionPotion.
   */
 
View Full Code Here

    rpAction.put("target", "");
    rpAction.put("mode", "");
    rpAction.put("stat", "");
    rpAction.put("value", "");
    Player player = PlayerTestHelper.createPlayer("bob");
    assertTrue(player.events().isEmpty());
    action.perform(player, rpAction);
    assertFalse(player.events().isEmpty());
    assertEquals("Entity not found", player.events().get(0).get("text"));
  }
View Full Code Here

    rpAction.put("stat", "");
    rpAction.put("value", "");
    Player player = PlayerTestHelper.createPlayer("bob");
    assertTrue(player.events().isEmpty());
    action.perform(player, rpAction);
    assertFalse(player.events().isEmpty());
    assertEquals("Entity not found", player.events().get(0).get("text"));
  }

  /**
   * Tests for unknownAttribute.
View Full Code Here

    rpAction.put("value", "");
    Player player = PlayerTestHelper.createPlayer("bob");
    assertTrue(player.events().isEmpty());
    action.perform(player, rpAction);
    assertFalse(player.events().isEmpty());
    assertEquals("Entity not found", player.events().get(0).get("text"));
  }

  /**
   * Tests for unknownAttribute.
   */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.