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"));
//
}
}