This is an automated email from the git hooks/post-receive script. New commit to branch feature/6688 in repository tutti. See http://git.codelutin.com/tutti.git commit efbe375821593fac1634e2f347a2432869069374 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Feb 20 20:24:52 2015 +0100 delete no more used test (db associated was lost...) --- .../GenericFormatExportService2Test.java | 240 --------------------- 1 file changed, 240 deletions(-) diff --git a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService2Test.java b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService2Test.java deleted file mode 100644 index 275e40b..0000000 --- a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService2Test.java +++ /dev/null @@ -1,240 +0,0 @@ -package fr.ifremer.tutti.service.genericformat; - -/* - * #%L - * Tutti :: Service - * %% - * Copyright (C) 2012 - 2014 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import com.google.common.io.Files; -import fr.ifremer.tutti.persistence.ProgressionModel; -import fr.ifremer.tutti.service.PersistenceService; -import fr.ifremer.tutti.service.ServiceDbResource; -import fr.ifremer.tutti.service.TuttiServiceContext; -import fr.ifremer.tutti.service.catches.WeightComputingService; -import org.junit.Assert; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; -import org.nuiton.jaxx.application.ApplicationBusinessException; - -import java.io.File; -import java.net.URL; -import java.util.List; - -/** - * Test export of catches. - * - * @author tchemit <chemit@codelutin.com> - * @since 2.3.2 - */ -public class GenericFormatExportService2Test { - - @ClassRule - public static final ServiceDbResource dbResource = - ServiceDbResource.readDb("dbExport"); - - public static final String PROGRAM_ID = "CAM-TEST_ELEVATION"; - - public static final String CRUISE_ID = "100003"; - - public static final String OPERATION_1_ID = "100112"; - - public static final String OPERATION_2_ID = "100113"; - - public static final String OPERATION_3_ID = "100114"; - - protected GenericFormatExportService service; - - protected ServiceDbResource.DataContext dataContext; - - protected File dataDirectory; - - @Before - public void setUp() throws Exception { - - dataDirectory = dbResource.getConfig().getDataDirectory(); - - dbResource.setCountryInConfig("12"); - - dbResource.openDataContext(); - - TuttiServiceContext serviceContext = dbResource.getServiceContext(); - - service = serviceContext.getService(GenericFormatExportService.class); - - } - - @Test - public void exportWithErrors() throws Exception { - - - TuttiServiceContext serviceContext = dbResource.getServiceContext(); - - PersistenceService persistenceService = serviceContext.getService(PersistenceService.class); - - // check there is a error while compute weight for a cruise - boolean errorDetected = false; - WeightComputingService computingService = serviceContext.getService(WeightComputingService.class); - List<String> allFishingOperation = persistenceService.getAllFishingOperationIds(CRUISE_ID); - for (String fishingOperation : allFishingOperation) { - try { - computingService.getComputedSpeciesBatches(fishingOperation); - } catch (Exception e) { - errorDetected = true; - break; - } - } - - Assert.assertTrue(errorDetected); - - File exportFile = new File(dataDirectory, "exportCruise.zip"); - - Files.createParentDirs(exportFile); - - Assert.assertFalse(exportFile.exists()); - - ProgressionModel progressionModel = new ProgressionModel(); - progressionModel.setTotal(9); - try { - service.exportCruise(CRUISE_ID, exportFile, progressionModel); - // got an error after but export was still performed - Assert.fail(); - } catch (ApplicationBusinessException e) { - // got an error - Assert.assertTrue(true); - } - // export perform, file exist - Assert.assertTrue(exportFile.exists()); - - String urlPrefix = "jar:" + exportFile.toURI().toURL() + "!/exportCruise-" + CRUISE_ID + "/"; - { - // check species file content - - URL url = new URL(urlPrefix + "species.csv"); - ServiceDbResource.assertFileContent("species export:\n", - url, - "Id;Code_Rubin;Nom_Scientifique;Code_campagne\n" + - "380;ACANECH;Acanthocardia echinata;\n" + - "1358;ALOSALO;Alosa alosa;\n" + - "1938;AGONCAT;Agonus cataphractus;\n" + - "4622;ABIEABI;Abietinaria abietina;\n" + - "11183;;Brissopsis atlantica;"); - - } - - { - // check accidentalCatch file content - - URL url = new URL(urlPrefix + "accidentalCatch.csv"); - ServiceDbResource.assertFileContent("accidentalCatch export:\n", - url, - "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;BatchId;ReferenceTaxonId;ReferenceTaxonName;Commentaire;CaracteristicId;CaracteristicValue"); - - } - - { - // check operation file content - - URL url = new URL(urlPrefix + "operation.csv"); - ServiceDbResource.assertFileContent("operation export:\n", - url, - "Annee;Serie;Serie_Partielle;Code_Station;Id_Operation;Poche;Engin;Navire;DateDeb;LatDeb;LongDeb;DateFin;LatFin;LongFin;Duree;Strate;Sous_Strate;Localite;Validite_OP;Rectiligne;Distance;Saisisseur;Navire_Associe;Commentaire;Poids_Total;Poids_Total_Calcule;Poids_Total_Vrac;Poids_Total_Vrac_Calcule;Poids_Total_HorsVrac;Poids_Total_HorsVrac_Calcule;Poids_Total_Non_Trie;Poids_Total_Non_Trie_Calcule;Poids_Total_Tremis;Poids_Total_Tremis_Calcule; [...] - "2013;test elevation;1;B;2;1;OTB 20/28.10;278970;01/07/2013 00:00:00;;;01/07/2013 00:00:00;;;00;NA;NA;NA;?;N;-9.0;;;Commentaire sur le trait B-2-1@@@@avec@@saut@@de @@ligne;1000.0;Y;280.0;Y;20.0;Y;700.0;N;-9.0;?;-9.0;?;200.0;Y;180.0;Y;180.0;Y;20.0;Y;0.0;Y;0.0;Y;100.0;Y;100.0;N;50.0;Y;0.0;Y;2.0;N;0.0;Y;100.0;N\n" + - "2013;test elevation;1;A;1;1;OTB 20/28.10;278970;01/07/2013 00:00:00;;;01/07/2013 00:00:00;;;00;NA;NA;NA;?;N;-9.0;;;commentaire trait A-1-1@@Avec @@saut@@de@@ligne@@...;1000.0;Y;180.0;Y;20.0;Y;800.0;N;-9.0;?;-9.0;?;200.0;Y;180.0;Y;180.0;Y;20.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y;0.0;Y\n" + - "2013;test elevation;1;C;3;1;;278970;25/09/2013 00:00:00;;;25/09/2013 00:00:00;;;00;NA;NA;NA;?;N;-9.0;;;;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?;-9.0;?"); - - } - - { - // check survey file content - - URL url = new URL(urlPrefix + "survey.csv"); - ServiceDbResource.assertFileContent("survey export:\n", - url, - "Annee;Serie;Serie_Partielle;Navire;Pays;Zone_Etude;Campagne;Id_Sismer;Date_Deb_Campagne;Port_Deb_Campagne;Date_Fin_Campagne;Port_Fin_Campagne;Chef_Mission;Resp_Salle_Tri;Commentaire\n" + - "2013;test elevation;1;278970;FRA;CGFS - Manche Est / Sud Mer du Nord;test elevation_2013_1;;01/07/2013 00:00:00;La Barbotière (Gujan-Mestras);04/07/2013 00:00:00;La Barbotière (Gujan-Mestras);Adrian LEVREL;Alain BISEAU;"); - - } - - { - // check individualObservation file content - - URL url = new URL(urlPrefix + "individualObservation.csv"); - ServiceDbResource.assertFileContent("individualObservation export:\n", - url, - "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;BatchId;ReferenceTaxonId;ReferenceTaxonName;Commentaire;CaracteristicId;CaracteristicValue"); - - } - - { - // check catch file content - - URL url = new URL("jar:" + exportFile.toURI().toURL() + "!/exportCruise-" + CRUISE_ID + "/catch.csv"); - ServiceDbResource.assertFileContent("Catch export:\n", - url, - "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;Code_Taxon;Code_Espece_Campagne;Nom_scientifique;Commentaire;V_HV;Num_Ordre_V_HV_H2;Tot_V_HV;Ech_V_HV;Type_Volume_Poids_V_HV;Unite_Volume_Poids_V_HV;Class_Tri;Num_Ordre_Class_Tri_H2;Tot_Class_Tri;Ech_Class_Tri;Type_Volume_Poids_Class_Tri;Unite_Volume_Poids_Class_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Mat [...] - "2013;test elevation;1;OTB 20/28.10;B;2;1;1938;;Agonus cataphractus;Trait B-2-1 AGONCAT-vrac 80;Vrac;1;80.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;80.0;3.5;3.5\n" + - "2013;test elevation;1;OTB 20/28.10;B;2;1;1358;;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Male 60;Vrac;2;;;Poids;kg;NA;;;;;kg;Mâle;1;60.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;60.0;5.8333335;3.5\n" + - "2013;test elevation;1;OTB 20/28.10;B;2;1;1358;;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Femelle 40.0;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;40.0;8.75;3.5\n" + - "2013;test elevation;1;OTB 20/28.10;B;2;1;1938;;Agonus cataphractus;Trait B-2-1 AGONCAT-horsvrac 20;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;1.0;1.0\n" + - "2013;test elevation;1;OTB 20/28.10;B;2;1;4622;;Abietinaria abietina;Trait B-2-1 Benthos ABIEABI Vrac 30@@@@avec @@@@commentaire...;Vrac;101;30.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;30.0;7.0;7.0\n" + - "2013;test elevation;1;OTB 20/28.10;B;2;1;380;;Acanthocardia echinata;Trait B-2-1 Benthos ACANECH Vrac 18@@@@avec @@@@commentaire...;Vrac;102;18.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;18.0;7.0;7.0\n" + - "2013;test elevation;1;OTB 20/28.10;A;1;1;1938;;Agonus cataphractus;AGONCAT-vrac-80;Vrac;1;80.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;80.0;5.4444447;5.4444447\n" + - "2013;test elevation;1;OTB 20/28.10;A;1;1;1358;;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-male 60;Vrac;2;;;Poids;kg;NA;;;;;kg;Mâle;1;60.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;60.0;9.074075;5.4444447\n" + - "2013;test elevation;1;OTB 20/28.10;A;1;1;1358;;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;5.4444447\n" + - "2013;test elevation;1;OTB 20/28.10;A;1;1;1358;;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;5.4444447\n" + - "2013;test elevation;1;OTB 20/28.10;A;1;1;1938;;Agonus cataphractus;AGONCAT-horsvrac-20;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;1.0;1.0\n" + - "2013;test elevation;1;;C;3;1;11183;;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;UNK - Indéterminé;1;30.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;30.0;0.0;1.0\n" + - "2013;test elevation;1;;C;3;1;11183;;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;Mâle;2;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;0.0;1.0\n" + - "2013;test elevation;1;;C;3;1;11183;;Brissopsis atlantica;|;Vrac;1;;;Poids;kg;NA;;;;;kg;Femelle;3;;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;;1.0;1.0"); - - } - - { - // check gearCaracteristics file content - - URL url = new URL(urlPrefix + "gearCaracteristics.csv"); - ServiceDbResource.assertFileContent("gearCaracteristics export:\n", - url, - "Annee;Serie;Serie_Partielle;Engin;Code_PMFM;Libelle_PMFM;Valeur"); - - } - - { - // check marineLitter file content - - URL url = new URL(urlPrefix + "marineLitter.csv"); - ServiceDbResource.assertFileContent("marineLitter export:\n", - url, - "Annee;Serie;Serie_Partielle;Engin;Code_station;Id_Operation;Poche;MarineLitterCategory;MarineLitterSizeCategory;Number;Weight;Commentaire\n" + - "2013;test elevation;1;OTB 20/28.10;B;2;1;L1 PLASTIQUE;A: <5*5 cm= 25 cm2;10;;Trait B-2-1 Macro dechet L1 Plastique (nb 10)@@@@avec @@@@commentaire..."); - - } - { - // check parameter file content - - URL url = new URL(urlPrefix + "parameter.csv"); - ServiceDbResource.assertFileContent("parameter export:\n", - url, - "Annee;Serie;Serie_Partielle;Code_station;Id_Operation;Poche;Code_PMFM;Libelle_PMFM;Valeur"); - - } - } -} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.