Package org.xrace.util.validation

Examples of org.xrace.util.validation.ValidationException


      final Personne personne2)
  {
    Validate.argNotNull(personne1, "personne1");
    Validate.argNotNull(personne2, "personne2");

    ValidationException vex = new ValidationException();
    if (!canMerge(personne1, personne2, vex))
    {
      throw vex;
    }
View Full Code Here


   * @see org.xrace.service.PersonneService#merge(org.xrace.model.Personne, org.xrace.model.Personne, org.xrace.model.Personne)
   */
  public Personne merge(final Personne personne1, final Personne personne2,
      final DossierPersonne dossier)
  {
    ValidationException vex = new ValidationException();
    if (!canMerge(personne1, personne2, vex))
    {
      throw vex;
    }

View Full Code Here

  }

  @Override
  public void save(EquipeCourse equipeCourse)
  {
    ValidationException vex = new ValidationException();
    validate(equipeCourse, vex);

    if (vex.hasErrors())
    {
      throw vex;
    }

    getGenericDao().save(equipeCourse);
View Full Code Here

  {
    EquipeCourse equipeCourse = getEquipeCourseService().newEquipeCourse(
        raidVeloMag, personne);
    equipeCourse.setNomEquipe("Les goons 2");

    ValidationException vex = new ValidationException();
    getEquipeCourseService().validate(equipeCourse, vex);

    assertFalse(vex.hasErrors());
  }
View Full Code Here

  {
    EquipeCourse equipeCourse = getEquipeCourseService().newEquipeCourse(
        raidVeloMag, personne);
    equipeCourse.setNomEquipe("Les goons");

    ValidationException vex = new ValidationException();
    getEquipeCourseService().validate(equipeCourse, vex);

    assertEquals(1, vex.countErrors());
    assertTrue(vex.containsError("EquipeCourse.error.nom.double"));
  }
View Full Code Here

        infoSaisonXsxMan));
  }

  public void testCanMerge() throws Exception
  {
    ValidationException vex = new ValidationException();
    Assert.assertTrue(getPersonneMergeService().canMerge(
        personneCompteNoAdmin, personneCompteAdmin, vex));
    assertEquals(0, vex.countErrors());
  }
View Full Code Here

    assertEquals(0, vex.countErrors());
  }

  public void testCanMergeMemePersonne() throws Exception
  {
    ValidationException vex = new ValidationException();
    Assert.assertFalse(getPersonneMergeService().canMerge(
        personneCompteNoAdmin, personneCompteNoAdmin, vex));
    assertEquals(1, vex.countErrors());
    assertEquals(1, vex.countErrors("Personne.error.fusion.meme.personne"));
  }
View Full Code Here

    final Facture fact = getFactureService().createFacture(
        personneCompteAdmin, cart);
    getTransactionService().createTransaction(personneInscriteSurPlace,
        fact);

    ValidationException vex = new ValidationException();
    Assert.assertFalse(getPersonneMergeService().canMerge(
        personneCompteNoAdmin, personneCompteAdmin, vex));
    assertEquals(1, vex.countErrors());
    assertEquals(1, vex.countErrors("Personne.error.fusion.meme.course"));
  }
View Full Code Here

  public void testCanMergeAdmin() throws Exception
  {
    compteNonAdmin.setAdmin(true);
    getCompteService().save(compteNonAdmin);

    ValidationException vex = new ValidationException();
    Assert.assertFalse(getPersonneMergeService().canMerge(
        personneCompteNoAdmin, personneCompteAdmin, vex));
    assertEquals(1, vex.countErrors());
    assertEquals(1, vex.countErrors("Personne.error.fusion.admin"));
  }
View Full Code Here

      private static final long serialVersionUID = 3534043602619164257L;

      @Override
      public void onSubmit()
      {
        ValidationException vex = new ValidationException();

        session.getCart().preCheckOutValidate(vex);

        if (vex.countErrors() > 0)
        {
          ValidationUtils.transferToComponent(vex, this);
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.xrace.util.validation.ValidationException

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.