Package marauroa.server.db

Examples of marauroa.server.db.DBTransaction


   */
  @Test
  public void setStatus() throws SQLException {
    String username = "testUser";

    DBTransaction transaction = transactionPool.beginWork();

    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      assertEquals("active", accountDAO.getAccountStatus(transaction, username));
      accountDAO.setAccountStatus(transaction, username, "banned");
View Full Code Here


   */
  @Test
  public void blockAccountPlayer() throws SQLException, UnknownHostException {
    String username = "testUser";

    DBTransaction transaction = transactionPool.beginWork();
    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      assertTrue(accountDAO.hasPlayer(transaction, username));

      InetAddress address = InetAddress.getLocalHost();
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void storeAndLoadObjects() throws Exception {
    DBTransaction transaction = transactionPool.beginWork();

    try {
      rpzoneDAO.storeRPZone(transaction, zone);

      MarauroaRPZone newzone = new MarauroaRPZone("test");
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void storeAndStoreAndLoadObjects() throws Exception {
    DBTransaction transaction = transactionPool.beginWork();

    try {
      rpzoneDAO.storeRPZone(transaction, zone);

      MarauroaRPZone newzone = new MarauroaRPZone("test");
View Full Code Here

  public void addCharacter() throws SQLException, IOException {
    String username = "testUserCA";
    String character = "testCharacterCA";
    RPObject player = new RPObject();

    DBTransaction transaction = transactionPool.beginWork();
    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      assertTrue(accountDAO.hasPlayer(transaction, username));
      characterDAO.addCharacter(transaction, username, character, player);
      assertTrue(characterDAO.hasCharacter(transaction, username, character));
View Full Code Here

  public void doubleAddedCharacter() throws SQLException, IOException {
    String username = "testUserCA";
    String character = "testCharacterCA";
    RPObject player = new RPObject();

    DBTransaction transaction = transactionPool.beginWork();
    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      assertTrue(accountDAO.hasPlayer(transaction, username));
      characterDAO.addCharacter(transaction, username, character, player);
      assertTrue(characterDAO.hasCharacter(transaction, username, character));
View Full Code Here

  public void removeCharacter() throws SQLException, IOException {
    String username = "testUserCA";
    String character = "testCharacterCA";
    RPObject player = new RPObject();

    DBTransaction transaction = transactionPool.beginWork();
    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      assertTrue(accountDAO.hasPlayer(transaction, username));
      characterDAO.addCharacter(transaction, username, character, player);
      assertTrue(characterDAO.hasCharacter(transaction, username, character));
View Full Code Here

  public void removePlayerCharacter() throws SQLException, IOException {
    String username = "testUserCA";
    String character = "testCharacterCA";
    RPObject player = new RPObject();

    DBTransaction transaction = transactionPool.beginWork();
    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      assertTrue(accountDAO.hasPlayer(transaction, username));
      characterDAO.addCharacter(transaction, username, character, player);
      assertTrue(characterDAO.hasCharacter(transaction, username, character));
View Full Code Here

  @Test
  public void getCharacters() throws SQLException, IOException {
    String username = "testUserCA";
    String[] characters = { "testCharacterCA1", "testCharacterCA2", "testCharacterCA3" };

    DBTransaction transaction = transactionPool.beginWork();
    try {
      accountDAO.addPlayer(transaction, username, Hash.hash("testPassword"), "email@email.com");
      for (String character : characters) {
        characterDAO.addCharacter(transaction, username, character, new RPObject());
      }
View Full Code Here

    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));
View Full Code Here

TOP

Related Classes of marauroa.server.db.DBTransaction

Copyright © 2018 www.massapicom. 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.