Package org.magicbox.domain

Examples of org.magicbox.domain.Amministratore


    _reqMock = new MockHttpServletRequest("GET", "/responsabile.page");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, 46l);
    RecapitoTelefonico recapitotel = new RecapitoTelefonicoImpl("3391234567", "070123456",
        "", "");
    Amministratore admin = new AmministratoreImpl("pippo", "pippo", 46,
        0, false, "", "centrotest@avis.it", recapitotel);
    ModelAndView mav = _controller.onSubmit(_reqMock, _resMock, admin,
        new BindException(admin, Constant.ADMIN_CENTRO));
    assertEquals(Constant.REDIRECT_INFO_ADMIN_CENTRO, mav.getViewName());
View Full Code Here


    _reqMock = new MockHttpServletRequest("GET", "/responsabile.page");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, 46l);
    RecapitoTelefonico recapitoTel = new RecapitoTelefonicoImpl("3391234567", "070123456",
        "", "");
    Amministratore admin = new AmministratoreImpl("pippo", "pippo", 46,
        1, false, "", "centrotest@avis.it", recapitoTel);
    ModelAndView mav = _controller.onSubmit(_reqMock, _resMock, admin,
        new BindException(admin, Constant.ADMIN_CENTRO));
    assertEquals(Constant.REDIRECT_INFO_ADMIN_CENTRO, mav.getViewName());
View Full Code Here

   

    _reqMock = new MockHttpServletRequest("GET", "/amministratore.admin");
    _reqMock.addParameter(Constant.ID, "1");
    RecapitoTelefonico recapitotel = new RecapitoTelefonicoImpl("", "", "", "");
    Amministratore admin = new AmministratoreImpl("pippo", "pippo", 46,
        1, false, "", "centrotest@avis.it", recapitotel);

    ModelAndView mav = _controller.onSubmit(_reqMock, _resMock, admin,
        new BindException(admin, Constant.ADMIN));
    assertEquals(Constant.REDIRECT_ELENCO_AMMINISTRATORI, mav.getViewName());
