Package enterprise.web.tookit.account.test

Source Code of enterprise.web.tookit.account.test.UserTest

package enterprise.web.tookit.account.test;

import javax.naming.InitialContext;

import enterprise.web.tookit.user.User;
import enterprise.web.tookit.user.UserBeanRemote;

public class UserTest {

  public static void main(String[] args) {
    // usernameExistTest();

    // createUserRegis();

    recoverPassword();

  }

  public static void recoverPassword() {
    try {
      InitialContext context = new InitialContext();
      UserBeanRemote userBean = (UserBeanRemote) context.lookup("ejb/UserBean");

      userBean.recoverPassword("milena");
    } catch (Exception e) {
      e.printStackTrace();
    }

  }

  public static void createUserRegis() {
    try {
      InitialContext context = new InitialContext();
      UserBeanRemote userBean = (UserBeanRemote) context.lookup("ejb/UserBean");

      User user = new User();

      user.setUserName("Milena Test");
      user.setUserPassword("s2s2");

      userBean.createUser(user);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public static void usernameExistTest() {

    try {
      InitialContext context = new InitialContext();
      UserBeanRemote userBean = (UserBeanRemote) context.lookup("ejb/UserBean");

      //System.out.println(userBean.usernameExist("regisrocha"));

      /**
       *
       * QUNADO VERIFICAR LOGIN ADICIONAR ICON DE CHECK_OK
       *
       * DEPOIS CRIAR USER
       *
       * CRIAR DIV AGUARDE
       *
       *
       *
       */

    } catch (Exception e) {
      e.printStackTrace();
    }
  }

}
TOP

Related Classes of enterprise.web.tookit.account.test.UserTest

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.