Examples of ImportationPuces


Examples of org.xrace.model.importation.puces.ImportationPuces

   * La ligne vide à la fin devrait être retranchée du fichier (pas dans la liste
   * des lignes ignorées).
   */
  public void testLoadCasNormal() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-cas_normal.csv");
    getImportationPucesService().load(importationPuces);

    assertEquals(3, importationPuces.getIgnoredLines().size());
    assertEquals(5, importationPuces.getLines().size());

    assertEquals("KP-38258", importationPuces.getLines().get(0)
        .getCodePuce());
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

   * Cas avec des doublons. Les lignes ignorées ne changent pas, et les
   * doublons sont quand même chargés.
   */
  public void testLoadDoublons() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-doublons.csv");

    getImportationPucesService().load(importationPuces);

    assertEquals(3, importationPuces.getIgnoredLines().size());
    assertEquals(7, importationPuces.getLines().size());

    assertEquals("KP-38258", importationPuces.getLines().get(0)
        .getCodePuce());
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

   * Les lignes vides sont complètement ignorées (sans les ajouter à la
   * liste).
   */
  public void testLoadLignesInvalides() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-lignes_invalides.csv");

    getImportationPucesService().load(importationPuces);

    assertEquals(4, importationPuces.getIgnoredLines().size());
    assertEquals(3, importationPuces.getLines().size());

    assertEquals("KP-38258", importationPuces.getLines().get(0)
        .getCodePuce());
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

   * Plusieurs lignes avec un nombre invalide de colonnes. Ces lignes
   * sont ignorées.
   */
  public void testLoadColPucesInvalides() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-col_puces_invalide.csv");

    getImportationPucesService().load(importationPuces);

    assertEquals(7, importationPuces.getIgnoredLines().size());
    assertEquals(1, importationPuces.getLines().size());

    assertEquals("0", importationPuces.getLines().get(0).getCodePuce());
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

  }

  public ImportationPuces newImportation(Compte compte,
      EnsemblePuces ensemblePuces, Date date)
  {
    ImportationPuces importationPuces = new ImportationPuces();
    importationPuces.setCompte(compte);
    importationPuces.setEnsemblePuces(ensemblePuces);
    importationPuces.setDate(date);
    return importationPuces;
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

  /**
   * Valide le numero de ligne du début.
   */
  public void testLoadValiderNumeroLigneDebut() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-col_puces_invalide.csv");
    importationPuces.setIndexPremiereLigne(0);

    try
    {
      getImportationPucesService().load(importationPuces);
      fail();
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

  /**
   * Teste le cas où l'index de la première ligne est trop grand. 
   */
  public void testLoadNumeroLigneDebutTropGrand() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-col_puces_invalide.csv");
    importationPuces.setIndexPremiereLigne(10);

    getImportationPucesService().load(importationPuces);

    assertEquals(8, importationPuces.getIgnoredLines().size());
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

  /**
   * Valide l'index de colonne à charger.
   */
  public void testLoadValiderIndexColonne() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-col_puces_invalide.csv");
    importationPuces.setIndexColonneCode(0);

    try
    {
      getImportationPucesService().load(importationPuces);
      fail();
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

  /**
   * Teste un cas où on a changé l'index de colonne.
   */
  public void testLoadChangerIndexColonne() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-col_puces_invalide.csv");
    importationPuces.setIndexColonneCode(13);

    getImportationPucesService().load(importationPuces);

    assertEquals(7, importationPuces.getIgnoredLines().size());
    assertEquals(1, importationPuces.getLines().size());

    assertEquals("NC-02709", importationPuces.getLines().get(0)
        .getCodePuce());
  }
View Full Code Here

Examples of org.xrace.model.importation.puces.ImportationPuces

  /**
   * Aucune erreur de validation, le fichier est valide.
   */
  public void testValidateCasNormal() throws Exception
  {
    ImportationPuces importationPuces = getImportation("importation_puces-cas_normal.csv");
    getImportationPucesService().load(importationPuces);
    getImportationPucesService().validate(importationPuces);

    assertEquals(5, importationPuces.getLinesByStatus(
        ImportationLineStatus.VALIDEE).size());
    assertEquals(0, importationPuces.getLinesByStatus(
        ImportationLineStatus.EN_ERREUR).size());
    assertEquals(0, importationPuces.getLinesExclus().size());
  }
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.