Package org.xrace.util.validation

Examples of org.xrace.util.validation.ValidationException


    CartItemInscription cartItemInscription2 = new CartItemInscription(
        composantInscription2);

    cart.add(cartItemInscription2, getRabaisEvenementService());

    ValidationException vex = new ValidationException();
    cart.preCheckOutValidate(vex);

    assertEquals(0, vex.countErrors());
  }
View Full Code Here


   */
  public void testValidateCartEmpty() throws Exception
  {
    Cart cart = new Cart();

    ValidationException vex = new ValidationException();
    cart.preCheckOutValidate(vex);

    assertEquals(1, vex.countErrors());
    assertEquals(1, vex.countErrors("Cart.error.noItems"));
  }
View Full Code Here

    CartItemInscription cartItemInscription2 = new CartItemInscription(
        composantInscription2);

    cart.add(cartItemInscription2, getRabaisEvenementService());

    ValidationException vex = new ValidationException();
    cart.preCheckOutValidate(vex);

    assertEquals(0, vex.countErrors());
  }
View Full Code Here

    cart.add(new CartItemArticle(personneJDoe, new Article(choixBBQInvite)
        .setQuantite(2)), getRabaisEvenementService());

    //On n'ajoute pas de coéquipier.

    ValidationException vex = new ValidationException();
    cart.preCheckOutValidate(vex);

    assertEquals(1, vex.countErrors());
    assertEquals(1, vex.countErrors("Cart.error.incompleteTeam"));
  }
View Full Code Here

    CartItemInscription cartItemInscription3 = new CartItemInscription(
        composantInscription3);

    cart.add(cartItemInscription3, getRabaisEvenementService());

    ValidationException vex = new ValidationException();
    cart.preCheckOutValidate(vex);

    assertEquals(1, vex.countErrors());
    assertEquals(1, vex.countErrors("Cart.error.tooMuchCompetitorsInTeam"));
  }
View Full Code Here

        getMergeContext().setPersonneSelectList(
            new ArrayList<Personne>());
        getMergeContext().addPersonneToMerge(personne1);
        getMergeContext().addPersonneToMerge(personne2);

        ValidationException vex = new ValidationException();
        if (personneMergeService.canMerge(getMergeContext()
            .getPersonne1(), getMergeContext().getPersonne2(), vex))
        {
          final DossierPersonne dossier = personneMergeService
              .preMerge(getMergeContext().getPersonne1(),
View Full Code Here

        final PersonneChoicePage parent = PersonneChoicePage.this;
        parent.getMergeContext().addPersonneToMerge(personne);

        if (parent.getMergeContext().isSecondPersonneSet())
        {
          ValidationException vex = new ValidationException();
          if (personneMergeService.canMerge(parent.getMergeContext()
              .getPersonne1(), parent.getMergeContext()
              .getPersonne2(), vex))
          {
            final DossierPersonne dossier = personneMergeService
View Full Code Here

*/
public class ValidationExceptionTests extends TestCase
{
  public void testEmpty() throws Exception
  {
    ValidationException vex = new ValidationException();
    assertEquals(0, vex.countErrors());
    assertEquals(0, vex.getErrors().size());
    assertFalse(vex.hasErrors());
  }
View Full Code Here

    assertFalse(vex.hasErrors());
  }

  public void testAddError() throws Exception
  {
    ValidationException vex = new ValidationException();
    vex.addError("code.1", 1, 2);
    vex.addError("code.2", 1, 2);
    vex.addError("code.2", 2, 2);

    assertEquals(3, vex.countErrors());
    assertEquals(3, vex.getErrors().size());
    assertTrue(vex.hasErrors());
    assertTrue(vex.containsError("code.1", 1, 2));
  }
View Full Code Here

    assertTrue(vex.containsError("code.1", 1, 2));
  }

  public void testAddDuplicate() throws Exception
  {
    ValidationException vex = new ValidationException();
    vex.addError("code.1", 1, 2);
    vex.addError("code.1", 1, 2);

    assertEquals(2, vex.countErrors());
    assertEquals(2, vex.getErrors().size());
    assertTrue(vex.hasErrors());
    assertTrue(vex.containsError("code.1", 1, 2));
  }
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.