Examples of UtenteImpl


Examples of org.magicbox.domain.UtenteImpl

  public void setUp() throws Exception {}
 
  public void tearDown() throws Exception {}
 
  public void testCostruttoreVuoto() {
    Utente utente = new UtenteImpl();
    assertTrue(utente.getId() == -1);
    assertTrue(-1 == utente.getIdGruppo());
    assertTrue(-1 == utente.getCentro());
    assertNull(utente.getNominativo());
    assertNull(utente.getTessera());
    assertNull(utente.getCap());
    assertNull(utente.getCellulare());
    assertNull(utente.getCitta());
    assertNull(utente.getCorris());
    assertNull(utente.getEmail());
    assertNull(utente.getIndirizzo());
    assertNull(utente.getNominativo());
    assertNull(utente.getProvincia());
    assertNotNull(utente.getRecapiti());
    assertNull(utente.getTelefonoCasa());
    assertNull(utente.getTelefonoDomicilio());
    assertNull(utente.getTelefonoLavoro());
    assertNull(utente.getTessera());
  }
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

   
    RecapitoTelefonico recapitoTel = new RecapitoTelefonicoImpl( "3391234567", "070123456", "", "");
    Indirizzo indirizzo = new IndirizzoImpl( "09100", "Cagliari", "CA",
        "Via casasua 1");
    UtenteLight utenteLight = new UtenteLightImpl("101","paolino paperino",0,2);
    Utente utente = new UtenteImpl(utenteLight,46, "pippo@yahoo.it", true, indirizzo, recapitoTel);   
    assertTrue(utente.getId()== 0);
    assertTrue(2 == utente.getIdGruppo());
    assertTrue(46 == utente.getCentro());
    assertEquals("paolino paperino",utente.getNominativo());
    assertEquals("101",utente.getTessera());
    assertEquals("09100",utente.getCap());
    assertEquals("3391234567",utente.getCellulare());
    assertEquals("Cagliari",utente.getCitta());
    assertTrue(utente.getCorris());
    assertEquals("pippo@yahoo.it",utente.getEmail());
    assertEquals("Via casasua 1",utente.getIndirizzo());
    assertEquals("paolino paperino",utente.getNominativo());
    assertEquals("CA",utente.getProvincia());
    assertNotNull(utente.getRecapiti());
    assertEquals("070123456",utente.getTelefonoDomicilio());
    assertEquals("",utente.getTelefonoCasa());
    assertEquals("",utente.getTelefonoLavoro());
  }
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    _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();
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    _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());
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    _validator = (UtenteValidator) _ctx.getBean("magicbox.admin.utenteValidator");
  }
 
  public void testAllEmpty() {

    Utente  utente = new UtenteImpl();
    Errors errors = new BindException(utente, "command");

    _validator.validate(utente, errors);
    assertTrue(errors.hasErrors());
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    assertTrue(errors.getErrorCount() == 1);
  }
 
  public void testMandatoryCorrect() {

    UtenteImpl  utente = new UtenteImpl();
    utente.setNominativo("Paolino paperino");
    Errors errors = new BindException(utente, "command");

    _validator.validate(utente, errors);
    assertTrue(!errors.hasErrors());
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    assertTrue(errors.getErrorCount() == 0);
  }
 
  public void testAllPossibleWrong() {

    UtenteImpl  utente = new UtenteImpl();
    utente.setNominativo("P");
    utente.setCap("abc");
    utente.setCellulare("abcdd");
    utente.setCitta("Mi2");
    utente.setEmail("sdsfsf");
    utente.setIndirizzo("12");
    utente.setProvincia("1");
    utente.setTelefonoCasa("adfdsf");
    utente.setTelefonoDomicilio("iuhgifd");
    utente.setTelefonoLavoro("nxc9em");
    Errors errors = new BindException(utente, "command");

    _validator.validate(utente, errors);
    assertTrue(errors.hasErrors());
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    assertTrue(errors.getErrorCount() == 15);
  }
 
  public void testNominativoWrong() {

    UtenteImpl  utente = new UtenteImpl();
    utente.setNominativo("P");
   
    Errors errors = new BindException(utente, "command");

    _validator.validate(utente, errors);
    assertTrue(errors.hasErrors());
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    assertTrue(errors.getErrorCount() == 1);
  }
 
  public void testCapWrong() {

    UtenteImpl  utente = new UtenteImpl();
    utente.setNominativo("Pippo");
    // non numerico e minore della lunghezza minima
    utente.setCap("av");
   
    Errors errors = new BindException(utente, "command");

    _validator.validate(utente, errors);
    assertTrue(errors.hasErrors());
View Full Code Here

Examples of org.magicbox.domain.UtenteImpl

    assertTrue(errors.getErrorCount() == 2);
  }
 
  public void testCellulareWrong() {

    UtenteImpl  utente = new UtenteImpl();
    utente.setNominativo("Pippo");
    utente.setCap("09100");
    // non numerico e minore della lunghezza minima
    utente.setCellulare("acvsd");
   
    Errors errors = new BindException(utente, "command");

    _validator.validate(utente, errors);
    assertTrue(errors.hasErrors());
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.