|
From: <de...@us...> - 2009-05-10 17:34:47
|
Revision: 4750
http://fudaa.svn.sourceforge.net/fudaa/?rev=4750&view=rev
Author: deniger
Date: 2009-05-10 17:34:42 +0000 (Sun, 10 May 2009)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml
trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
Removed Paths:
-------------
trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/RemplissageData.java
trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.new.xml
Deleted: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/RemplissageData.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/RemplissageData.java 2009-05-10 17:33:18 UTC (rev 4749)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/RemplissageData.java 2009-05-10 17:34:42 UTC (rev 4750)
@@ -1,578 +0,0 @@
-package org.fudaa.dodico.crue.io;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.fudaa.dodico.crue.io.dao.DonPrtCIniCasierProfil;
-import org.fudaa.dodico.crue.metier.CrueData;
-import org.fudaa.dodico.crue.metier.CrueDataImpl;
-import org.fudaa.dodico.crue.metier.emh.*;
-import org.fudaa.dodico.crue.metier.helper.EMHHelper;
-import org.fudaa.dodico.crue.metier.helper.EMHNoeudHelper;
-
-public class RemplissageData {
-
- /**
- * remplit l'ensemble des donn�es pour faire les test. Methode a updgrader et a reutiliser poru centraliser les tests.
- *
- * @return
- */
- public static CrueData remplissageDonneeTest() {
- final CrueData data = new CrueDataImpl();
-
- // -- cr�ation de noeuds --//
- DonPrtCIniNoeudNiveauContinu condInitNoeud = null;
- int cptNoeuds = 1;
- while (cptNoeuds < 25) {
- final CatEMHNoeud noeud = new CatEMHNoeud("N" + cptNoeuds++);
- // -- 2 condition init pour tous les noeuds --//
- condInitNoeud = new DonPrtCIniNoeudNiveauContinu();
- condInitNoeud.setZIni(cptNoeuds);
- noeud.addDPTI(condInitNoeud);
-
- condInitNoeud = new DonPrtCIniNoeudNiveauContinu();
- condInitNoeud.setZIni(cptNoeuds + 25);
- noeud.addDPTI(condInitNoeud);
-
- data.getNoeuds().add(noeud);
- }
-
- // --Creation des donnees DONFRT --//
- final List<DonFrt> listeDonFrt = remplissageDonneeTestDFRT();
-
- // -- creation des casiers--//
- EMHCasierProfil casierProfil = new EMHCasierProfil("CASIER PROFIL 001");
- casierProfil.setActive(false);
- // -- Donnees DPTI --//
- DonPrtCIniCasierProfil condInitCasier = new DonPrtCIniCasierProfil();
- condInitCasier.setQruis(234.123);
- casierProfil.addDPTI(condInitCasier);
- // -- recherche du noeud 25 precedemment ins�r� --//
- final CatEMHNoeud noeud25 = EMHNoeudHelper.findByReference("N22", data);
- casierProfil.setNoeud(noeud25);
- // -- Donnees DPTG --//
- // -- Ajout de 3 donn�es DPTG --//
- DonPrtGeoProfilCasier geoCasier = new DonPrtGeoProfilCasier();
- geoCasier.setListeProfils(remplirSeriesProfilsDPTG(2));
- geoCasier.setLongueur(777);
- geoCasier.setNom("PROFIL01 de 001");
- // geoCasier.setMLitNumerotes(remplirLitsDPTG(3, listeDonFrt.get(0), listeDonFrt.get(5)));
- casierProfil.addDPTG(geoCasier);
-
- geoCasier = new DonPrtGeoProfilCasier();
- geoCasier.setListeProfils(remplirSeriesProfilsDPTG(8));
- geoCasier.setLongueur(423);
- geoCasier.setNom("PROFIL02 de 001");
- // geoCasier.setMLitNumerotes(remplirLitsDPTG(3, listeDonFrt.get(5), listeDonFrt.get(6)));
- casierProfil.addDPTG(geoCasier);
-
- geoCasier = new DonPrtGeoProfilCasier();
- geoCasier.setListeProfils(remplirSeriesProfilsDPTG(1));
- geoCasier.setLongueur(2);
- geoCasier.setNom("PROFIL03 de 001");
- // geoCasier.setMLitNumerotes(remplirLitsDPTG(3, listeDonFrt.get(2), listeDonFrt.get(1)));
- casierProfil.addDPTG(geoCasier);
-
- data.add(casierProfil);
-
- // -- ajout d'un autre casier profil qui utilise le meme profil DPTG --//
- casierProfil = new EMHCasierProfil("CASIER PROFIL PIque DPTG");
- casierProfil.setActive(false);
- final CatEMHNoeud noeud17 = EMHNoeudHelper.findByReference("N17", data);
- casierProfil.setNoeud(noeud17);
- // -- Donnees DPTG --//
- casierProfil.addDPTG(geoCasier);
- data.add(casierProfil);
-
- final EMHCasierMNT casierMNT = new EMHCasierMNT("CASIER MNT 002");
- casierMNT.setActive(true);
- // -- recherche du noeud 12 precedemment ins�r� --//
- final CatEMHNoeud noeud12 = EMHNoeudHelper.findByReference("N12", data);
- casierMNT.setNoeud(noeud12);
- condInitCasier = new DonPrtCIniCasierProfil();
- condInitCasier.setQruis(12.11);
- casierMNT.addDPTI(condInitCasier);
- data.add(casierMNT);
-
- // -- creation des sections --//
- final EMHSectionInterpolee interpol = new EMHSectionInterpolee("SEC INT");
-
- // -- dscp --//
- DonCalcSansPrtSection calculSection = new DonCalcSansPrtSection();
- calculSection.setCoeffConv(12.25);
- calculSection.setCoeffDiv(11.13);
- calculSection.setCoeffPond(2.251524);
- interpol.addDSCP(calculSection);
-
- data.add(interpol);
-
- // -- Section Profil --//
- final EMHSectionProfil profil = new EMHSectionProfil("SEC PROF");
-
- // -- dscp --//
- calculSection = new DonCalcSansPrtSection();
- calculSection.setCoeffConv(09.11);
- calculSection.setCoeffDiv(11);
- calculSection.setCoeffPond(212.2);
- profil.addDSCP(calculSection);
-
- // -- Donnees DPTG --//
- // -- Ajout de 3 donn�es DPTG --//
- final DonPrtGeoProfilSection geoSection = new DonPrtGeoProfilSection();
- geoSection.setListeProfils(remplirSeriesProfilsDPTG(2));
- geoSection.setNom("PROFIL_SECTION_007");
- geoSection.setMLitNumerotes(remplirLitsDPTG(3, listeDonFrt.get(0), listeDonFrt.get(5)));
- profil.addDPTG(geoSection);
- data.add(profil);
-
- final EMHSectionSansGeometrie geometrie = new EMHSectionSansGeometrie("SEC GEOM");
-
- // -- dscp --//
- calculSection = new DonCalcSansPrtSection();
- calculSection.setCoeffConv(255);
- calculSection.setCoeffDiv(999);
- calculSection.setCoeffPond(777);
- geometrie.addDSCP(calculSection);
- data.add(geometrie);
-
- // -- Section Idem --//
- final EMHSectionIdem sectionIdem = new EMHSectionIdem("SEC IDEM");
-
- // -- dscp --//
- final DonCalcSansPrtSection calculSection2 = new DonCalcSansPrtSection();
- calculSection2.setCoeffConv(12.25);
- calculSection2.setCoeffDiv(11.13);
- calculSection2.setCoeffPond(2.251524);
- sectionIdem.addDSCP(calculSection2);
-
- // -- DPTG --//
- final DonPrtGeoSectionIdem geoIdem = new DonPrtGeoSectionIdem();
- geoIdem.setDW(65535);
- sectionIdem.addDPTG(geoIdem);
- data.add(sectionIdem);
-
- // -- creation des branches --//
- DonPrtCIniBranche condInitBranche1 = null;
- DonPrtCIniBrancheOrifice condInitBranche2 = null;
-
- // EMHBrancheSaintVenant
- final EMHBrancheSaintVenant branche1 = new EMHBrancheSaintVenant("BRANCHE VENANT1");
- branche1.setActive(true);
- branche1.setNoeudAmont(EMHNoeudHelper.findByReference("N12", data));
- branche1.setNoeudAval(EMHNoeudHelper.findByReference("N1", data));
-
- // -- donnees DPTI --//
- condInitBranche1 = new DonPrtCIniBranche();
- condInitBranche1.setQinit(12.5);
- branche1.addDPTI(condInitBranche1);
- // -- donnees DSCP --//
- final DonCalcSansPrtBrancheSaintVenant dataCalcul = new DonCalcSansPrtBrancheSaintVenant();
- dataCalcul.setCoeffBeta(5.55);
- dataCalcul.setCoefRuis(6.66);
- dataCalcul.setCoeffRuisQdm(7.77);
- branche1.addDSCP(dataCalcul);
- List<RelationEMH> listeSections = new ArrayList<RelationEMH>();
- HashMap<String, Object> map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "POSITION SECTION INTERPOL");
- map.put(EMHHelper.Xp_section, 123.4);
-
- listeSections.add(new RelationEMH(interpol, map));
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "POSITION SECTION GEOMETRIE");
- map.put(EMHHelper.Xp_section, 123.4);
-
- listeSections.add(new RelationEMH(geometrie, map));
- branche1.setListeSections(listeSections);
-
- // -- Donnees DPTG --//
- final DonPrtGeoBrancheSaintVenant geoPrt = new DonPrtGeoBrancheSaintVenant();
- geoPrt.setCoefSinuo(255);
- branche1.addDPTG(geoPrt);
-
- data.add(branche1);
-
- // EMHBrancheBarrageGenerique
- final EMHBrancheBarrageGenerique branche2 = new EMHBrancheBarrageGenerique("BRANCHE CHANEL");
- branche2.setActive(false);
- branche2.setNoeudAmont(EMHNoeudHelper.findByReference("N5", data));
- branche2.setNoeudAval(EMHNoeudHelper.findByReference("N7", data));
-
- // -- donnees DPTI --//
- condInitBranche1 = new DonPrtCIniBranche();
- condInitBranche1.setQinit(2.5);
-
- branche2.addDPTI(condInitBranche1);
-
- // -- donnees DSCP --//
- final DonCalcSansPrtBrancheBarrageFilEau dataCalcul1 = new DonCalcSansPrtBrancheBarrageFilEau();
- dataCalcul1.setQLimInf(144);
- dataCalcul1.setQLimSup(441);
- LoiFF loi = new LoiFF();
- loi.setNom("Loi BRANCHE GENE");
- dataCalcul1.setRegimeDenoye(loi);
- dataCalcul1.setListElt(remplirListeSeuils());
- branche2.addDSCP(dataCalcul1);
-
- listeSections = new ArrayList<RelationEMH>();
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "POSITION SECTION PROFIL");
- map.put(EMHHelper.Xp_section, 212.121);
- listeSections.add(new RelationEMH(profil, map));
- branche2.setListeSections(listeSections);
- data.add(branche2);
-
- // EMHBrancheOrifice
- final EMHBrancheOrifice branche3 = new EMHBrancheOrifice("BRANCHE ORIFICE");
- branche3.setActive(false);
- branche3.setNoeudAmont(EMHNoeudHelper.findByReference("N5", data));
- branche3.setNoeudAval(EMHNoeudHelper.findByReference("N7", data));
- // -- donnees DPTI --//
- condInitBranche2 = new DonPrtCIniBrancheOrifice();
- condInitBranche2.setQinit(65535);
- condInitBranche2.setOuvPasseDessous(255);
- branche3.addDPTI(condInitBranche2);
- // -- donnees DSCP --//
- // -- liste element orifices --//
- final DonCalcSansPrtBrancheOrifice dataCalcul2 = new DonCalcSansPrtBrancheOrifice();
- dataCalcul2.setElement(remplirListeOrifices());
- branche3.addDSCP(dataCalcul2);
-
- listeSections = new ArrayList<RelationEMH>();
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "Test");
- map.put(EMHHelper.Xp_section, 777);
- listeSections.add(new RelationEMH(profil, map));
- branche3.setListeSections(listeSections);
- data.add(branche3);
-
- // EMHBrancheSeuilTransversal
- final EMHBrancheSeuilTransversal branche4 = new EMHBrancheSeuilTransversal("BRANCHE TRANSVERSALE ELEMSEUIL");
- branche4.setActive(false);
- branche4.setNoeudAmont(EMHNoeudHelper.findByReference("N3", data));
- branche4.setNoeudAval(EMHNoeudHelper.findByReference("N12", data));
- // -- donnees DPTI --//
- condInitBranche1 = new DonPrtCIniBranche();
- condInitBranche1.setQinit(12.254);
- branche4.addDPTI(condInitBranche1);
-
- // -- donnees DSCP --//
- // -- liste element orifices --//
- final DonCalcSansPrtBrancheSeuilTransversal dataCalcul3 = new DonCalcSansPrtBrancheSeuilTransversal();
- dataCalcul3.setListElt(remplirListeSeuilsPDC());
- dataCalcul3.setFormulePdc("Divergent");
- branche4.addDSCP(dataCalcul3);
-
- listeSections = new ArrayList<RelationEMH>();
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "Profil Test");
- map.put(EMHHelper.Xp_section, 458);
- listeSections.add(new RelationEMH(profil, map));
- branche4.setListeSections(listeSections);
- data.add(branche4);
-
- // EMHBrancheSeuilLongitudinal
- final EMHBrancheSeuilLateral branche5 = new EMHBrancheSeuilLateral("BRANCHE LATERALE ELEMSEUIL");
- branche5.setActive(false);
- branche5.setNoeudAmont(EMHNoeudHelper.findByReference("N3", data));
- branche5.setNoeudAval(EMHNoeudHelper.findByReference("N12", data));
- // -- donnees DPTI --//
- condInitBranche1 = new DonPrtCIniBranche();
- condInitBranche1.setQinit(12.254);
- branche5.addDPTI(condInitBranche1);
-
- // -- donnees DSCP --//
- // -- liste element orifices --//
- final DonCalcSansPrtBrancheSeuilLateral dataCalcul4 = new DonCalcSansPrtBrancheSeuilLateral();
- dataCalcul4.setListElt(remplirListeSeuilsPDC());
- dataCalcul4.setFormulePdc("Convergent");
- branche5.addDSCP(dataCalcul4);
-
- listeSections = new ArrayList<RelationEMH>();
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "Profil Test 3");
- map.put(EMHHelper.Xp_section, 457);
- listeSections.add(new RelationEMH(profil, map));
- branche5.setListeSections(listeSections);
- data.add(branche5);
-
- // EMHBrancheBarrageFilEau
- final EMHBrancheBarrageFilEau branche6 = new EMHBrancheBarrageFilEau("BRANCHE BARRAGE FIL EAU");
- branche6.setActive(false);
- branche6.setNoeudAmont(EMHNoeudHelper.findByReference("N3", data));
- branche6.setNoeudAval(EMHNoeudHelper.findByReference("N12", data));
- // -- donnees DPTI --//
- condInitBranche1 = new DonPrtCIniBranche();
- condInitBranche1.setQinit(12.254);
- branche6.addDPTI(condInitBranche1);
-
- // -- donnees DSCP --//
- // -- liste element orifices --//
- final DonCalcSansPrtBrancheBarrageFilEau dataCalcul5 = new DonCalcSansPrtBrancheBarrageFilEau();
- dataCalcul5.setQLimInf(144);
- dataCalcul5.setQLimSup(441);
- loi = new LoiFF();
- loi.setNom("Loi Speciale");
- dataCalcul5.setRegimeDenoye(loi);
- dataCalcul5.setListElt(remplirListeSeuils());
- branche6.addDSCP(dataCalcul5);
-
- listeSections = new ArrayList<RelationEMH>();
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "VAR TEST profil");
- map.put(EMHHelper.Xp_section, 111);
- listeSections.add(new RelationEMH(profil, map));
- branche6.setListeSections(listeSections);
- data.add(branche6);
-
- // EMHBranchePdc
- final EMHBranchePdc branche7 = new EMHBranchePdc("BRANCHE PDC");
- branche7.setActive(false);
- branche7.setNoeudAmont(EMHNoeudHelper.findByReference("N3", data));
- branche7.setNoeudAval(EMHNoeudHelper.findByReference("N12", data));
- // -- donnees DPTI --//
- condInitBranche1 = new DonPrtCIniBrancheOrifice();
- condInitBranche1.setQinit(12.254);
- branche7.addDPTI(condInitBranche1);
-
- // -- donnees DSCP --//
- // -- liste element orifices --//
- final DonCalcSansPrtBranchePDC dataCalcul6 = new DonCalcSansPrtBranchePDC();
-
- loi = new LoiFF();
- loi.setNom("Loi du PDC");
- dataCalcul6.setPdc_DZ(loi);
- branche7.addDSCP(dataCalcul6);
-
- listeSections = new ArrayList<RelationEMH>();
- map = new HashMap<String, Object>();
- map.put(EMHHelper.Pos_section, "profil section");
- map.put(EMHHelper.Xp_section, 12345);
- listeSections.add(new RelationEMH(profil, map));
- branche7.setListeSections(listeSections);
- data.add(branche7);
-
- return data;
- }
-
- public static List<LitNumerote> remplirLitsDPTG(final int a, final DonFrt don1, final DonFrt don2) {
- final List<LitNumerote> listeLits = new ArrayList<LitNumerote>();
-
- LitNumerote litNum = new LitNumerote();
-
- litNum.setDebut(new PtProfil(13.2 * a, 101.2 * a));
- litNum.setFin(new PtProfil(44.2 * a, 2000.2 * a));
- litNum.setEstActif(true);
- litNum.setEstMineur(false);
- litNum.setMDonFrt(don1);
- listeLits.add(litNum);
-
- litNum = new LitNumerote();
- litNum.setDebut(new PtProfil(200 * a, 11.2 * a));
- litNum.setFin(new PtProfil(1000 * a, 13 * a));
- litNum.setEstActif(false);
- litNum.setEstMineur(true);
- litNum.setMDonFrt(don2);
- listeLits.add(litNum);
-
- return listeLits;
- }
-
- public static List<PtProfil> remplirSeriesProfilsDPTG(final int a) {
- final List<PtProfil> listeProfils = new ArrayList<PtProfil>();
- listeProfils.add(new PtProfil(13.2 * a, 101.2 * a));
- listeProfils.add(new PtProfil(1.2 * a, 12 * a));
- listeProfils.add(new PtProfil(2.2 * a, 2 * a));
- listeProfils.add(new PtProfil(123.2 * a, 10 * a));
- listeProfils.add(new PtProfil(1003.2 * a, 11 * a));
- listeProfils.add(new PtProfil(143.2 * a, 12 * a));
- listeProfils.add(new PtProfil(1.2 * a, 111 * a));
- listeProfils.add(new PtProfil(13.2 * a, 777 * a));
- listeProfils.add(new PtProfil(0.2 * a, 5.2 * a));
- listeProfils.add(new PtProfil(12.2 * a, 0.2 * a));
- listeProfils.add(new PtProfil(5.2 * a, 1.2 * a));
- listeProfils.add(new PtProfil(99.2 * a, 2.2 * a));
- listeProfils.add(new PtProfil(102.2 * a, 111.2 * a));
- return listeProfils;
- }
-
- public static List<ElemOrifice> remplirListeOrifices() {
- final List<ElemOrifice> listeEltSeuilsOrifices = new ArrayList<ElemOrifice>();
- ElemOrifice orif = new ElemOrifice();
- orif.setCoeffCtrLim(999);
- orif.setCoeffQ(23);
- orif.setLarg(11);
- orif.setSens("Bidirect");
- orif.setZSeuil(22.23);
- listeEltSeuilsOrifices.add(orif);
- orif = new ElemOrifice();
- orif.setCoeffCtrLim(543);
- orif.setCoeffQ(12345);
- orif.setLarg(987);
- orif.setSens("Uni");
- orif.setZSeuil(1.9);
- listeEltSeuilsOrifices.add(orif);
- orif = new ElemOrifice();
- orif.setCoeffCtrLim(2);
- orif.setCoeffQ(3);
- orif.setLarg(4);
- orif.setSens("5 Uni");
- orif.setZSeuil(6);
- listeEltSeuilsOrifices.add(orif);
- return listeEltSeuilsOrifices;
- }
-
- public static List<ElemSeuilAvecPdc> remplirListeSeuilsPDC() {
- final List<ElemSeuilAvecPdc> listeEltSeuils = new ArrayList<ElemSeuilAvecPdc>();
- ElemSeuilAvecPdc orif = new ElemSeuilAvecPdc();
- orif.setCoeffPdc(23);
- orif.setCoeffD(23);
- orif.setLarg(11);
- orif.setZSeuil(22.23);
- listeEltSeuils.add(orif);
- orif = new ElemSeuilAvecPdc();
- orif.setCoeffPdc(1.1);
- orif.setCoeffD(12345);
- orif.setLarg(987);
- orif.setZSeuil(1.9);
- listeEltSeuils.add(orif);
- orif = new ElemSeuilAvecPdc();
- orif.setCoeffPdc(99.9);
- orif.setCoeffD(3);
- orif.setLarg(4);
- orif.setZSeuil(6);
- listeEltSeuils.add(orif);
- return listeEltSeuils;
- }
-
- public static List<ElemSeuil> remplirListeSeuils() {
- final List<ElemSeuil> listeEltSeuils = new ArrayList<ElemSeuil>();
- ElemSeuil orif = new ElemSeuil();
-
- orif.setCoeffD(23);
- orif.setLarg(11);
- orif.setZSeuil(22.23);
- listeEltSeuils.add(orif);
- orif = new ElemSeuil();
-
- orif.setCoeffD(12345);
- orif.setLarg(987);
- orif.setZSeuil(1.9);
- listeEltSeuils.add(orif);
- orif = new ElemSeuil();
-
- orif.setCoeffD(3);
- orif.setLarg(4);
- orif.setZSeuil(6);
- listeEltSeuils.add(orif);
- return listeEltSeuils;
- }
-
- public static CrueData remplissageDonneeTestErreur() {
- final CrueData res = remplissageDonneeTest();
-
- res.getAllEMH().remove(EMHNoeudHelper.findByReference("N5", res));
- res.getAllEMH().remove(EMHNoeudHelper.findByReference("N12", res));
- res.getAllEMH().remove(EMHNoeudHelper.findByReference("N3", res));
- res.getAllEMH().remove(EMHNoeudHelper.findByReference("N1", res));
-
- return res;
- }
-
- /**
- * remplit l'ensemble des donn�es pour faire les test. Methode a updgrader et a reutiliser poru centraliser les tests.
- *
- * @return
- */
- public static List<DonFrt> remplissageDonneeTestDFRT() {
- final List<DonFrt> data = new ArrayList<DonFrt>();
-
- DonFrt ref1 = new StriRefC("ref#stric");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefZ("rsdfsf");
- ref1.addPoint(new FrottementPoint(12, 23));
- ref1.addPoint(new FrottementPoint(452, 1));
- data.add(ref1);
- ref1 = new StriRefH("test");
- ref1.addPoint(new FrottementPoint(1, 1));
- ref1.addPoint(new FrottementPoint(1222, 2143));
- data.add(ref1);
- ref1 = new StriRefC("@#hgf55");
- ref1.addPoint(new FrottementPoint(10, 20));
- ref1.addPoint(new FrottementPoint(12, 23));
- data.add(ref1);
- ref1 = new StriRefH("12 235");
- ref1.addPoint(new FrottementPoint(10, 20));
- ref1.addPoint(new FrottementPoint(1712, 52253));
- data.add(ref1);
- ref1 = new StriRefH("XIII");
- ref1.addPoint(new FrottementPoint(10, 20));
- ref1.addPoint(new FrottementPoint(2, 3));
- data.add(ref1);
- data.add(ref1);
- ref1 = new StriRefZ("ba28 d");
- ref1.addPoint(new FrottementPoint(10, 20));
- ref1.addPoint(new FrottementPoint(666, 555));
- data.add(ref1);
- data.add(ref1);
- ref1 = new StriRefZ("ref z");
- ref1.addPoint(new FrottementPoint(14, 16));
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefZ("rh 132");
- ref1.addPoint(new FrottementPoint(10, 20));
- ref1.addPoint(new FrottementPoint(12, 23));
- data.add(ref1);
- ref1 = new StriRefH("refh12");
- ref1.addPoint(new FrottementPoint(10, 20));
- ref1.addPoint(new FrottementPoint(2112, 3223));
- data.add(ref1);
-
- return data;
- }
-
- public static List<DonFrt> remplissageDonneeTestErreurDFRT() {
- final List<DonFrt> data = new ArrayList<DonFrt>();
-
- DonFrt ref1 = new StriRefC("ref#stric");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefZ("rsdfsf");
- ref1.addPoint(new FrottementPoint(12, 23));
- data.add(ref1);
- ref1 = new StriRefH("test");
- ref1.addPoint(new FrottementPoint(1, 1));
- data.add(ref1);
- ref1 = new StriRefC("@#hgf55");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefH("12 235");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefH("XIII");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefZ("ba28 d");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefZ("ref z");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefZ("rh 132");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
- ref1 = new StriRefH("refh12");
- ref1.addPoint(new FrottementPoint(10, 20));
- data.add(ref1);
-
- return data;
- }
-
- public static OrdPrtGeoModeleBase remplissageDonneeTestErreurOPTG() {
- final OrdPrtGeoModeleBase data = new OrdPrtGeoModeleBase();
-
- return data;
- }
-
-}
Modified: trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java 2009-05-10 17:33:18 UTC (rev 4749)
+++ trunk/soft/fudaa-crue/dodico/src/test/java/org/fudaa/dodico/crue/io/TestCrueDFRTFile.java 2009-05-10 17:34:42 UTC (rev 4750)
@@ -6,6 +6,8 @@
import org.fudaa.ctulu.CtuluAnalyze;
import org.fudaa.dodico.crue.metier.emh.DonFrt;
+import org.fudaa.dodico.crue.metier.emh.DonFrtList;
+import org.fudaa.dodico.crue.metier.emh.StriRefC;
@SuppressWarnings("PMD.SystemPrintln")
public class TestCrueDFRTFile extends AbstractIOTestCase {
@@ -67,22 +69,25 @@
*/
public void testDonFrt(final List<DonFrt> frts) {
assertNotNull(frts);
- System.err.println(frts.size());
for (final DonFrt donfrt : frts) {
assertNotNull(donfrt);
}
- assertEquals(0.00, frts.get(1).getListePoints().get(0).getX());
- assertEquals(10.00, frts.get(1).getListePoints().get(1).getX());
- assertEquals(15.00, frts.get(1).getListePoints().get(0).getY());
- assertEquals(15.00, frts.get(1).getListePoints().get(1).getY());
+ StriRefC striRefC = (StriRefC) frts.get(0);
+ assertEquals("FK0", striRefC.getNom());
+ assertDoubleEquals(0, striRefC.k);
+ DonFrtList donFrtList = (DonFrtList) frts.get(1);
+ assertEquals(0.00, donFrtList.getX(0));
+ assertEquals(10.00, donFrtList.getX(1));
+ assertEquals(15.00, donFrtList.getY(0));
+ assertEquals(15.00, donFrtList.getY(1));
+ donFrtList = (DonFrtList) frts.get(2);
+ assertEquals(0.00, donFrtList.getX(0));
+ assertEquals(10.00, donFrtList.getX(1));
+ assertEquals(30.00, donFrtList.getY(0));
+ assertEquals(30.00, donFrtList.getY(1));
- assertEquals(0.00, frts.get(2).getListePoints().get(0).getX());
- assertEquals(10.00, frts.get(2).getListePoints().get(1).getX());
- assertEquals(30.00, frts.get(2).getListePoints().get(0).getY());
- assertEquals(30.00, frts.get(2).getListePoints().get(1).getY());
-
}
public static List<DonFrt> readModele3() {
@@ -103,7 +108,7 @@
testWrite(in, f);
final CtuluAnalyze analyse = new CtuluAnalyze();
final List<DonFrt> jeuDonnees = Crue10FileFormatFactory.getDFRTFileFormat().read(f, analyse, null);
- analyse.printResume();
+ testAnalyser(analyse);
testDonFrt(jeuDonnees);
}
@@ -111,8 +116,10 @@
private File testWrite(final List<DonFrt> in, final File f) {
final CtuluAnalyze analyse = new CtuluAnalyze();
final boolean res = Crue10FileFormatFactory.getDFRTFileFormat().write(in, f, analyse);
- analyse.printResume();
+ testAnalyser(analyse);
assertTrue(res);
+ assertTrue(Crue10FileFormatFactory.getDFRTFileFormat().isValide(f, analyse));
+ testAnalyser(analyse);
return f;
}
Deleted: trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.new.xml
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.new.xml 2009-05-10 17:33:18 UTC (rev 4749)
+++ trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.new.xml 2009-05-10 17:34:42 UTC (rev 4750)
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<DFRT xmlns="http://www.fudaa.fr/xsd/crue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fudaa.fr/xsd/crue http://www.fudaa.fr/xsd/crue/dfrt-1.0.xsd">
- <!-- Le fichier DFRT décrit les frottements d'un modèle CrueX. Son périmètre est le sous-modèle -->
- <Commentaire>Commentaire sur le sous-modèle</Commentaire>
- <StriRefC Nom="FK0">0.</StriRefC>
- <StriRefZ Nom="FPROF1MAJ">
- <!-- Point Flottant-Flottant -->
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF1MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF2MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF2MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF3AMAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF3AMIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF3AVMAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF3AVMIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF3BMAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF3BMIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF4MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF4MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF6AMAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF6AMIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF7MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF7MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF8MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF8MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF9MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF9MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF10MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF10MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>10.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF11MAJ">
- <PointFF>0.00 15.</PointFF>
- <PointFF>10.00 15.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROF11MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>11.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROFSTR1MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>11.00 30.</PointFF>
- </StriRefZ>
- <StriRefZ Nom="FPROFSTR2MIN">
- <PointFF>0.00 30.</PointFF>
- <PointFF>11.00 30.</PointFF>
- </StriRefZ>
-</DFRT>
\ No newline at end of file
Modified: trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml
===================================================================
--- trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml 2009-05-10 17:33:18 UTC (rev 4749)
+++ trunk/soft/fudaa-crue/dodico/src/test/resources/fichierTest/Modele3.dfrt.xml 2009-05-10 17:34:42 UTC (rev 4750)
@@ -2,7 +2,7 @@
<DFRT xmlns="http://www.fudaa.fr/xsd/crue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.fudaa.fr/xsd/crue http://www.fudaa.fr/xsd/crue/dfrt-1.0.xsd">
<!-- Le fichier DFRT décrit les frottements d'un modèle CrueX. Son périmètre est le sous-modèle -->
<Commentaire>Commentaire sur le sous-modèle</Commentaire>
- <StriRefC Nom="FK0">0.</StriRefC>
+ <StriRefC Nom="FK0"><k>0.</k></StriRefC>
<StriRefZ Nom="FPROF1MAJ">
<!-- Point Flottant-Flottant -->
<PointFF>0.00 15.</PointFF>
Modified: trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java 2009-05-10 17:33:18 UTC (rev 4749)
+++ trunk/soft/fudaa-crue/fudaa/src/main/java/org/fudaa/fudaa/crue/builder/EMHGeneralBuilder.java 2009-05-10 17:34:42 UTC (rev 4750)
@@ -1,6 +1,6 @@
package org.fudaa.fudaa.crue.builder;
-import org.fudaa.dodico.crue.metier.emh.CrueData;
+import org.fudaa.dodico.crue.metier.CrueData;
import org.fudaa.dodico.crue.metier.emh.EMH;
import org.fudaa.dodico.crue.metier.emh.InfosEMH;
import org.fudaa.dodico.crue.metier.emh.RelationEMH;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|