Package test

Source Code of test.TestUserBackend

package test;

import org.orm.PersistentException;

import api.ContextObjectAuth;

public class TestUserBackend {

  /**
   * @param args
   * @throws PersistentException
   */
  public static void main(String[] args) throws PersistentException {
    // TODO Auto-generated method stub
    ContextObjectAuth oCliente = ContextObjectAuth.getContextAuth();
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().addUser("victor", "123456"));
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().addUser("perico", "123"));
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().addUser("anca", "123"));
    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().addUser("rayen", "1234"));
    String tvictor = oCliente.getoAuthUserBackend().authBackend("rayen", "1234");
    System.out.println("AddUSer " +tvictor);
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().authBackend("perico", "123"));
    System.out.println("Sleep 4");
    try {
      Thread.sleep (4000);
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if(oCliente.getoAuthUserBackend().validateToken(tvictor)==true){
      System.out.println("TokenValido B");
    }
    else {
      System.out.println("TokenNoValido");
    }
    System.out.println("Sleep 4");
   
    //System.out.println("AddUSer " +oCliente.getoAuthUserBackend().authBackend("victor", "123456"));
    //System.out.println("AddUSer " +oCliente.getoAuthUserBackend().authBackend("perico", "123"));
   
    System.out.println("Sleep 30");
    try {
      Thread.sleep (30000);
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    System.out.println("Fin Sleep 6");
    if(oCliente.getoAuthUserBackend().validateToken(tvictor)==true){
      System.out.println("TokenValido");
    }
    else {
      System.out.println("TokenNoValido B");
    }
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().authBackend("victor", "123456"));
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().authBackend("perico", "123"));
//    System.out.println("AddUSer " +oCliente.getoAuthUserBackend().authBackend("anca", "123"));
//   
  }

}
TOP

Related Classes of test.TestUserBackend

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.