View Full Code Here

        return AmministratoreImpl.class.isAssignableFrom(clazz);
    }

    public void validate(Object command, Errors errors) {

        Amministratore admin = (Amministratore) command;
        checkNominativo(admin, errors);
        checkPassword(admin, errors);
        checkCellulare(admin, errors);
        checkEmail(admin, errors);
        checkUsername(admin, errors);
View Full Code Here

    dbCentro.preparaDb();
    DBAdmin dbAdmin = new DBAdmin();
    dbAdmin.preparaDb();
   
   
    Amministratore admin = _manager.getAmministratore(1);
    assertEquals(admin.getCellulare(),"03394523123");
    assertEquals(admin.getUsername(),"pippo");
    assertEquals(admin.getEmail(),"centrotest@avis.it");
    assertEquals(admin.getNominativo(),"pippo");
    assertEquals(admin.getIdCentro(),new Long(46));
   
    dbAdmin.pulisciDb();
    dbCentro.pulisciDb()
    dbCredentials.pulisciDb();
    dbAdmin = null;
View Full Code Here

    Centro centro = new CentroImpl(
        "http://magic-box.wiki.sourceforge.net/", "070789123",
        "0709876543", "gooo46@yahoo.it",
        "Cagliari Due", indirizzo, centroLight);
    RecapitoTelefonico recapitotel = new RecapitoTelefonicoImpl("", "", "", "");
    Amministratore admin = new AmministratoreImpl("pippo", "pippo", 46,
        1, false, "", "centrotest@avis.it",recapitotel);
    Credenziali credenziali = new Credenziali();
    credenziali.setPassword("pippo");

    NuovoCentroView ncw = new NuovoCentroView(centro, "", admin,
View Full Code Here

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBAdmin dbAdmin = new DBAdmin();
    dbAdmin.preparaDb();
   
    Amministratore admin = _manager.getAmministratore(1);
   
    assertEquals(admin.getCellulare(),"03394523123");
    assertEquals(admin.getEmail(),"centrotest@avis.it");
    assertEquals(admin.getNominativo(),"pippo");
    //use impl only for test
    RecapitoTelefonicoImpl recapito = new RecapitoTelefonicoImpl();
    recapito.setCellulare("3391928375");
    AmministratoreLight adminLight = new AmministratoreLightImpl(admin.getUsername(),"bjorn",new Long(46),admin.getId());
    //use implement only for tests
    AmministratoreImpl adminInsert = new AmministratoreImpl();
    adminInsert.setRecapiti(recapito);
    adminInsert.setAmministratoreLight(adminLight);
    adminInsert.setSysadmin(false);
    adminInsert.setEmail("strounstrup@cpp.uk");
    adminInsert.setPassword("hola");
   
   
    assertTrue(_manager.saveAmministratore(adminInsert) == 1);
   
    Amministratore adminUpdate = _manager.getAmministratore(1);
   
    assertEquals(adminUpdate.getCellulare(),adminUpdate.getCellulare());
    assertEquals(adminUpdate.getEmail(),adminUpdate.getEmail());
    assertEquals(adminUpdate.getNominativo(),adminUpdate.getNominativo());
   
    dbAdmin.pulisciDb();
    dbCentro.pulisciDb();
    dbCredentials.pulisciDb();
    dbAdmin = null;
View Full Code Here

    DBCredentials dbCredentials = new DBCredentials();
    dbCredentials.preparaDb();
    DBAdmin dbAdmin = new DBAdmin();
    dbAdmin.preparaDb();
   
    Amministratore admin = _manager.getAmministratoreCentro(new Long(46));
    assertNotNull(admin);
    assertTrue(admin.getIdCentro() == 46);
   
    dbAdmin.pulisciDb();
    dbCredentials.pulisciDb();
    dbAmministratori.pulisciDb();
   
View Full Code Here

    DBCredentials dbCredentials = new DBCredentials();
    dbCredentials.preparaDb();
    DBAdmin dbAdmin = new DBAdmin();
    dbAdmin.preparaDb();
   
    Amministratore admin = _manager.getAmministratoreCentro(new Long(46));
    assertNotNull(admin);
    assertTrue(admin.getIdCentro() == 46);
    //use impl only for test
    RecapitoTelefonicoImpl recapito = new RecapitoTelefonicoImpl();
    recapito.setCellulare("3392233445");
    AmministratoreLight adminLight = new AmministratoreLightImpl(admin.getUsername(),"topo gigio",new Long(46),new Long(0));
    //use implement only for tests
    AmministratoreImpl adminUpdate = new AmministratoreImpl();
    adminUpdate.setRecapiti(recapito);
    adminUpdate.setAmministratoreLight(adminLight);
    adminUpdate.setSysadmin(false);
    adminUpdate.setEmail(admin.getEmail());

   
        _manager.updateAmministratoreCentro(adminUpdate);
   
    Amministratore adminRetrieve = _manager.getAmministratoreCentro(new Long(46));
    assertNotNull(adminRetrieve);
   
    // controllo che sia stato aggiornato correttamente in tutti i campi
    assertEquals(adminRetrieve.getIdCentro(), adminUpdate.getIdCentro());
    assertEquals(adminRetrieve.getEmail(), adminUpdate.getEmail());
    assertEquals(adminRetrieve.getNominativo(), adminUpdate.getNominativo());
    assertEquals(adminRetrieve.getCellulare(), adminUpdate.getCellulare());
   
    dbAdmin.pulisciDb();
    dbCredentials.pulisciDb();
    dbAmministratori.pulisciDb();
   
View Full Code Here

    DBCredentials dbCredentials = new DBCredentials();
    dbCredentials.preparaDb();
    DBAdmin dbAdmin = new DBAdmin();
    dbAdmin.preparaDb();
   
    Amministratore admin = _dao.getAmministratoreCentro(46);
    assertNotNull(admin);
    assertTrue(admin.getIdCentro() == 46);
   
    dbAdmin.pulisciDb();
    dbCredentials.pulisciDb();
    dbAmministratori.pulisciDb();
   
View Full Code Here

TOP

Related Classes of org.magicbox.domain.Amministratore

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.