Package marauroa.common.game

Examples of marauroa.common.game.AccountResult.failed()


         
          /*
           * Create an account
           */
      AccountResult account = client.createAccount("testUsername", "password", "email");
      assertTrue("Account creation must not fail", !account.failed());

      assertEquals("testUsername", account.getUsername());
     
      /*
       * Create a character for that account.
View Full Code Here


            Thread.sleep(Math.abs(rand.nextInt() % 20) * 1000);

            client.connect("localhost", PORT);
            AccountResult resAcc = client.createAccount("testUsername" + i, "password","email");
            assertTrue("Account creation must not fail", !resAcc.failed());

            assertEquals("testUsername" + i, resAcc.getUsername());
            assertEquals(Result.OK_CREATED, resAcc.getResult());

            Thread.sleep(Math.abs(rand.nextInt() % 100) * 1000 + 5000);
View Full Code Here

            SimpleClient client = new SimpleClient("client.properties");

            client.connect("localhost", PORT);

            AccountResult resAcc = client.createAccount("testUsername" + i, "password", "email");
            assertTrue("Account creation must not fail", !resAcc.failed());
            assertEquals("testUsername" + i, resAcc.getUsername());

            Thread.sleep(Math.abs(new Random().nextInt() % 20) * 1000);

            client.login("testUsername" + i, "password");
View Full Code Here

      InvalidVersionException, BannedAddressException {
    client = new SimpleClient("log4j.properties");
    client.connect("localhost", PORT);
    AccountResult res = client.createAccount("testUsername", "password",
        "email");
    assertTrue("Account creation must not fail", !res.failed());

    assertEquals("testUsername", res.getUsername());

    /*
     * Doing a second time should fail
View Full Code Here

    /*
     * Doing a second time should fail
     */
    AccountResult result = client.createAccount("testUsername", "password",
        "email");
    assertTrue("Second account creation must fail", result.failed());
    client.close();
  }

  /**
   * Test the login process.
View Full Code Here

        }

        try {
          final AccountResult result = client.createAccount(
              accountUsername, password, email);
          if (result.failed()) {
            /*
             * If the account can't be created, show an error
             * message and don't continue.
             */
            progressBar.cancel();
 
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.