Examples of DBUtenti


Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testCap() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();
    _reqMock = new MockHttpServletRequest("GET", "/ricerche.page?action=cap");
    _reqMock.addRole(Constant.ROLE_USER)
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.CAP, "09100");
   
    ModelAndView mav = _controller.cap(_reqMock, _resMock);
    assertEquals("donors/elencoRicercaDonatori", mav.getViewName());

    List donors = (List) mav.getModel().get(Constant.ELENCO_DONATORI);
    assertEquals(donors.size(), 11);
    Page pageVO = (Page) mav.getModel().get(Constant.PAGE_VO);
    assertEquals(pageVO.getNumeroMaxPagine(), 1);
    assertEquals(pageVO.getPagina(), 0);
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testCitta() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();
    _reqMock = new MockHttpServletRequest("GET", "/ricerche.page?action=citta");
    _reqMock.addRole(Constant.ROLE_USER)
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.CITTA, "cagliari");
   
    ModelAndView mav = _controller.citta(_reqMock, _resMock);
    assertEquals("donors/elencoRicercaDonatori", mav.getViewName());

    List donors = (List) mav.getModel().get(Constant.ELENCO_DONATORI);
    assertEquals(donors.size(), 10);
    Page pageVO = (Page) mav.getModel().get(Constant.PAGE_VO);
    assertEquals(pageVO.getNumeroMaxPagine(), 1);
    assertEquals(pageVO.getPagina(), 0);
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testProvincia() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();
    _reqMock = new MockHttpServletRequest("GET", "/ricerche.page?action=provincia");
    _reqMock.addRole(Constant.ROLE_USER)
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.PROVINCIA, "CA");
   
    ModelAndView mav = _controller.provincia(_reqMock, _resMock);
    assertEquals("donors/elencoRicercaDonatori", mav.getViewName());

    List donors = (List) mav.getModel().get(Constant.ELENCO_DONATORI);
    assertEquals(donors.size(), 11);
    Page pageVO = (Page) mav.getModel().get(Constant.PAGE_VO);
    assertEquals(pageVO.getNumeroMaxPagine(), 1);
    assertEquals(pageVO.getPagina(), 0);
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testAlfabetico() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();
    _reqMock = new MockHttpServletRequest("GET", "/ricerche.page?action=alfabetico");
    _reqMock.addRole(Constant.ROLE_USER)
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.CHAR, "b");
   
    ModelAndView mav = _controller.alfabetico(_reqMock, _resMock);
    assertEquals("donors/elencoRicercaDonatori", mav.getViewName());

    List donors = (List) mav.getModel().get(Constant.ELENCO_DONATORI);
    assertEquals(donors.size(), 15);
    Page pageVO = (Page) mav.getModel().get(Constant.PAGE_VO);
    assertEquals(pageVO.getNumeroMaxPagine(), 1);
    assertEquals(pageVO.getPagina(), 0);
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here

Examples of test.org.magicbox.dbunit.DBUtenti

  public void testInsertUtente() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();

    _reqMock = new MockHttpServletRequest("GET", "/donatore.page");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, 46l);
    RecapitoTelefonico recapitoTel = new RecapitoTelefonicoImpl( "3391234567", "070123456", "", "");
    Indirizzo indirizzo = new IndirizzoImpl( "09100", "Cagliari", "CA",
        "Via casasua 1");
    UtenteLight utenteLight = new UtenteLightImpl("101","pippo",0,2);
    Utente utente = new UtenteImpl(utenteLight,46, "pippo@yahoo.it", true, indirizzo, recapitoTel);
    ModelAndView mav = _controller.onSubmit(_reqMock, _resMock, utente,
        new BindException(utente, Constant.DONOR));
    assertEquals(Constant.REDIRECT_ELENCO_DONORS, mav.getViewName());

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

Examples of test.org.magicbox.dbunit.DBUtenti

  public void testUpdateUtente() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();

    _reqMock = new MockHttpServletRequest("GET", "/donatore.page");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, 46l);
    RecapitoTelefonico recapitoTel = new RecapitoTelefonicoImpl( "3391234567", "070123456", "", "");
    Indirizzo indirizzo = new IndirizzoImpl( "09100", "Cagliari", "CA",
        "Via casasua 1");
    UtenteLight utenteLight = new UtenteLightImpl("","pippo",0,6667);
    Utente utente = new UtenteImpl(utenteLight,46, "pippo@yahoo.it", true, indirizzo, recapitoTel);

    ModelAndView mav = _controller.onSubmit(_reqMock, _resMock, utente,
        new BindException(utente, Constant.DONOR));
    assertEquals(Constant.REDIRECT_ELENCO_DONORS, mav.getViewName());

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

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testElenco() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();

    _reqMock = new MockHttpServletRequest("GET", "/donatori.page?action=elenco");
    _reqMock.addRole(Constant.ROLE_USER)
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
   
        ModelAndView mav = _controller.elenco(_reqMock, _resMock);
    assertEquals("donors/elencoDonatori", mav.getViewName());
    List donatori = (List) mav.getModel().get(Constant.ELENCO_DONATORI);
    Page page = (Page)mav.getModel().get(Constant.PAGE_VO);
    assertEquals(15,donatori.size() );
    assertEquals(1,page.getNumeroMaxPagine());
    assertEquals(0,page.getPagina());

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

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testConferma() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();

    _reqMock = new MockHttpServletRequest("GET", "/donatori.page?action=conferma");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.ID, "1");
   
    ModelAndView mav = _controller.conferma(_reqMock, _resMock);
    assertEquals("donors/confermaEliminazioneDonatore", mav.getViewName());
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testElimina() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();

    _reqMock = new MockHttpServletRequest("GET", "/donatori.page?action=elimina");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.ID, "1");
   
    ModelAndView mav = _controller.elimina(_reqMock, _resMock);
    assertEquals(Constant.FORWARD_ELENCO_DONORS, mav.getViewName());
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here

Examples of test.org.magicbox.dbunit.DBUtenti

 
  public void testDettaglio() throws Exception {

    DBCentro dbCentro = new DBCentro();
    dbCentro.preparaDb();
    DBUtenti dbUtenti = new DBUtenti();
    dbUtenti.preparaDb();

    _reqMock = new MockHttpServletRequest("GET", "/donatori.page?action=dettaglio");
    _reqMock.getSession().setAttribute(Constant.ID_CENTRO_SESSIONE, new Long(46));
    _reqMock.setParameter(Constant.ID, "1");
   
    ModelAndView mav = _controller.dettaglio(_reqMock, _resMock);
    assertEquals("donors/dettaglioDonatore", mav.getViewName());
    Utente donor = (Utente)mav.getModel().get(Constant.DONOR);
    assertNull(donor);
   
    dbUtenti.pulisciDb();
    dbCentro.pulisciDb();
    dbUtenti = null;
    dbCentro = null;
  }
View Full Code Here
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.