Package test.org.magicbox.dbunit

Examples of test.org.magicbox.dbunit.DBCredentials


    dbCredentials = null;
  }
 
  public void testUpdateCredentials() {
    // inserisco max e pippo sul db
    DBCredentials dbCredentials = new DBCredentials();
    dbCredentials.preparaDb();
   
    Credenziali credenziali = _dao.getUser("pippo", Cripto.stringToSHA("pippo"));

    assertEquals(credenziali.getUsername(),"pippo");
    assertNull(credenziali.getPassword());
   
    Credenziali update = new Credenziali();
    update.setUsername("pippo");
    update.setPassword("pluto");
    update.setOldPassword(Cripto.stringToSHA("pippo"));
    update.setConfermaPassword(Cripto.stringToSHA("pluto"));
    _dao.updateCredentials(update);

    Credenziali retrieve = _dao.getUser("pippo", Cripto.stringToSHA("pluto"));
   
    assertEquals(credenziali.getUsername(),retrieve.getUsername());
    assertNull(retrieve.getPassword());
   
    dbCredentials.pulisciDb();
    dbCredentials = null;
  }
View Full Code Here


  }
 
 
  public void testGetAdminByUserName() {
    // inserisco max e pippo sul db
    DBCredentials dbCredentials = new DBCredentials();
    dbCredentials.preparaDb();
   
    Credenziali credenziali = _dao.getAdminByUsername("pippo");

    assertEquals(credenziali.getUsername(),"pippo");
    assertNull(credenziali.getPassword());

    dbCredentials.pulisciDb();
    dbCredentials = null;
  }
View Full Code Here

TOP

Related Classes of test.org.magicbox.dbunit.DBCredentials

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.