Echobase-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- 1820 discussions
r205 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase/entities echobase-services/src/main/java/fr/ifremer/echobase/services echobase-ui/src/main/env/dev/resources echobase-ui/src/main/env/prod/resources
by tchemit@users.forge.codelutin.com 19 Dec '11
by tchemit@users.forge.codelutin.com 19 Dec '11
19 Dec '11
Author: tchemit
Date: 2011-12-19 22:45:05 +0100 (Mon, 19 Dec 2011)
New Revision: 205
Url: http://forge.codelutin.com/repositories/revision/echobase/205
Log:
improve DbImportService
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java
trunk/echobase-ui/src/main/env/dev/resources/log4j.properties
trunk/echobase-ui/src/main/env/prod/resources/log4j.properties
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-19 19:18:47 UTC (rev 204)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-19 21:45:05 UTC (rev 205)
@@ -175,6 +175,8 @@
result.add(EchoBaseEntityEnum.OperationMetadata);
result.add(EchoBaseEntityEnum.GearMetadata);
result.add(EchoBaseEntityEnum.Gear);
+ result.add(EchoBaseEntityEnum.LengthAgeKey);
+ result.add(EchoBaseEntityEnum.LengthWeightKey);
return result.toArray(new EchoBaseEntityEnum[result.size()]);
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java 2011-12-19 19:18:47 UTC (rev 204)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java 2011-12-19 21:45:05 UTC (rev 205)
@@ -38,6 +38,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.persistence.TopiaDAO;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.util.StringUtil;
@@ -99,10 +100,6 @@
log.warn("There is " + missingEntries.size() + "missing mandatory files " +
" in import " + file + "\n" + StringUtil.join(missingEntries, "\n", false));
}
-
-// throw new EchoBaseTechnicalException(
-// "There is some missing mandatory files " +
-// missingEntries + " in import " + file);
}
return result;
@@ -187,125 +184,120 @@
}
- public <E extends TopiaEntity> void importFile(MetaFilenameAware entry,
- Reader reader,
- CsvImportResult csvResult) throws IOException {
+ public void importFile(MetaFilenameAware entry,
+ Reader reader,
+ CsvImportResult csvResult) throws IOException, TopiaException {
- DbEditorService service = getDbEditorService();
- long s0;
+ long s0 = TimeLog.getTime();
- s0 = TimeLog.getTime();
+ if (log.isInfoEnabled()) {
+ log.info("Will import " + entry);
+ }
if (entry instanceof AssociationMeta) {
// load a association input
+ importAssociationfile((AssociationMeta) entry, reader, csvResult);
- AssociationMeta meta = (AssociationMeta) entry;
+ } else {
- if (log.isInfoEnabled()) {
- log.info("Will import " + meta);
- }
+ // normal entity table import
+ importEntityFile((TableMeta) entry, reader, csvResult);
+ }
- EchoBaseEntityEnum source = meta.getSource();
- EchoBaseEntityEnum target = meta.getTarget();
- timeLog.log(s0, "importFile::getTargetEntities");
-// List<TopiaEntity> targetEntities = getEntities(target);
-// Map<String, TopiaEntity> targetsById =
-// Maps.uniqueIndex(targetEntities, EchoBaseFunctions.TO_TOPIAID);
+ timeLog.log(s0, "importFile::done");
- ImportModel<Map<String, Object>> model =
- EntityAssociationImportModel.newImportModel(
- getConfiguration().getCsvSeparator(),
- meta
- );
+ s0 = TimeLog.getTime();
-// EchoBaseEntityEnum sourceType = meta.getSource();
+ flushTransaction();
- ImportToMap importer = MyImportToMap.newImport(model, reader);
+ timeLog.log(s0, "importFile::flushTransaction");
+ }
- s0 = TimeLog.getTime();
-// List<E> sourceEntities = getEntities(sourceType);
- timeLog.log(s0, "importFile::getSourceEntities");
-// Map<String, E> sourcesById =
-// Maps.uniqueIndex(sourceEntities, EchoBaseFunctions.TO_TOPIAID);
- StringBuilder builder = new StringBuilder();
- try {
- s0 = TimeLog.getTime();
- String updateString = "UPDATE " + target.getContract().getSimpleName() + " SET " + source.getContract().getSimpleName() + " = '%s' WHERE topiaId ='%s';";
- if (log.isInfoEnabled()) {
- log.info("Will apply " + updateString);
- }
- int compt = 0;
- for (Map<String, Object> row : importer) {
- String topiaId = (String) row.get(TopiaEntity.TOPIA_ID);
- String[] associations = (String[]) row.get("target");
- for (String association : associations) {
- builder.append(String.format(updateString, topiaId, association)).append('\n');
- compt++;
- if (compt == 10000) {
- // flush it
- getTransaction().executeSQL(builder.toString());
- builder = new StringBuilder();
- }
- }
- csvResult.incrementsNumberUpdated();
- }
- timeLog.log(s0, "importFile::import");
- } catch (TopiaException eee) {
- throw new EchoBaseTechnicalException(
- "Could not execute sql script", eee);
- } finally {
+ public MetaFilenameAware[] getEntries() {
- importer.close();
- }
+ List<MetaFilenameAware> entities = Lists.newArrayList();
+ List<MetaFilenameAware> associations = Lists.newArrayList();
- } else {
+ addEntries(entities, associations, EntitiesUtil.getReferenceTypesForCopy());
+ addEntries(entities, associations, EntitiesUtil.getDataTypesforCopy());
+ entities.addAll(associations);
+ return entities.toArray(new MetaFilenameAware[entities.size()]);
+ }
- // normal entity table import
+ protected void importEntityFile(TableMeta meta, Reader reader, CsvImportResult csvResult) {
- TableMeta meta = (TableMeta) entry;
+ ImportModel<TopiaEntity> model = getDbEditorService().buildForImport(meta);
- if (log.isInfoEnabled()) {
- log.info("Will import " + meta);
- }
+ Import<TopiaEntity> importer = Import.newImport(model, reader);
- ImportModel<TopiaEntity> model = service.buildForImport(meta);
+ try {
+ TopiaDAO<TopiaEntity> dao = getDAO(meta.getSource());
+ for (TopiaEntity entity : importer) {
- Import<TopiaEntity> importer = Import.newImport(model, reader);
+ TopiaEntity entityToSave = dao.create(TopiaEntity.TOPIA_ID,
+ entity.getTopiaId());
- try {
- TopiaDAO<TopiaEntity> dao = getDAO(meta.getSource());
- s0 = TimeLog.getTime();
- for (TopiaEntity entity : importer) {
+ meta.copy(entity, entityToSave);
- TopiaEntity entityToSave = dao.create(TopiaEntity.TOPIA_ID,
- entity.getTopiaId());
+ csvResult.incrementsNumberUpdated();
+ }
- meta.copy(entity, entityToSave);
+ } catch (Exception eee) {
+ throw new EchoBaseTechnicalException("Could not import entities of type " + meta.getSource(), eee);
+ } finally {
- csvResult.incrementsNumberUpdated();
- }
- timeLog.log(s0, "importFile::import");
- } catch (Exception eee) {
- throw new EchoBaseTechnicalException("Could not import entities of type " + meta.getSource(), eee);
- } finally {
-
- importer.close();
- }
+ importer.close();
}
}
- public MetaFilenameAware[] getEntries() {
+ protected void flushTransaction() throws TopiaException {
+ TopiaContextImplementor tx = (TopiaContextImplementor) getTransaction();
+ tx.getHibernate().flush();
+ }
- List<MetaFilenameAware> entities = Lists.newArrayList();
- List<MetaFilenameAware> associations = Lists.newArrayList();
+ protected void importAssociationfile(AssociationMeta meta, Reader reader, CsvImportResult csvResult) {
+ EchoBaseEntityEnum source = meta.getSource();
+ EchoBaseEntityEnum target = meta.getTarget();
- addEntries(entities, associations, EntitiesUtil.getReferenceTypesForCopy());
- addEntries(entities, associations, EntitiesUtil.getDataTypesforCopy());
- entities.addAll(associations);
- return entities.toArray(new MetaFilenameAware[entities.size()]);
+ ImportModel<Map<String, Object>> model =
+ EntityAssociationImportModel.newImportModel(
+ getConfiguration().getCsvSeparator(),
+ meta
+ );
+
+ ImportToMap importer = MyImportToMap.newImport(model, reader);
+
+ StringBuilder builder = new StringBuilder();
+ try {
+ String updateString = "UPDATE " + target.getContract().getSimpleName() + " SET " + source.getContract().getSimpleName() + " = '%s' WHERE topiaId ='%s';";
+ if (log.isDebugEnabled()) {
+ log.debug("Will apply " + updateString);
+ }
+ int compt = 0;
+ for (Map<String, Object> row : importer) {
+ String topiaId = (String) row.get(TopiaEntity.TOPIA_ID);
+ String[] associations = (String[]) row.get("target");
+ for (String association : associations) {
+ builder.append(String.format(updateString, topiaId, association)).append('\n');
+ compt++;
+ if (compt == 10000) {
+ // flush it
+ getTransaction().executeSQL(builder.toString());
+ builder = new StringBuilder();
+ }
+ }
+ csvResult.incrementsNumberUpdated();
+ }
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException(
+ "Could not execute sql script", eee);
+ } finally {
+
+ importer.close();
+ }
}
protected TableMeta getTableMeta(EchoBaseEntityEnum tableName) {
Modified: trunk/echobase-ui/src/main/env/dev/resources/log4j.properties
===================================================================
--- trunk/echobase-ui/src/main/env/dev/resources/log4j.properties 2011-12-19 19:18:47 UTC (rev 204)
+++ trunk/echobase-ui/src/main/env/dev/resources/log4j.properties 2011-12-19 21:45:05 UTC (rev 205)
@@ -34,3 +34,4 @@
log4j.logger.org.nuiton=WARN
log4j.logger.org.nuiton.topia.migration=INFO
log4j.logger.com.opensymphony.xwork2.util.logging.commons.CommonsLogger=ERROR
+log4j.logger.org.apache.struts2.util.TokenHelper=ERROR
Modified: trunk/echobase-ui/src/main/env/prod/resources/log4j.properties
===================================================================
--- trunk/echobase-ui/src/main/env/prod/resources/log4j.properties 2011-12-19 19:18:47 UTC (rev 204)
+++ trunk/echobase-ui/src/main/env/prod/resources/log4j.properties 2011-12-19 21:45:05 UTC (rev 205)
@@ -32,3 +32,4 @@
log4j.logger.fr.ifremer.echobase=INFO
log4j.logger.org.nuiton.topia.migration=INFO
log4j.logger.com.opensymphony.xwork2.util.logging.commons.CommonsLogger=ERROR
+log4j.logger.org.apache.struts2.util.TokenHelper=ERROR
1
0
Author: tchemit
Date: 2011-12-19 20:18:47 +0100 (Mon, 19 Dec 2011)
New Revision: 204
Url: http://forge.codelutin.com/repositories/revision/echobase/204
Log:
update reunion CR
Modified:
trunk/src/doc/reunions/reunion-2011-12-19.txt
Modified: trunk/src/doc/reunions/reunion-2011-12-19.txt
===================================================================
--- trunk/src/doc/reunions/reunion-2011-12-19.txt 2011-12-19 19:16:34 UTC (rev 203)
+++ trunk/src/doc/reunions/reunion-2011-12-19.txt 2011-12-19 19:18:47 UTC (rev 204)
@@ -9,39 +9,55 @@
--------
- Revoir quelques points sur le modèle
+- Discuter de l'import des nouvelles campagnes
Modèle pêche
------------
-- SpeciesCategory ?
-- Sample est lié à SpeciesCategory et Species ?
-- LengthAgeKey ?
-- WeightLengthKey ?
-- BiometryScale ?
+SizeCategory et SexCategory sont inversés.
-Import nouvelles données
-------------------------
+- SpeciesCategory On remplit la table lors de l'insertion des Samples
-- Planning ?
+ - pour Unsorted : on utilise le code 0 de la taille (SizeCategory)?
+ - pour le Total et Subsample : le code taille (SizeCategory) = CATEG
+ - pour individual : juste Species renseignés dans SpeciesCategory.
-Réalisation modèle pêche
+- Sample est lié à SpeciesCategory et Species ? Non on supprime le lien vers Species.
+
+- LengthAgeKey ? Remplir à partir de CLE_TAILLE_AGE
+
+- LengthWeightKey ? et pas WeightLengthKey... A remplir depuis TAILLE_POIDS
+
+ quand categorie = NA ou H alors utiliser 0
+
+ Enregistrer à nulle le numberSampled si pas de données (pas de 0)
+
+Supprimer entité BiometryScale
+
+Trouver comment mettre sur une même ligne toutes les SampleData d'un même Sample.
+
+TODO Voir comment corriger les problèmes d'encoding dans Libre-Office.
+
+- Faire un export globale de la base sur le même format que l'import de la base complête
+- Lors d'un ré-import, ne pas écraser le référentiel
+- Proposer à l'utilisateur le mode d'import : écraser ou pas les données.
+
+- Modifier Se connecter à la base : sur demo l'url est jdbc:postgresql://localhost/echobase localhost
+
+autoriser cette ip 134.246.53.25 sur le pg de demo
+
+- Ajouter une utiliser lecture seule sur la base.
+
+Réflechir sur comment effecuter les nouveaux import.
+
+Import nouvelles données
------------------------
-- Report des modifications du modèle
-- Remplissage du référentiel OperationEvent
-- Remplissage du référentiel SampleDataType
-- Remplissage du référentiel SampleType
-- Création entité BiometryScale
-- Remplissage du référentiel BiometryScale
-- Remplissage du référentiel SexCategory
-- Remplissage du référentiel SizeCategory
-- Remplissage du référentiel OperationMetadata
-- Remplissage du référentiel GearMetadata
-- Remplissage du référentiel Gear
+- On commnce ça début janvier
+- On se base sur le système déjà existant utilisé pour l'import d'une
+ base complête, sauf pour les clef étrangère et les associations où on utilise
+ non plus les identifiants techniques (topiaId) mais des clefs métiers.
-- Import des opérations (depuis table STATIONS)
-- Import des samples (depuis table CAPTURES/MENSURATIONS/BIOMETRIE_VALEURS)
-
Action
------
@@ -55,4 +71,4 @@
Prochaine réunion :
- - Lundi 19 à 10h00 à l'Ifremer avec Mathieu
\ No newline at end of file
+ - Mercredi 4 janvier 10h00 à l'Ifremer avec Mathieu
\ No newline at end of file
1
0
r203 - in trunk/echobase-tools: . src/main/java/fr/ifremer/echobase/tools/loaders src/test/java/fr/ifremer/echobase/tools/loaders src/test/resources/csv/new
by tchemit@users.forge.codelutin.com 19 Dec '11
by tchemit@users.forge.codelutin.com 19 Dec '11
19 Dec '11
Author: tchemit
Date: 2011-12-19 20:16:34 +0100 (Mon, 19 Dec 2011)
New Revision: 203
Url: http://forge.codelutin.com/repositories/revision/echobase/203
Log:
continue catches import
Added:
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoaderIT.java
Removed:
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java
trunk/echobase-tools/src/test/resources/csv/new/input-BiometryScale.csv
Modified:
trunk/echobase-tools/pom.xml
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java
trunk/echobase-tools/src/test/resources/csv/new/input-SexCategory.csv
trunk/echobase-tools/src/test/resources/csv/new/input-SizeCategory.csv
Modified: trunk/echobase-tools/pom.xml
===================================================================
--- trunk/echobase-tools/pom.xml 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/pom.xml 2011-12-19 19:16:34 UTC (rev 203)
@@ -65,7 +65,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
-
+
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
@@ -213,7 +213,7 @@
<testResource>
<directory>src/test/resources</directory>
<includes>
- <include>**/*.properties</include>
+ <include>**/*.*</include>
</includes>
</testResource>
</testResources>
Deleted: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -1,67 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.EchoBaseFunctions;
-import fr.ifremer.echobase.entities.meta.TableMeta;
-import fr.ifremer.echobase.entities.references.BiometryScale;
-import fr.ifremer.echobase.entities.references.SampleDataType;
-import fr.ifremer.echobase.services.models.EntityCsvModel;
-import fr.ifremer.echobase.tools.FileType;
-
-import java.util.List;
-
-/**
- * {@link BiometryScale} loader.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class BiometryScaleLoader extends EntityLoader<BiometryScale> {
-
- public BiometryScaleLoader() {
- super(BiometryScale.class, FileType.NEW);
- }
-
- @Override
- protected EntityCsvModel<BiometryScale> createCsvImportModel(TableMeta meta) {
-
- List<SampleDataType> sampleDataTypes =
- getEntities(SampleDataType.class);
-
- EntityCsvModel<BiometryScale> model = EntityCsvModel.newModel(
- getCsvSeparator(),
- meta
- );
-
- /*
- raptriBiometryDataType;ScaleCode;ScaleMeaningEng;ScaleMeaningFr
- */
- model.addForeignKeyForImport("raptriBiometryDataType", BiometryScale.PROPERTY_SAMPLE_DATA_TYPE, SampleDataType.class, sampleDataTypes, EchoBaseFunctions.SAMPLE_DATA_TYPE_RAPTRI_CODE);
- model.addDefaultColumn("ScaleCode",BiometryScale.PROPERTY_CODE, int.class);
- model.newMandatoryColumn("ScaleMeaningEng",BiometryScale.PROPERTY_MEANING_EN);
- model.newMandatoryColumn("ScaleMeaningFr",BiometryScale.PROPERTY_MEANING_FR);
- return model;
- }
-}
\ No newline at end of file
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoader.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -0,0 +1,102 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import com.google.common.collect.Lists;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.LengthAgeKey;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.tools.FileType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * {@link LengthAgeKey} loader.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class LengthAgeKeyLoader extends EntityLoader<LengthAgeKey> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(LengthAgeKeyLoader.class);
+
+ public LengthAgeKeyLoader() {
+ super(LengthAgeKey.class, EchoBaseEntityEnum.Voyage,
+ Voyage.PROPERTY_LENGTH_AGE_KEY,
+ FileType.BARACOUDA);
+ }
+
+ @Override
+ protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
+
+ Map<String, Voyage> voyagesByName = getUniverse(
+ Voyage.class, EchoBaseFunctions.VOYAGE_NAME);
+
+ Map<String, Species> speciesByName = getUniverse(
+ Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
+
+ TopiaDAO<LengthAgeKey> dao = getDAO();
+
+ List<LengthAgeKey> lengthAgeKeys = Lists.newArrayList();
+
+ for (Map<String, Object> row : db.getTable("CLE_TAILLE_AGE")) {
+
+ String voyageName = (String) row.get("CAMPAGNE");
+ Voyage voyage = getFK(voyagesByName, voyageName);
+
+ String speciesCode = (String) row.get("GENRE_ESP");
+ Species species = getFK(speciesByName, speciesCode);
+
+ Integer age = Integer.valueOf(row.get("AGE").toString());
+ Float length = (Float) row.get("TAILLE");
+ Float percentAtAge = (Float) row.get("POURCENTAGE");
+ String metadata = (String) row.get("Origine_Data");
+
+ LengthAgeKey lengthAgeKey = dao.create(
+ LengthAgeKey.PROPERTY_SPECIES, species,
+ LengthAgeKey.PROPERTY_LENGTH, length,
+ LengthAgeKey.PROPERTY_AGE, age,
+ LengthAgeKey.PROPERTY_PERCENT_AT_AGE, percentAtAge,
+ LengthAgeKey.PROPERTY_METADATA, metadata
+ );
+ lengthAgeKeys.add(lengthAgeKey);
+ voyage.addLengthAgeKey(lengthAgeKey);
+ }
+ if (log.isInfoEnabled()) {
+ log.info("Found " + lengthAgeKeys.size() + " lengthAgeKey(s).");
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoader.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -0,0 +1,130 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import com.google.common.collect.Lists;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import fr.ifremer.echobase.tools.FileType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * {@link LengthWeightKey} loader.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class LengthWeightKeyLoader extends EntityLoader<LengthWeightKey> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(LengthWeightKeyLoader.class);
+
+ public LengthWeightKeyLoader() {
+ super(LengthWeightKey.class, EchoBaseEntityEnum.Voyage,
+ Voyage.PROPERTY_LENGTH_WEIGHT_KEY,
+ FileType.BARACOUDA);
+ }
+
+ @Override
+ protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
+
+ Map<String, Voyage> voyagesByName = getUniverse(
+ Voyage.class, EchoBaseFunctions.VOYAGE_NAME);
+
+ Map<String, Species> speciesByName = getUniverse(
+ Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
+
+ Map<String, SizeCategory> sizeCategoryByName = getUniverse(
+ SizeCategory.class, EchoBaseFunctions.SIZE_CATEGORY_NAME);
+
+ Map<String, SpeciesCategory> speciesCategoryBySizeAndName = getUniverse(
+ SpeciesCategory.class, EchoBaseFunctions.SPECIES_CATEGORY_SPIECIES);
+
+ TopiaDAO<LengthWeightKey> dao = getDAO();
+
+ List<LengthWeightKey> lengthWeightKeys = Lists.newArrayList();
+
+ for (Map<String, Object> row : db.getTable("TAILLE_POIDS")) {
+
+ String voyageName = (String) row.get("Campagne");
+ Voyage voyage = getFK(voyagesByName, voyageName);
+
+ String speciesCode = (String) row.get("Genre_esp");
+ Species species = getFK(speciesByName, speciesCode);
+
+ String sizeCode = (String) row.get("Categorie");
+ if ("NA".equals(sizeCode) || "H".equals(sizeCode)) {
+ sizeCode = "0";
+ }
+
+ SizeCategory sizeCategory = getFK(sizeCategoryByName, sizeCode);
+ SpeciesCategory speciesCategory = getSpeciesCategory(
+ species,
+ sizeCategory,
+ speciesCategoryBySizeAndName);
+
+ Float aParameter = (Float) row.get("Coeff_A_RTP");
+ Float bParameter = (Float) row.get("Exposant_N_RTP");
+ String metadata = (String) row.get("Origine_DATA");
+
+ LengthWeightKey lengthWeightKey = dao.create(
+ LengthWeightKey.PROPERTY_SPECIES_CATEGORY, speciesCategory,
+ LengthWeightKey.PROPERTY_APARAMETER, aParameter,
+ LengthWeightKey.PROPERTY_BPARAMETER, bParameter,
+ LengthWeightKey.PROPERTY_METADATA, metadata
+ );
+ voyage.addLengthWeightKey(lengthWeightKey);
+ lengthWeightKeys.add(lengthWeightKey);
+ }
+ if (log.isInfoEnabled()) {
+ log.info("Found " + lengthWeightKeys.size() + " lengthWeightKey(s).");
+ }
+ }
+
+ protected SpeciesCategory getSpeciesCategory(Species species,
+ SizeCategory sizeCategory,
+ Map<String, SpeciesCategory> speciesCategoryByName) throws TopiaException {
+
+ String speciesCategoryKey = EchoBaseFunctions.getSpeciesCategoryKey(species, sizeCategory, null);
+
+ // get species category to use
+ SpeciesCategory speciesCategory = getFK(speciesCategoryByName, speciesCategoryKey);
+ return speciesCategory;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -299,17 +299,9 @@
Float midHauleLatitude = (Float) row.get("LATDD");
Preconditions.checkNotNull(midHauleLatitude);
-// if (midHauleLatitude == null) {
-// messages.add("No midHauleLatitude");
-// midHauleLatitude = 0f;
-// }
Float midHauleLongitude = (Float) row.get("LGDD");
Preconditions.checkNotNull(midHauleLongitude);
-// if (midHauleLongitude== null) {
-// messages.add("No midHauleLongitude");
-// midHauleLongitude = 0f;
-// }
Date shootingStartTime = (Date) row.get("DHTUDEB");
Date shootingEndTime = (Date) row.get("DHTUFIN");
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -24,6 +24,7 @@
package fr.ifremer.echobase.tools.loaders;
import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import com.google.common.collect.Sets;
@@ -38,16 +39,22 @@
import fr.ifremer.echobase.entities.references.SampleDataType;
import fr.ifremer.echobase.entities.references.SampleType;
import fr.ifremer.echobase.entities.references.SampleTypeDAO;
+import fr.ifremer.echobase.entities.references.SexCategory;
+import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
import fr.ifremer.echobase.tools.FileType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.persistence.TopiaDAO;
+import org.nuiton.util.StringUtil;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -103,7 +110,15 @@
copyAndLoadEntities(outputDir, meta.getAssociations(Sample.PROPERTY_SAMPLE_DATA), false, FileType.ASSOCIATION);
}
+ protected SampleDataDAO sampleDataDAO;
+ protected SpeciesCategoryDAO speciesCategoryDAO;
+ protected TopiaDAO<Sample> dao;
+
+ protected Map<String, SizeCategory> sizeCategoryByName;
+ protected Map<String, SexCategory> sexCategoryByName;
+ protected Map<String, SpeciesCategory> speciesCategoryByName;
+
@Override
protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
@@ -116,6 +131,15 @@
Map<String, SampleDataType> sampleDataTypeByRaptriCode = getUniverse(
SampleDataType.class, EchoBaseFunctions.SAMPLE_DATA_TYPE_RAPTRI_CODE);
+ sizeCategoryByName = getUniverse(
+ SizeCategory.class, EchoBaseFunctions.SIZE_CATEGORY_NAME);
+
+ sexCategoryByName = getUniverse(
+ SexCategory.class, EchoBaseFunctions.SEX_CATEGORY_NAME);
+
+ speciesCategoryByName = getUniverse(
+ SpeciesCategory.class, EchoBaseFunctions.SPECIES_CATEGORY_SPIECIES);
+
Multimap<String, Map<String, Object>> mensurationByNosta = Multimaps.index(
db.getTable("MENSURATIONS", true),
EchoBaseFunctions.newRowFunction("NOSTA")
@@ -147,37 +171,36 @@
SampleType sampleTypeIndividual = sampleTypeDAO.findByName("Individual");
Preconditions.checkNotNull(sampleTypeIndividual);
-// SampleDataTypeDAO sampleDataTypeDAO =
-// (SampleDataTypeDAO) getDAO(SampleDataType.class);
+ sampleDataDAO = (SampleDataDAO) getDAO(SampleData.class);
- SampleDataDAO sampleDataDAO = (SampleDataDAO) getDAO(SampleData.class);
-
-// SampleDataType sampleDataTypeMeanLength = sampleDataTypeDAO.findByName("MeanLengthcm");
+ //MeanLengthcm
SampleDataType sampleDataTypeMeanLength = getFK(sampleDataTypeByRaptriCode, "114");
-// SampleDataType sampleDataTypeMeanWeight = sampleDataTypeDAO.findByName("MeanWeightg");
+ //MeanWeightg
SampleDataType sampleDataTypeMeanWeight = getFK(sampleDataTypeByRaptriCode, "115");
-
-// SampleDataType sampleDataTypeNoPerKg = sampleDataTypeDAO.findByName("NoPerKg");
+ //NoPerKg
SampleDataType sampleDataTypeNoPerKg = getFK(sampleDataTypeByRaptriCode, "116");
-// SampleDataType sampleDataTypeNumberAtLength = sampleDataTypeDAO.findByName("NumberAtLength");
+ //NumberAtLength
SampleDataType sampleDataTypeNumberAtLength = getFK(sampleDataTypeByRaptriCode, "112");
-// SampleDataType sampleDataTypeWeightAtLength = sampleDataTypeDAO.findByName("WeightAtLengthkg");
+ //WeightAtLengthkg
SampleDataType sampleDataTypeWeightAtLength = getFK(sampleDataTypeByRaptriCode, "113");
- TopiaDAO<Sample> dao = getDAO();
-
+ dao = getDAO();
+ speciesCategoryDAO = (SpeciesCategoryDAO) getDAO(SpeciesCategory.class);
int nbSampleUnsorted = 0;
int nbSampleTotal = 0;
int nbSubSample = 0;
int nbIndividualSample = 0;
+ List<String> operationNotFound = Lists.newArrayList();
+ List<String> ntotNull = Lists.newArrayList();
+ List<String> pmensNull = Lists.newArrayList();
+ List<String> valeurBiometryNull = Lists.newArrayList();
+
for (String operationId : capturesByNosta.keySet()) {
Preconditions.checkNotNull(operationId);
Operation operation = operationById.get(operationId);
if (operation == null) {
- if (log.isWarnEnabled()) {
- log.warn("Operation " + operationId + " not found...");
- }
+ operationNotFound.add(operationId);
continue;
}
Collection<Map<String, Object>> biometryValues =
@@ -187,33 +210,53 @@
biometryValues,
EchoBaseFunctions.newRowFunction("GENRE_ESP_VALEUR_BIOMETRIE")
);
+
+ SpeciesCategory speciesCategory;
+ SpeciesCategory speciesCategoryForSpecies;
+
for (Map<String, Object> row : capturesByNosta.get(operationId)) {
String type = (String) row.get("CATEG");
SampleType sampleType;
+ String speciesId = (String) row.get("GENRE_ESP");
+ Species species = getFK(speciesByName, speciesId);
+
if ("H".equals(type)) {
+
+ speciesCategory = getSpeciesCategory(species, "0", null);
+ speciesCategoryForSpecies = getSpeciesCategory(species, null, null);
sampleType = sampleTypeUnsorted;
nbSampleUnsorted++;
} else {
sampleType = sampleTypeTotal;
+
+ if ("F".equals(type) || "M".equals(type)) {
+
+ speciesCategory = getSpeciesCategory(
+ species,
+ null,
+ type);
+ } else {
+
+ speciesCategory = getSpeciesCategory(
+ species,
+ type,
+ null);
+ }
+
+ speciesCategoryForSpecies = getSpeciesCategory(species, null, null);
nbSampleTotal++;
}
- String speciesId = (String) row.get("GENRE_ESP");
- Species species = getFK(speciesByName, speciesId);
-
Integer number = (Integer) row.get("NTOT");
if (number == null) {
- if (log.isWarnEnabled()) {
- log.warn("NTOT is null for operation " + operationId + "/" + speciesId);
- }
- number = 0;
+ ntotNull.add(operationId + "/" + speciesId);
}
Float weight = (Float) row.get("PT_ESP");
Sample sample = dao.create(
- Sample.PROPERTY_SPECIES, species,
+ Sample.PROPERTY_SPECIES_CATEGORY, speciesCategory,
Sample.PROPERTY_SAMPLE_TYPE, sampleType,
Sample.PROPERTY_NUMBER_SAMPLED, number,
Sample.PROPERTY_SAMPLE_WEIGHT, weight
@@ -221,20 +264,17 @@
operation.addSample(sample);
- addSampleData(sampleDataDAO,
- sample,
+ addSampleData(sample,
sampleDataTypeMeanWeight,
"NA",
row.get("PMOY"));
- addSampleData(sampleDataDAO,
- sample,
+ addSampleData(sample,
sampleDataTypeMeanLength,
"NA",
row.get("LMOY"));
- addSampleData(sampleDataDAO,
- sample,
+ addSampleData(sample,
sampleDataTypeNoPerKg,
"NA",
row.get("MOULE_MENS"));
@@ -244,20 +284,15 @@
Float sampleWeight = (Float) row.get("PESP_MENS");
if (sampleWeight == null) {
- if (log.isWarnEnabled()) {
- log.warn("PESP_MENS is null for operation " + operationId + "/" + speciesId);
- }
- sampleWeight = 0f;
+ pmensNull.add(operationId + "/" + speciesId);
}
- addSubSamples(dao,
- sampleDataDAO,
+ addSubSamples(speciesCategory,
sampleTypeSubsample,
sampleDataTypeNumberAtLength,
sampleDataTypeWeightAtLength,
operation,
type,
- species,
sampleWeight,
mensurationRows);
@@ -267,19 +302,39 @@
Collection<Map<String, Object>> biometryValuesRows =
biometryValuesBySpecies.get(speciesId);
- int nbSampleIndiv = addSampleIndividuals(dao,
- sampleDataDAO,
- operation,
- species,
+ int nbSampleIndiv = addSampleIndividuals(operation,
+ speciesCategoryForSpecies,
sampleTypeIndividual,
sampleDataTypeByRaptriCode,
biometryScalesByRaptri,
- biometryValuesRows);
+ biometryValuesRows,
+ valeurBiometryNull);
nbIndividualSample += nbSampleIndiv;
}
}
+ if (!operationNotFound.isEmpty()) {
+ if (log.isWarnEnabled()) {
+ log.warn("operation not found : \n" + StringUtil.join(operationNotFound, "\n", false));
+ }
+ }
+
+ if (!ntotNull.isEmpty()) {
+ if (log.isWarnEnabled()) {
+ log.warn("NTOT is null for operation :\n" + StringUtil.join(ntotNull, "\n", false));
+ }
+ }
+ if (!pmensNull.isEmpty()) {
+ if (log.isWarnEnabled()) {
+ log.warn("PESP_MENS is null for operation\n" + StringUtil.join(pmensNull, "\n", false));
+ }
+ }
+ if (!valeurBiometryNull.isEmpty()) {
+ if (log.isWarnEnabled()) {
+ log.warn("Null value of VALEUR_BIOMETRIE for operationId/Species/Individu/Code param\n" + StringUtil.join(valeurBiometryNull, "\n", false));
+ }
+ }
if (log.isInfoEnabled()) {
log.info("Found " + nbSampleTotal + " 'total' sample(s).");
log.info("Found " + nbSampleUnsorted + " 'unsorted' sample(s).");
@@ -289,29 +344,78 @@
}
}
- private int addSampleIndividuals(TopiaDAO<Sample> dao,
- SampleDataDAO sampleDataDAO,
- Operation operation,
- Species species,
+ private void addSubSamples(SpeciesCategory speciesCategory,
+ SampleType sampleTypeSubsample,
+ SampleDataType sampleDataTypeNumberAtLength,
+ SampleDataType sampleDataTypeWeightAtLength,
+ Operation operation,
+ String type,
+ Float sampleWeight,
+ Collection<Map<String, Object>> mesnurationRows) throws TopiaException {
+
+ String speciesId = speciesCategory.getSpecies().getBaracoudaCode();
+
+ for (Map<String, Object> row : mesnurationRows) {
+ String categ = (String) row.get("CATEG");
+ if (!type.equals(categ)) {
+
+ // not good category
+ continue;
+ }
+ String rowSpeciesId = (String) row.get("GENRE_ESP");
+ if (!speciesId.equals(rowSpeciesId)) {
+
+ // not good species
+ continue;
+ }
+
+ // ok found a good row
+ Sample subsample = dao.create(
+ Sample.PROPERTY_SPECIES_CATEGORY, speciesCategory,
+ Sample.PROPERTY_SAMPLE_TYPE, sampleTypeSubsample,
+ Sample.PROPERTY_SAMPLE_WEIGHT, sampleWeight
+ );
+
+ Object lengthClass = row.get("TAILLE");
+
+ addSampleData(subsample,
+ sampleDataTypeNumberAtLength,
+ lengthClass,
+ row.get("NBIND")
+ );
+
+ addSampleData(subsample,
+ sampleDataTypeWeightAtLength,
+ lengthClass,
+ row.get("POIDSTAILLE")
+ );
+
+ operation.addSample(subsample);
+
+ }
+ }
+
+ private int addSampleIndividuals(Operation operation,
+ SpeciesCategory speciesCategory,
SampleType sampleTypeIndividual,
Map<String, SampleDataType> sampleDataTypeByRaptriCode,
Multimap<Integer, Map<String, Object>> biometryScalesByRaptri,
- Collection<Map<String, Object>> biometryValuesRows) throws TopiaException {
+ Collection<Map<String, Object>> biometryValuesRows,
+ List<String> valeurBiometryNull) throws TopiaException {
int result = 0;
Sample sample = null;
Set<Integer> individus = Sets.newHashSet();
+ String speciesId = speciesCategory.getSpecies().getBaracoudaCode();
for (Map<String, Object> biometryValuesRow : biometryValuesRows) {
Integer ind = Integer.valueOf(biometryValuesRow.get("NUMIND_VALEUR_BIOMETRIE").toString());
Integer codeParameter = (Integer) biometryValuesRow.get("CODE_PARAM_VALEUR_BIOMETRIE");
String label = null;
Float value = (Float) biometryValuesRow.get("VALEUR_BIOMETRIE");
- if (value==null) {
- if (log.isWarnEnabled()) {
- log.warn("Null value of VALEUR_BIOMETRIE for operationId/Species/Individu/Code param " + operation.getId() + "/" + species.getBaracoudaCode() + "/" + ind+"/"+codeParameter);
- }
+ if (value == null) {
+ valeurBiometryNull.add(operation.getId() + "/" + speciesId + "/" + ind + "/" + codeParameter);
continue;
}
- Preconditions.checkNotNull(value, "Null value of VALEUR_BIOMETRIE for operationId/Species/Individu/Code param " + operation.getId() + "/" + species.getBaracoudaCode() + "/" + ind+"/"+codeParameter);
+ Preconditions.checkNotNull(value, "Null value of VALEUR_BIOMETRIE for operationId/Species/Individu/Code param " + operation.getId() + "/" + speciesId + "/" + ind + "/" + codeParameter);
SampleDataType sampleDataType = getFK(sampleDataTypeByRaptriCode, String.valueOf(codeParameter));
boolean add = individus.add(ind);
@@ -319,7 +423,7 @@
// new sample
sample = dao.create(
- Sample.PROPERTY_SPECIES, species,
+ Sample.PROPERTY_SPECIES_CATEGORY, speciesCategory,
Sample.PROPERTY_SAMPLE_TYPE, sampleTypeIndividual
);
@@ -348,8 +452,7 @@
}
}
}
- addSampleData(sampleDataDAO,
- sample,
+ addSampleData(sample,
sampleDataType,
label,
value
@@ -358,65 +461,7 @@
return result;
}
- private void addSubSamples(TopiaDAO<Sample> dao,
- SampleDataDAO sampleDataDAO,
- SampleType sampleTypeSubsample,
- SampleDataType sampleDataTypeNumberAtLength,
- SampleDataType sampleDataTypeWeightAtLength,
- Operation operation,
- String type,
- Species species,
- Float sampleWeight,
- Collection<Map<String, Object>> mesnurationRows) throws TopiaException {
-
- String speciesId = species.getBaracoudaCode();
-
- for (Map<String, Object> row : mesnurationRows) {
- String categ = (String) row.get("CATEG");
- if (!type.equals(categ)) {
-
- // not good category
- continue;
- }
- String rowSpeciesId = (String) row.get("GENRE_ESP");
- if (!speciesId.equals(rowSpeciesId)) {
-
- // not good species
- continue;
- }
-
- // ok found a good row
- Sample subsample = dao.create(
- Sample.PROPERTY_SPECIES, species,
- Sample.PROPERTY_SAMPLE_TYPE, sampleTypeSubsample,
- Sample.PROPERTY_SAMPLE_WEIGHT, sampleWeight
- );
-
- Object lengthClass = row.get("TAILLE");
-
- addSampleData(sampleDataDAO,
- subsample,
- sampleDataTypeNumberAtLength,
- lengthClass,
- row.get("NBIND")
- );
-
- addSampleData(sampleDataDAO,
- subsample,
- sampleDataTypeWeightAtLength,
- lengthClass,
- row.get("POIDSTAILLE")
- );
-
-
- operation.addSample(subsample);
-
- }
- }
-
-
- protected void addSampleData(TopiaDAO<SampleData> dao,
- Sample operation,
+ protected void addSampleData(Sample operation,
SampleDataType sampleDataType,
Object label,
Object value
@@ -426,7 +471,7 @@
return;
}
- SampleData sampleData = dao.create(
+ SampleData sampleData = sampleDataDAO.create(
SampleData.PROPERTY_SAMPLE_DATA_TYPE, sampleDataType,
SampleData.PROPERTY_DATA_LABEL, label.toString(),
SampleData.PROPERTY_DATA_VALUE, Float.valueOf(value.toString())
@@ -434,5 +479,23 @@
operation.addSampleData(sampleData);
}
+ protected SpeciesCategory getSpeciesCategory(Species species,
+ String sizeName,
+ String sexName) throws TopiaException {
+ SexCategory sexCategory = null;
+ if (sexName != null) {
+ sexCategory = getFK(sexCategoryByName, sexName);
+ }
+
+ SizeCategory sizeCategory = null;
+ if (sizeName != null) {
+ sizeCategory = getFK(sizeCategoryByName, sizeName);
+ }
+ String speciesCategoryKey = EchoBaseFunctions.getSpeciesCategoryKey(species, sizeCategory, sexCategory);
+
+ // get species category to use
+ SpeciesCategory speciesCategory = getFK(speciesCategoryByName, speciesCategoryKey);
+ return speciesCategory;
+ }
}
\ No newline at end of file
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -23,11 +23,24 @@
*/
package fr.ifremer.echobase.tools.loaders;
-import fr.ifremer.echobase.entities.meta.TableMeta;
+import com.google.common.collect.Lists;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
+import fr.ifremer.echobase.entities.references.SexCategory;
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import fr.ifremer.echobase.entities.references.Species;
import fr.ifremer.echobase.entities.references.SpeciesCategory;
-import fr.ifremer.echobase.services.models.EntityCsvModel;
+import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
import fr.ifremer.echobase.tools.FileType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
/**
* To load {@link SpeciesCategory} entities.
*
@@ -36,23 +49,148 @@
*/
public class SpeciesCategoryLoader extends EntityLoader<SpeciesCategory> {
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(SpeciesCategoryLoader.class);
+
public SpeciesCategoryLoader() {
- super(SpeciesCategory.class, FileType.NEW);
+ super(SpeciesCategory.class, FileType.BARACOUDA);
}
-
@Override
- protected EntityCsvModel<SpeciesCategory> createCsvImportModel(TableMeta meta) {
+ protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
- EntityCsvModel<SpeciesCategory> model = EntityCsvModel.newModel(
- getCsvSeparator(),
- meta
+ Map<String, Species> speciesByName = getUniverse(
+ Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
+
+ Map<String, SizeCategory> sizeCategoryByName = getUniverse(
+ SizeCategory.class, EchoBaseFunctions.SIZE_CATEGORY_NAME);
+
+ Map<String, SexCategory> sexCategoryByName = getUniverse(
+ SexCategory.class, EchoBaseFunctions.SEX_CATEGORY_NAME);
+
+ SpeciesCategoryDAO speciesCategoryDAO =
+ (SpeciesCategoryDAO) getDAO(SpeciesCategory.class);
+
+ List<LengthWeightKey> lengthWeightKeys = Lists.newArrayList();
+
+ for (Map<String, Object> row : db.getTable("TAILLE_POIDS")) {
+
+ String speciesCode = (String) row.get("Genre_esp");
+ Species species = getFK(speciesByName, speciesCode);
+
+ String sizeCode = (String) row.get("Categorie");
+ if ("NA".equals(sizeCode) || "H".equals(sizeCode)) {
+ sizeCode = "0";
+ }
+
+ SizeCategory sizeCategory = getFK(sizeCategoryByName, sizeCode);
+ getSpeciesCategory(speciesCategoryDAO, species, sizeCategory);
+ }
+
+ for (Map<String, Object> row : db.getTable("CAPTURES")) {
+
+ String speciesCode = (String) row.get("GENRE_ESP");
+ Species species = getFK(speciesByName, speciesCode);
+
+ String sizeCode = (String) row.get("CATEG");
+ if ("H".equals(sizeCode)) {
+ sizeCode = "0";
+ }
+
+ if ("F".equals(sizeCode) || "M".equals(sizeCode)) {
+
+ SexCategory sexCategory = getFK(sexCategoryByName, sizeCode);
+ getSpeciesCategory(speciesCategoryDAO, species, sexCategory);
+
+ } else {
+
+ SizeCategory sizeCategory = getFK(sizeCategoryByName, sizeCode);
+ getSpeciesCategory(speciesCategoryDAO, species, sizeCategory);
+ }
+
+ getSpeciesCategory(speciesCategoryDAO, species);
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Found " + lengthWeightKeys.size() + " speciesCategories.");
+ }
+ }
+
+ protected SpeciesCategory getSpeciesCategory(SpeciesCategoryDAO speciesCategoryDAO,
+ Species species,
+ SizeCategory sizeCategory) throws TopiaException {
+
+ // get species category to use
+ SpeciesCategory speciesCategory = speciesCategoryDAO.findByProperties(
+ SpeciesCategory.PROPERTY_SPECIES, species,
+ SpeciesCategory.PROPERTY_SIZE_CATEGORY, sizeCategory
);
- model.newMandatoryColumn(SpeciesCategory.PROPERTY_SPECIES);
- model.newMandatoryColumn(SpeciesCategory.PROPERTY_SIZE_CATEGORY);
- model.newMandatoryColumn(SpeciesCategory.PROPERTY_AGE_CATEGORY);
- model.newMandatoryColumn(SpeciesCategory.PROPERTY_SEX_CATEGORY);
- return model;
+ if (speciesCategory == null) {
+
+ // create it in db
+ speciesCategory = speciesCategoryDAO.create(
+ SpeciesCategory.PROPERTY_SPECIES, species,
+ SpeciesCategory.PROPERTY_SIZE_CATEGORY, sizeCategory
+ );
+
+ if (log.isInfoEnabled()) {
+ log.info("Create speciesCategory speciesBaracoudaCode/size : " +
+ species.getBaracoudaCode() + "/" +
+ (sizeCategory == null ? null : sizeCategory.getName()));
+ }
+ }
+ return speciesCategory;
}
+ protected SpeciesCategory getSpeciesCategory(SpeciesCategoryDAO speciesCategoryDAO,
+ Species species,
+ SexCategory sexCategory) throws TopiaException {
+
+ // get species category to use
+ SpeciesCategory speciesCategory = speciesCategoryDAO.findByProperties(
+ SpeciesCategory.PROPERTY_SPECIES, species,
+ SpeciesCategory.PROPERTY_SEX_CATEGORY, sexCategory
+ );
+ if (speciesCategory == null) {
+
+ // create it in db
+ speciesCategory = speciesCategoryDAO.create(
+ SpeciesCategory.PROPERTY_SPECIES, species,
+ SpeciesCategory.PROPERTY_SEX_CATEGORY, sexCategory
+ );
+
+ if (log.isInfoEnabled()) {
+ log.info("Create speciesCategory speciesBaracoudaCode/sex : " +
+ species.getBaracoudaCode() + "/" +
+ (sexCategory == null ? null : sexCategory.getName()));
+ }
+ }
+ return speciesCategory;
+ }
+
+ protected SpeciesCategory getSpeciesCategory(SpeciesCategoryDAO speciesCategoryDAO,
+ Species species) throws TopiaException {
+
+ // get species category to use
+ SpeciesCategory speciesCategory = speciesCategoryDAO.findByProperties(
+ SpeciesCategory.PROPERTY_SPECIES, species,
+ SpeciesCategory.PROPERTY_SEX_CATEGORY, null,
+ SpeciesCategory.PROPERTY_SIZE_CATEGORY, null
+ );
+
+ if (speciesCategory == null) {
+
+ // create it in db
+ speciesCategory = speciesCategoryDAO.create(
+ SpeciesCategory.PROPERTY_SPECIES, species
+ );
+
+ if (log.isInfoEnabled()) {
+ log.info("Create speciesCategory speciesBaracoudaCode : " +
+ species.getBaracoudaCode());
+ }
+ }
+ return speciesCategory;
+ }
}
\ No newline at end of file
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -357,7 +357,8 @@
entityLoaders.add(newService(OperationEventLoader.class));
entityLoaders.add(newService(SampleDataTypeLoader.class));
entityLoaders.add(newService(SampleTypeLoader.class));
- entityLoaders.add(newService(BiometryScaleLoader.class));
+ entityLoaders.add(newService(LengthAgeKeyLoader.class));
+ entityLoaders.add(newService(LengthWeightKeyLoader.class));
entityLoaders.add(newService(SexCategoryLoader.class));
entityLoaders.add(newService(SizeCategoryLoader.class));
entityLoaders.add(newService(OperationMetadataLoader.class));
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.BiometryScale;
-import org.junit.Test;
-
-/**
- * To test the {@link BiometryScaleLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class BiometryScaleLoaderIT extends AbstractLoaderIT<BiometryScale, BiometryScaleLoader> {
-
- public BiometryScaleLoaderIT() {
- super(BiometryScaleLoader.class, 44, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.LengthAgeKey;
+import org.junit.Test;
+
+/**
+ * To test the {@link LengthAgeKeyLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class LengthAgeKeyLoaderIT extends AbstractLoaderIT<LengthAgeKey, LengthAgeKeyLoader> {
+
+ public LengthAgeKeyLoaderIT() {
+ super(LengthAgeKeyLoader.class, 0, 1637);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthAgeKeyLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
+import org.junit.Test;
+
+/**
+ * To test the {@link LengthWeightKeyLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class LengthWeightKeyLoaderIT extends AbstractLoaderIT<LengthWeightKey, LengthWeightKeyLoader> {
+
+ public LengthWeightKeyLoaderIT() {
+ super(LengthWeightKeyLoader.class, 0, 218);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/LengthWeightKeyLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -35,7 +35,7 @@
public class OperationLoaderIT extends AbstractLoaderIT<Operation, OperationLoader> {
public OperationLoaderIT() {
- super(OperationLoader.class, 0, 1374);
+ super(OperationLoader.class, 0, 1489);
}
@Test
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -35,7 +35,7 @@
public class SampleLoaderIT extends AbstractLoaderIT<Sample, SampleLoader> {
public SampleLoaderIT() {
- super(SampleLoader.class, 0, 324809);
+ super(SampleLoader.class, 0, 333783);
}
@Test
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java 2011-12-19 19:16:34 UTC (rev 203)
@@ -35,12 +35,12 @@
public class SpeciesCategoryLoaderIT extends AbstractLoaderIT<SpeciesCategory, SpeciesCategoryLoader> {
public SpeciesCategoryLoaderIT() {
- super(SpeciesCategoryLoader.class, 0, 0);
+ super(SpeciesCategoryLoader.class, 0, 443);
}
@Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
}
}
\ No newline at end of file
Deleted: trunk/echobase-tools/src/test/resources/csv/new/input-BiometryScale.csv
===================================================================
--- trunk/echobase-tools/src/test/resources/csv/new/input-BiometryScale.csv 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/resources/csv/new/input-BiometryScale.csv 2011-12-19 19:16:34 UTC (rev 203)
@@ -1,45 +0,0 @@
-raptriBiometryDataType;ScaleCode;ScaleMeaningEng;ScaleMeaningFr
-3;0;Undetermined;indeterminé
-3;1;Male;male
-3;2;Female;femelle
-3;3;NA (IEO- Pelacus1007);Non renseigné (IEO- Pelacus1007)
-4;1;Immature/virgin;Immature/virgin
-4;2;Developing;Developing
-4;3;Prespawning;Prespawning
-4;4;Spawning;Spawning
-4;5;Spent;Spent
-4;6;Resting;Resting
-7;0;Easily readable;facile à lire
-7;1;Hardly readable;difficile à lire
-7;2;Unreadable;illisible
-7;3;Estimated (ex. juvenile otoliths);Estimée (ex. Otolimetrie juvenile)
-8;-1;To be checked by PG;à faire préciser par PG
-8;1;"opaque (""H"")";"opaque (""H"")"
-8;2;"hyalin (""O"")";"hyalin (""O"")"
-8;3;opaque/hyalin;opaque/hyalin
-23;1;No fat;No fat
-23;2;Low fat;Low fat
-23;3;Fat;Fat
-23;4;High fat;High fat
-24;0;no anisakis;zéro anisakis
-24;1;1-10 anisakis;1 à 10 anisakis
-24;2;10-20 anisakis;10 à 20 anisakis
-24;3;>20 anisakis;> 20 anisakis
-25;0;;
-25;1;IFREMER - NANTES (PG);IFREMER - NANTES (PG)
-25;2;IFREMER - LORIENT (ED);IFREMER - LORIENT (ED)
-25;3;AZTI + (PP);AZTI + (PP)
-25;4;AZTI (lecture AGE) + IFREMER Nantes (PG) (mesure rayon);AZTI (lecture AGE) + IFREMER Nantes (PG) (mesure rayon)
-25;5;EPHE - PERPIGNAN (PL);EPHE - PERPIGNAN (PL)
-25;6;IFREMER - IEO (double lecture à bord : Patrick-Carla);IFREMER - IEO (double lecture à bord : Patrick-Carla)
-25;7;biometrie et otolithe IFREMER-NANTES (PG) - génétique : EPHE;biometrie et otolithe IFREMER-NANTES (PG) - génétique : EPHE
-26;0;clé Taille/Age : NON Valide;clé Taille/Age : NON Valide
-26;1;clé Taille/Age : VALIDE;clé Taille/Age : VALIDE
-45;0;NA;NA
-45;1;Blanc ?;Blanc ?
-45;2;?;?
-45;3;Complète;Complète
-45;4;partielle;partielle
-49;0;NA;NA
-49;1;DROIT;DROIT
-49;2;GAUCHE;GAUCHE
\ No newline at end of file
Modified: trunk/echobase-tools/src/test/resources/csv/new/input-SexCategory.csv
===================================================================
--- trunk/echobase-tools/src/test/resources/csv/new/input-SexCategory.csv 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/resources/csv/new/input-SexCategory.csv 2011-12-19 19:16:34 UTC (rev 203)
@@ -1,5 +1,5 @@
CategoryID;CategoryName
-0;All
-G;Large
-P;Small
-TP;Very small
+N;Not determined
+F;Female
+M;Male
+I;Immature
\ No newline at end of file
Modified: trunk/echobase-tools/src/test/resources/csv/new/input-SizeCategory.csv
===================================================================
--- trunk/echobase-tools/src/test/resources/csv/new/input-SizeCategory.csv 2011-12-19 19:16:01 UTC (rev 202)
+++ trunk/echobase-tools/src/test/resources/csv/new/input-SizeCategory.csv 2011-12-19 19:16:34 UTC (rev 203)
@@ -1,5 +1,5 @@
CategoryID;CategoryName
-N;Not determined
-F;Female
+0;All
G;Large
-I;Immature
\ No newline at end of file
+P;Small
+TP;Very small
\ No newline at end of file
1
0
r202 - in trunk/echobase-entities/src/main: java/fr/ifremer/echobase java/fr/ifremer/echobase/entities resources/i18n xmi
by tchemit@users.forge.codelutin.com 19 Dec '11
by tchemit@users.forge.codelutin.com 19 Dec '11
19 Dec '11
Author: tchemit
Date: 2011-12-19 20:16:01 +0100 (Mon, 19 Dec 2011)
New Revision: 202
Url: http://forge.codelutin.com/repositories/revision/echobase/202
Log:
fix entity name + properties
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-entities/src/main/xmi/echobase.zargo
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java 2011-12-19 08:20:03 UTC (rev 201)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java 2011-12-19 19:16:01 UTC (rev 202)
@@ -61,6 +61,7 @@
import fr.ifremer.echobase.entities.references.GearMetadata;
import fr.ifremer.echobase.entities.references.Impacte;
import fr.ifremer.echobase.entities.references.LengthAgeKey;
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
import fr.ifremer.echobase.entities.references.MeasureType;
import fr.ifremer.echobase.entities.references.MeasurementMetadata;
import fr.ifremer.echobase.entities.references.Mission;
@@ -80,7 +81,6 @@
import fr.ifremer.echobase.entities.references.TSParameters;
import fr.ifremer.echobase.entities.references.Vessel;
import fr.ifremer.echobase.entities.references.VesselType;
-import fr.ifremer.echobase.entities.references.WeightLengthKey;
import org.nuiton.util.decorator.DecoratorMulti18nProvider;
import java.util.Locale;
@@ -233,8 +233,8 @@
// VesselType decorator
registerJXPathDecorator(locale, VesselType.class, "${name}$s");
- // WeightLengthKey decorator
- registerJXPathDecorator(locale, WeightLengthKey.class, "Species ${species.genusSpecies}$s - a=${aParameter}$s, b=${bParameter}$s");
+ // LengthWeightKey decorator
+ registerJXPathDecorator(locale, LengthWeightKey.class, "Species ${species.genusSpecies}$s - a=${aParameter}$s, b=${bParameter}$s");
// Cell decorator
registerJXPathDecorator(locale, Cell.class, "${name}$s");
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2011-12-19 08:20:03 UTC (rev 201)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2011-12-19 19:16:01 UTC (rev 202)
@@ -40,7 +40,10 @@
import fr.ifremer.echobase.entities.references.ReferenceDatum;
import fr.ifremer.echobase.entities.references.ReferenceDatumType;
import fr.ifremer.echobase.entities.references.SampleDataType;
+import fr.ifremer.echobase.entities.references.SexCategory;
+import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
import fr.ifremer.echobase.entities.references.Vessel;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -192,7 +195,38 @@
return input.getId();
}
};
+ public static final Function<SizeCategory, String> SIZE_CATEGORY_NAME = new Function<SizeCategory, String>() {
+ @Override
+ public String apply(SizeCategory input) {
+ return input.getName();
+ }
+ };
+ public static final Function<SpeciesCategory, String> SPECIES_CATEGORY_SPIECIES = new Function<SpeciesCategory, String>() {
+ @Override
+ public String apply(SpeciesCategory input) {
+ return getSpeciesCategoryKey(input.getSpecies(), input.getSizeCategory(), input.getSexCategory());
+ }
+ };
+
+ public static final Function<SexCategory, String> SEX_CATEGORY_NAME = new Function<SexCategory, String>() {
+ @Override
+ public String apply(SexCategory input) {
+ return input.getName();
+ }
+ };
+
+ public static String getSpeciesCategoryKey(Species species, SizeCategory sizeCategory,SexCategory sexCategory) {
+ String key = species.getBaracoudaCode();
+ if (sizeCategory != null) {
+ key += "_" + sizeCategory.getName();
+ }
+ if (sexCategory != null) {
+ key += "_" + sexCategory.getName();
+ }
+ return key;
+ }
+
public static Function<Map<String, Object>, String> newRowFunction(final String key) {
return new Function<Map<String, Object>, String>() {
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-19 08:20:03 UTC (rev 201)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-19 19:16:01 UTC (rev 202)
@@ -118,13 +118,12 @@
result.add(EchoBaseEntityEnum.OperationType);
result.add(EchoBaseEntityEnum.MeasurementMetadata);
result.add(EchoBaseEntityEnum.SampleDataType);
- result.add(EchoBaseEntityEnum.BiometryScale);
result.add(EchoBaseEntityEnum.SampleType);
result.add(EchoBaseEntityEnum.Vessel);
result.add(EchoBaseEntityEnum.Echotype);
result.add(EchoBaseEntityEnum.DataMetadata);
result.add(EchoBaseEntityEnum.LengthAgeKey);
- result.add(EchoBaseEntityEnum.WeightLengthKey);
+ result.add(EchoBaseEntityEnum.LengthWeightKey);
result.add(EchoBaseEntityEnum.CellType);
result.add(EchoBaseEntityEnum.Impacte);
result.add(EchoBaseEntityEnum.Mission);
Modified: trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
===================================================================
--- trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-12-19 08:20:03 UTC (rev 201)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-12-19 19:16:01 UTC (rev 202)
@@ -1,5 +1,6 @@
+echobase.common.AParameter=
+echobase.common.BParameter=
echobase.common.TSParameters=
-echobase.common.aParameter=
echobase.common.accuracyEstimate=
echobase.common.acknowledgement=
echobase.common.acousticDensityUnit=
@@ -18,12 +19,10 @@
echobase.common.authorReference=
echobase.common.axis=
echobase.common.b=
-echobase.common.bParameter=
echobase.common.baracoudaCode=
echobase.common.binSizePingAxis=
echobase.common.binSizeRangeAxis=
echobase.common.binUnitsPingAxis=
-echobase.common.biometryScale=
echobase.common.calendar=
echobase.common.calibration=calibration
echobase.common.callsign=
@@ -95,7 +94,6 @@
echobase.common.gearShootingStartLatitude=
echobase.common.gearShootingStartLongitude=
echobase.common.gearShootingStartTime=
-echobase.common.gearType=
echobase.common.genusSpecies=
echobase.common.geospatialLatMax=
echobase.common.geospatialLatMin=
@@ -104,7 +102,6 @@
echobase.common.geospatialVerticalMax=
echobase.common.geospatialVerticalMin=
echobase.common.geospatialVerticalPositive=
-echobase.common.group=
echobase.common.history=
echobase.common.id=Identifiant
echobase.common.imo=
@@ -117,6 +114,7 @@
echobase.common.lastModifiedUser=Utilisateur de dernière modification
echobase.common.length=
echobase.common.lengthAgeKey=
+echobase.common.lengthWeightKey=
echobase.common.level=
echobase.common.licence=
echobase.common.linestring=
@@ -137,7 +135,6 @@
echobase.common.measurementUnit=
echobase.common.metadata=metadata
echobase.common.metadataGroup=
-echobase.common.metadataType=
echobase.common.midHauleLatitude=
echobase.common.midHauleLongitude=
echobase.common.minLatitude=
@@ -188,7 +185,6 @@
echobase.common.sampleDataType=
echobase.common.sampleType=
echobase.common.sampleWeight=
-echobase.common.sampling=
echobase.common.scaleFactor=
echobase.common.seafloorSubstrate=
echobase.common.sexCategory=
@@ -257,5 +253,4 @@
echobase.common.vessel=Navire
echobase.common.vesselType=
echobase.common.voyage=Campagne
-echobase.common.weightLengthKey=
echobase.config.data.directory.description=Chemin de l'application
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
1
0
19 Dec '11
Author: tchemit
Date: 2011-12-19 09:20:03 +0100 (Mon, 19 Dec 2011)
New Revision: 201
Url: http://forge.codelutin.com/repositories/revision/echobase/201
Log:
optimize dependencies
Modified:
trunk/echobase-services/pom.xml
trunk/echobase-tools/pom.xml
trunk/pom.xml
Modified: trunk/echobase-services/pom.xml
===================================================================
--- trunk/echobase-services/pom.xml 2011-12-19 08:10:42 UTC (rev 200)
+++ trunk/echobase-services/pom.xml 2011-12-19 08:20:03 UTC (rev 201)
@@ -55,10 +55,10 @@
<artifactId>commons-lang3</artifactId>
</dependency>
- <!--dependency>
- <groupId>org.apache.struts.xwork</groupId>
- <artifactId>xwork-core</artifactId>
- </dependency-->
+ <dependency>
+ <groupId>net.sourceforge.javacsv</groupId>
+ <artifactId>javacsv</artifactId>
+ </dependency>
<dependency>
<groupId>commons-beanutils</groupId>
Modified: trunk/echobase-tools/pom.xml
===================================================================
--- trunk/echobase-tools/pom.xml 2011-12-19 08:10:42 UTC (rev 200)
+++ trunk/echobase-tools/pom.xml 2011-12-19 08:20:03 UTC (rev 201)
@@ -62,6 +62,11 @@
<!-- commons dependencies -->
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-12-19 08:10:42 UTC (rev 200)
+++ trunk/pom.xml 2011-12-19 08:20:03 UTC (rev 201)
@@ -309,6 +309,12 @@
<version>10.0.1</version>
</dependency>
+ <dependency>
+ <groupId>net.sourceforge.javacsv</groupId>
+ <artifactId>javacsv</artifactId>
+ <version>2.0</version>
+ </dependency>
+
<!-- librairies web -->
<dependency>
1
0
r200 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase/entities echobase-entities/src/main/xmi echobase-services/src/main/java/fr/ifremer/echobase/services src/doc/reunions
by tchemit@users.forge.codelutin.com 19 Dec '11
by tchemit@users.forge.codelutin.com 19 Dec '11
19 Dec '11
Author: tchemit
Date: 2011-12-19 09:10:42 +0100 (Mon, 19 Dec 2011)
New Revision: 200
Url: http://forge.codelutin.com/repositories/revision/echobase/200
Log:
little stuff before small release
Added:
trunk/src/doc/reunions/reunion-2011-12-19.txt
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
trunk/echobase-entities/src/main/xmi/echobase.zargo
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-16 17:54:16 UTC (rev 199)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-19 08:10:42 UTC (rev 200)
@@ -169,6 +169,9 @@
result.add(EchoBaseEntityEnum.DataQuality);
result.add(EchoBaseEntityEnum.CellMethod);
result.add(EchoBaseEntityEnum.CellType);
+ result.add(EchoBaseEntityEnum.OperationEvent);
+ result.add(EchoBaseEntityEnum.SampleDataType);
+ result.add(EchoBaseEntityEnum.SampleType);
result.add(EchoBaseEntityEnum.DataMetadata);
result.add(EchoBaseEntityEnum.OperationMetadata);
result.add(EchoBaseEntityEnum.GearMetadata);
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java 2011-12-16 17:54:16 UTC (rev 199)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbImportService.java 2011-12-19 08:10:42 UTC (rev 200)
@@ -294,7 +294,6 @@
importer.close();
}
-
}
}
@@ -320,10 +319,6 @@
TableMeta tableMeta = getTableMeta(type);
entities.add(tableMeta);
-
-// for (AssociationMeta associationMeta : tableMeta.getAssociations()) {
-// associations.add(associationMeta);
-// }
associations.addAll(tableMeta.getAssociations());
}
}
Added: trunk/src/doc/reunions/reunion-2011-12-19.txt
===================================================================
--- trunk/src/doc/reunions/reunion-2011-12-19.txt (rev 0)
+++ trunk/src/doc/reunions/reunion-2011-12-19.txt 2011-12-19 08:10:42 UTC (rev 200)
@@ -0,0 +1,58 @@
+projet echobase
+---------------
+
+Lundi 19-12-2011 (Ifremer)
+
+Présents : Mathieu et Tony
+
+Planning
+--------
+
+- Revoir quelques points sur le modèle
+
+Modèle pêche
+------------
+
+- SpeciesCategory ?
+- Sample est lié à SpeciesCategory et Species ?
+- LengthAgeKey ?
+- WeightLengthKey ?
+- BiometryScale ?
+
+Import nouvelles données
+------------------------
+
+- Planning ?
+
+Réalisation modèle pêche
+------------------------
+
+- Report des modifications du modèle
+- Remplissage du référentiel OperationEvent
+- Remplissage du référentiel SampleDataType
+- Remplissage du référentiel SampleType
+- Création entité BiometryScale
+- Remplissage du référentiel BiometryScale
+- Remplissage du référentiel SexCategory
+- Remplissage du référentiel SizeCategory
+- Remplissage du référentiel OperationMetadata
+- Remplissage du référentiel GearMetadata
+- Remplissage du référentiel Gear
+
+- Import des opérations (depuis table STATIONS)
+- Import des samples (depuis table CAPTURES/MENSURATIONS/BIOMETRIE_VALEURS)
+
+Action
+------
+
+- Code
+
+ - livraison 0.2 avec toutes les données anciennes
+
+- Ifremer
+
+ - fournir les référentiels manquants
+
+Prochaine réunion :
+
+ - Lundi 19 à 10h00 à l'Ifremer avec Mathieu
\ No newline at end of file
Property changes on: trunk/src/doc/reunions/reunion-2011-12-19.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r199 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase echobase-entities/src/main/resources/i18n echobase-entities/src/main/xmi echobase-tools echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders src/doc/reunions
by tchemit@users.forge.codelutin.com 16 Dec '11
by tchemit@users.forge.codelutin.com 16 Dec '11
16 Dec '11
Author: tchemit
Date: 2011-12-16 18:54:16 +0100 (Fri, 16 Dec 2011)
New Revision: 199
Url: http://forge.codelutin.com/repositories/revision/echobase/199
Log:
- fix test resources
- continue Catches legacy datas import
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-entities/src/main/xmi/echobase.zargo
trunk/echobase-tools/pom.xml
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
trunk/src/doc/reunions/reunion-2011-12-14.txt
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2011-12-16 17:54:16 UTC (rev 199)
@@ -45,7 +45,6 @@
import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.persistence.TopiaEntity;
-import javax.annotation.Nullable;
import java.io.File;
import java.util.Map;
@@ -165,7 +164,7 @@
return input.getName();
}
};
- public static final Function<SampleDataType, String> SAMPLE_DATA_TYPE_RAPRI_CODE = new Function<SampleDataType, String>() {
+ public static final Function<SampleDataType, String> SAMPLE_DATA_TYPE_RAPTRI_CODE = new Function<SampleDataType, String>() {
@Override
public String apply(SampleDataType input) {
return String.valueOf(input.getRaptriBiometryDataType());
@@ -186,6 +185,7 @@
return StringUtils.isEmpty(casinoGearName) ? input.getName() : casinoGearName;
}
};
+
public static final Function<Operation, String> OPERATION_ID = new Function<Operation, String>() {
@Override
public String apply(Operation input) {
Modified: trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
===================================================================
--- trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-12-16 17:54:16 UTC (rev 199)
@@ -138,6 +138,8 @@
echobase.common.metadata=metadata
echobase.common.metadataGroup=
echobase.common.metadataType=
+echobase.common.midHauleLatitude=
+echobase.common.midHauleLongitude=
echobase.common.minLatitude=
echobase.common.minLongitude=
echobase.common.mission=mission
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
Modified: trunk/echobase-tools/pom.xml
===================================================================
--- trunk/echobase-tools/pom.xml 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-tools/pom.xml 2011-12-16 17:54:16 UTC (rev 199)
@@ -205,6 +205,12 @@
<include>**/*.csv</include>
</includes>
</testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </testResource>
</testResources>
</build>
</profile>
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoader.java 2011-12-16 17:54:16 UTC (rev 199)
@@ -58,7 +58,7 @@
/*
raptriBiometryDataType;ScaleCode;ScaleMeaningEng;ScaleMeaningFr
*/
- model.addForeignKeyForImport("raptriBiometryDataType", BiometryScale.PROPERTY_SAMPLE_DATA_TYPE, SampleDataType.class, sampleDataTypes, EchoBaseFunctions.SAMPLE_DATA_TYPE_RAPRI_CODE);
+ model.addForeignKeyForImport("raptriBiometryDataType", BiometryScale.PROPERTY_SAMPLE_DATA_TYPE, SampleDataType.class, sampleDataTypes, EchoBaseFunctions.SAMPLE_DATA_TYPE_RAPTRI_CODE);
model.addDefaultColumn("ScaleCode",BiometryScale.PROPERTY_CODE, int.class);
model.newMandatoryColumn("ScaleMeaningEng",BiometryScale.PROPERTY_MEANING_EN);
model.newMandatoryColumn("ScaleMeaningFr",BiometryScale.PROPERTY_MEANING_FR);
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java 2011-12-16 17:54:16 UTC (rev 199)
@@ -119,40 +119,63 @@
copyAndLoadEntities(outputDir, meta.getAssociations(Operation.PROPERTY_OPERATION_METADATA_VALUE), false, FileType.ASSOCIATION);
copyAndLoadEntities(outputDir, meta.getAssociations(Operation.PROPERTY_GEAR_METADATA_VALUE), false, FileType.ASSOCIATION);
-
}
+ //SONDE
+ OperationMetadata MeanWaterDepthOperationMeta;
+ //JOUR_NUIT
+ OperationMetadata DielPeriodOperationMeta;
+ //SONDEDEB
+ OperationMetadata StartWaterDepthOperationMeta;
+ //SONDEFIN
+ OperationMetadata EndWaterDepthOperationMeta;
+
+ //LFUNES
+ GearMetadata CableLengthGearMeta;
+ //VMIN
+ GearMetadata MinSpeedGearMeta;
+ //VMAX
+ GearMetadata MaxSpeedGearMeta;
+
+ TopiaDAO<Operation> dao;
+ TopiaDAO<OperationMetadataValue> operationMetadataValueDAO;
+ TopiaDAO<GearMetadataValue> gearMetadataValueDAO;
+
+ Map<String, DepthStratum> depthStratumByName;
+ Map<String, Gear> gearByCasinoGearName;
+
@Override
- protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
+ protected void importBaracoudaEntities(Database db) throws
+ IOException, TopiaException {
Map<String, Voyage> voyagesByName = getUniverse(
Voyage.class, EchoBaseFunctions.VOYAGE_NAME);
- Map<String, DepthStratum> depthStratumByName = getUniverse(
+ depthStratumByName = getUniverse(
DepthStratum.class, EchoBaseFunctions.DEPTH_STRATUM_ID);
- Map<String, Gear> gearByCasinoGearName = getUniverse(
+ gearByCasinoGearName = getUniverse(
Gear.class, EchoBaseFunctions.GEAR_CASINO_GEAR_NAME);
OperationMetadataDAO operationMetadataDAO =
(OperationMetadataDAO) getDAO(OperationMetadata.class);
//SONDE
- OperationMetadata MeanWaterDepthOperationMeta =
+ MeanWaterDepthOperationMeta =
operationMetadataDAO.findByName("MeanWaterDepth");
Preconditions.checkNotNull(MeanWaterDepthOperationMeta);
//JOUR_NUIT
- OperationMetadata DielPeriodOperationMeta =
+ DielPeriodOperationMeta =
operationMetadataDAO.findByName("DielPeriod");
Preconditions.checkNotNull(DielPeriodOperationMeta);
//SONDEDEB
- OperationMetadata StartWaterDepthOperationMeta = operationMetadataDAO.findByProperties(
+ StartWaterDepthOperationMeta = operationMetadataDAO.findByProperties(
OperationMetadata.PROPERTY_NAME, "WaterDepth",
OperationMetadata.PROPERTY_OPERATION_EVENT + "." + OperationEvent.PROPERTY_NAME, "ShootingStart"
);
Preconditions.checkNotNull(StartWaterDepthOperationMeta);
//SONDEFIN
- OperationMetadata EndWaterDepthOperationMeta = operationMetadataDAO.findByProperties(
+ EndWaterDepthOperationMeta = operationMetadataDAO.findByProperties(
OperationMetadata.PROPERTY_NAME, "WaterDepth",
OperationMetadata.PROPERTY_OPERATION_EVENT + "." + OperationEvent.PROPERTY_NAME, "HaulingEnd"
);
@@ -162,24 +185,19 @@
(GearMetadataDAO) getDAO(GearMetadata.class);
//LFUNES
- GearMetadata CableLengthGearMeta = gearMetadataDAO.findByType("CableLength");
+ CableLengthGearMeta = gearMetadataDAO.findByType("CableLength");
Preconditions.checkNotNull(CableLengthGearMeta);
-
//VMIN
- GearMetadata MinSpeedGearMeta = gearMetadataDAO.findByType("MinSpeed");
+ MinSpeedGearMeta = gearMetadataDAO.findByType("MinSpeed");
Preconditions.checkNotNull(MinSpeedGearMeta);
-
//VMAX
- GearMetadata MaxSpeedGearMeta = gearMetadataDAO.findByType("MaxSpeed");
+ MaxSpeedGearMeta = gearMetadataDAO.findByType("MaxSpeed");
Preconditions.checkNotNull(MaxSpeedGearMeta);
- TopiaDAO<Operation> dao = getDAO();
- TopiaDAO<OperationMetadataValue> operationMetadataValueDAO =
- getDAO(OperationMetadataValue.class);
+ dao = getDAO();
+ operationMetadataValueDAO = getDAO(OperationMetadataValue.class);
+ gearMetadataValueDAO = getDAO(GearMetadataValue.class);
- TopiaDAO<GearMetadataValue> gearMetadataValueDAO =
- getDAO(GearMetadataValue.class);
-
Multimap<String, Map<String, Object>> stationByCampagneName = Multimaps.index(
db.getTable("STATIONS"), EchoBaseFunctions.newRowFunction("CAMPAGNE"));
@@ -196,142 +214,169 @@
Preconditions.checkNotNull(transect);
Collection<Map<String, Object>> rows =
stationByCampagneName.get(voyageName);
+
for (Map<String, Object> row : rows) {
- String status = (String) row.get("ETAT");
- if ("FICTIF".equalsIgnoreCase(status)) {
+ Operation operation = addOperation(row, messages);
+ if (operation != null) {
+ operations.add(operation);
+ transect.addOperation(operation);
- // skip fictif operation
- continue;
- }
- String operationId = (String) row.get("NOSTA");
+ if (!messages.isEmpty()) {
- DepthStratum depthStratum = null;
- String depthStratumId = (String) row.get("STA_IMAGES");
- if (StringUtils.isBlank(depthStratumId) ||
- "nul".equals(depthStratumId)) {
- messages.add("No depthStraum defined");
- } else {
- depthStratum = getFK(depthStratumByName, depthStratumId.trim());
+ if (log.isWarnEnabled()) {
+ log.warn("For operation " + operation.getId() + " : " + messages);
+ }
+ messages.clear();
+ }
}
+ }
+ }
- String gearId = (String) row.get("ENGIN");
- if (gearId == null) {
- messages.add("No gear id");
- } else {
- Gear gear = getFK(gearByCasinoGearName, gearId);
+ if (log.isInfoEnabled()) {
+ log.info("Found " + operations.size() + " operation(s).");
+ }
+ }
- Float shootingStartLatitude = (Float) row.get("LATDEB");
- if (shootingStartLatitude == null) {
- messages.add("No shootingStartLatitude");
- shootingStartLatitude = 0f;
- }
- Float shootingEndLatitude = (Float) row.get("LATDD");
- if (shootingEndLatitude == null) {
- messages.add("No shootingEndLatitude");
- shootingEndLatitude = 0f;
- }
- Float shootingStartLongitude = (Float) row.get("LGDEB");
- if (shootingStartLongitude == null) {
- messages.add("No shootingStartLongitude");
- shootingStartLongitude = 0f;
- }
- Float shootingEndLongitude = (Float) row.get("LGDD");
- if (shootingEndLongitude == null) {
- messages.add("No shootingEndLongitude");
- shootingEndLongitude = 0f;
- }
+ protected Operation addOperation(Map<String, Object> row,
+ List<String> messages) throws TopiaException {
+ String status = (String) row.get("ETAT");
- Date shootingStartTime = (Date) row.get("DHTUDEB");
- Date shootingEndTime = (Date) row.get("DHTUFIN");
+ if ("FICTIF".equalsIgnoreCase(status)) {
- String comment = (String) row.get("COMMENTAIRE");
+ // skip fictif operation
+ return null;
+ }
- // create a operation
- Operation operation = dao.create(
- Operation.PROPERTY_ID, operationId,
- Operation.PROPERTY_DEPTH_STRATUM, depthStratum,
- Operation.PROPERTY_GEAR, gear,
- Operation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, shootingStartLatitude,
- Operation.PROPERTY_GEAR_SHOOTING_END_LATITUDE, shootingEndLatitude,
- Operation.PROPERTY_GEAR_SHOOTING_START_LONGITUDE, shootingStartLongitude,
- Operation.PROPERTY_GEAR_SHOOTING_END_LONGITUDE, shootingEndLongitude,
- Operation.PROPERTY_GEAR_SHOOTING_START_TIME, shootingStartTime,
- Operation.PROPERTY_GEAR_SHOOTING_END_TIME, shootingEndTime,
- Operation.PROPERTY_COMMENT, comment
- );
+ String operationId = (String) row.get("NOSTA");
- addOperationMetadataValue(operationMetadataValueDAO,
- operation,
- MeanWaterDepthOperationMeta,
- row.get("SONDE"));
+ String gearId = (String) row.get("ENGIN");
+ if (gearId == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("No gear id for Operation " + operationId);
+ }
+ return null;
+ }
- addOperationMetadataValue(operationMetadataValueDAO,
- operation,
- DielPeriodOperationMeta,
- row.get("JOUR_NUIT"));
+ DepthStratum depthStratum = null;
+ String depthStratumId = (String) row.get("STA_IMAGES");
+ if (StringUtils.isBlank(depthStratumId) ||
+ "nul".equals(depthStratumId)) {
+ messages.add("No depthStraum defined");
+ } else {
+ depthStratum = getFK(depthStratumByName, depthStratumId.trim());
+ }
- addOperationMetadataValue(operationMetadataValueDAO,
- operation,
- StartWaterDepthOperationMeta,
- row.get("SONDEDEB"));
+ Gear gear = getFK(gearByCasinoGearName, gearId);
- addOperationMetadataValue(operationMetadataValueDAO,
- operation,
- EndWaterDepthOperationMeta,
- row.get("SONDEFIN"));
+ Float shootingStartLatitude = (Float) row.get("LATDEB");
+ if (shootingStartLatitude == null) {
+ messages.add("No shootingStartLatitude");
+ }
- addGearMetadataValue(gearMetadataValueDAO,
- operation,
- CableLengthGearMeta,
- row.get("LFUNES"));
+ Double doubleValue = (Double) row.get("LATFIN");
+ Float shootingEndLatitude;
+ if (doubleValue == null) {
+ messages.add("No shootingEndLatitude");
+ shootingEndLatitude = null;
+ } else {
+ shootingEndLatitude = doubleValue.floatValue();
+ }
- addGearMetadataValue(gearMetadataValueDAO,
- operation,
- MinSpeedGearMeta,
- row.get("VMIN"));
+ Float shootingStartLongitude = (Float) row.get("LGDEB");
+ if (shootingStartLongitude == null) {
+ messages.add("No shootingStartLongitude");
+ }
- addGearMetadataValue(gearMetadataValueDAO,
- operation,
- MaxSpeedGearMeta,
- row.get("VMAX"));
+ doubleValue = (Double) row.get("LGFIN");
+ Float shootingEndLongitude;
+ if (doubleValue == null) {
+ messages.add("No shootingEndLongitude");
+ shootingEndLongitude = null;
+ } else {
+ shootingEndLongitude = doubleValue.floatValue();
+ }
- operations.add(operation);
- transect.addOperation(operation);
+ Float midHauleLatitude = (Float) row.get("LATDD");
+ Preconditions.checkNotNull(midHauleLatitude);
+// if (midHauleLatitude == null) {
+// messages.add("No midHauleLatitude");
+// midHauleLatitude = 0f;
+// }
- }
- if (!messages.isEmpty()) {
+ Float midHauleLongitude = (Float) row.get("LGDD");
+ Preconditions.checkNotNull(midHauleLongitude);
+// if (midHauleLongitude== null) {
+// messages.add("No midHauleLongitude");
+// midHauleLongitude = 0f;
+// }
- if (log.isWarnEnabled()) {
- log.warn("For operation " + operationId + ", status " + status + " : " + messages);
- }
- messages.clear();
- }
- }
- }
+ Date shootingStartTime = (Date) row.get("DHTUDEB");
+ Date shootingEndTime = (Date) row.get("DHTUFIN");
+ String comment = (String) row.get("COMMENTAIRE");
- if (log.isInfoEnabled()) {
- log.info("Found " + operations.size() + " operation(s).");
- }
+ // create a operation
+ Operation operation = dao.create(
+ Operation.PROPERTY_ID, operationId,
+ Operation.PROPERTY_DEPTH_STRATUM, depthStratum,
+ Operation.PROPERTY_GEAR, gear,
+ Operation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, shootingStartLatitude,
+ Operation.PROPERTY_GEAR_SHOOTING_END_LATITUDE, shootingEndLatitude,
+ Operation.PROPERTY_GEAR_SHOOTING_START_LONGITUDE, shootingStartLongitude,
+ Operation.PROPERTY_GEAR_SHOOTING_END_LONGITUDE, shootingEndLongitude,
+ Operation.PROPERTY_GEAR_SHOOTING_START_TIME, shootingStartTime,
+ Operation.PROPERTY_GEAR_SHOOTING_END_TIME, shootingEndTime,
+ Operation.PROPERTY_MID_HAULE_LATITUDE, midHauleLatitude,
+ Operation.PROPERTY_MID_HAULE_LONGITUDE, midHauleLongitude,
+ Operation.PROPERTY_COMMENT, comment
+ );
+
+ addOperationMetadataValue(operation,
+ MeanWaterDepthOperationMeta,
+ row.get("SONDE"));
+
+ addOperationMetadataValue(operation,
+ DielPeriodOperationMeta,
+ row.get("JOUR_NUIT"));
+
+ addOperationMetadataValue(operation,
+ StartWaterDepthOperationMeta,
+ row.get("SONDEDEB"));
+
+ addOperationMetadataValue(operation,
+ EndWaterDepthOperationMeta,
+ row.get("SONDEFIN"));
+
+ addGearMetadataValue(operation,
+ CableLengthGearMeta,
+ row.get("LFUNES"));
+
+ addGearMetadataValue(operation,
+ MinSpeedGearMeta,
+ row.get("VMIN"));
+
+ addGearMetadataValue(operation,
+ MaxSpeedGearMeta,
+ row.get("VMAX"));
+
+ return operation;
}
- protected void addOperationMetadataValue(TopiaDAO<OperationMetadataValue> dao,
- Operation operation,
+ protected void addOperationMetadataValue(Operation operation,
OperationMetadata meta,
Object value
) throws TopiaException {
if (value == null) {
return;
}
- OperationMetadataValue operationMetadataValue = dao.create(
+ OperationMetadataValue operationMetadataValue = operationMetadataValueDAO.create(
OperationMetadataValue.PROPERTY_OPERATION_METADATA, meta,
OperationMetadataValue.PROPERTY_DATA_VALUE, value.toString()
);
operation.addOperationMetadataValue(operationMetadataValue);
}
- protected void addGearMetadataValue(TopiaDAO<GearMetadataValue> dao,
- Operation operation,
+ protected void addGearMetadataValue(Operation operation,
GearMetadata meta,
Object value
) throws TopiaException {
@@ -339,7 +384,7 @@
if (value == null) {
return;
}
- GearMetadataValue gearMetadataValue = dao.create(
+ GearMetadataValue gearMetadataValue = gearMetadataValueDAO.create(
GearMetadataValue.PROPERTY_GEAR_METADATA, meta,
GearMetadataValue.PROPERTY_DATA_VALUE, value.toString(),
GearMetadataValue.PROPERTY_GEAR, operation.getGear()
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java 2011-12-16 17:54:16 UTC (rev 199)
@@ -26,6 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
+import com.google.common.collect.Sets;
import com.healthmarketscience.jackcess.Database;
import fr.ifremer.echobase.EchoBaseFunctions;
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
@@ -35,7 +36,6 @@
import fr.ifremer.echobase.entities.data.SampleDataDAO;
import fr.ifremer.echobase.entities.meta.TableMeta;
import fr.ifremer.echobase.entities.references.SampleDataType;
-import fr.ifremer.echobase.entities.references.SampleDataTypeDAO;
import fr.ifremer.echobase.entities.references.SampleType;
import fr.ifremer.echobase.entities.references.SampleTypeDAO;
import fr.ifremer.echobase.entities.references.Species;
@@ -49,6 +49,7 @@
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
+import java.util.Set;
/**
* To load {@link Sample} entities.
@@ -100,9 +101,9 @@
TableMeta meta = getMeta();
copyAndLoadEntities(outputDir, meta.getAssociations(Sample.PROPERTY_SAMPLE_DATA), false, FileType.ASSOCIATION);
-
}
+
@Override
protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
@@ -112,6 +113,9 @@
Map<String, Species> speciesByName = getUniverse(
Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
+ Map<String, SampleDataType> sampleDataTypeByRaptriCode = getUniverse(
+ SampleDataType.class, EchoBaseFunctions.SAMPLE_DATA_TYPE_RAPTRI_CODE);
+
Multimap<String, Map<String, Object>> mensurationByNosta = Multimaps.index(
db.getTable("MENSURATIONS", true),
EchoBaseFunctions.newRowFunction("NOSTA")
@@ -121,6 +125,16 @@
db.getTable("CAPTURES", true),
EchoBaseFunctions.newRowFunction("NOSTA")
);
+
+ Multimap<Integer, Map<String, Object>> biometryScalesByRaptri = Multimaps.index(
+ db.getTable("BIOMETRIE_ECHELLE", true),
+ EchoBaseFunctions.newRowIntegerFunction("Code_Param_Biometrie_Echelle")
+ );
+
+ Multimap<String, Map<String, Object>> biometryValuesByNosta = Multimaps.index(
+ db.getTable("BIOMETRIE_VALEUR", true),
+ EchoBaseFunctions.newRowFunction("NOSTA_VALEUR_BIOMETRIE")
+ );
SampleTypeDAO sampleTypeDAO =
(SampleTypeDAO) getDAO(SampleType.class);
@@ -130,28 +144,32 @@
Preconditions.checkNotNull(sampleTypeUnsorted);
SampleType sampleTypeSubsample = sampleTypeDAO.findByName("Subsample");
Preconditions.checkNotNull(sampleTypeSubsample);
+ SampleType sampleTypeIndividual = sampleTypeDAO.findByName("Individual");
+ Preconditions.checkNotNull(sampleTypeIndividual);
- SampleDataTypeDAO sampleDataTypeDAO =
- (SampleDataTypeDAO) getDAO(SampleDataType.class);
+// SampleDataTypeDAO sampleDataTypeDAO =
+// (SampleDataTypeDAO) getDAO(SampleDataType.class);
SampleDataDAO sampleDataDAO = (SampleDataDAO) getDAO(SampleData.class);
- SampleDataType sampleDataTypeMeanLength = sampleDataTypeDAO.findByName("MeanLengthcm");
- Preconditions.checkNotNull(sampleDataTypeMeanLength);
- SampleDataType sampleDataTypeMeanWeight = sampleDataTypeDAO.findByName("MeanWeightg");
- Preconditions.checkNotNull(sampleDataTypeMeanWeight);
- SampleDataType sampleDataTypeNoPerKg = sampleDataTypeDAO.findByName("NoPerKg");
- Preconditions.checkNotNull(sampleDataTypeNoPerKg);
- SampleDataType sampleDataTypeNumberAtLength = sampleDataTypeDAO.findByName("NumberAtLength");
- Preconditions.checkNotNull(sampleDataTypeNumberAtLength);
- SampleDataType sampleDataTypeWeightAtLength = sampleDataTypeDAO.findByName("WeightAtLengthkg");
- Preconditions.checkNotNull(sampleDataTypeWeightAtLength);
+// SampleDataType sampleDataTypeMeanLength = sampleDataTypeDAO.findByName("MeanLengthcm");
+ SampleDataType sampleDataTypeMeanLength = getFK(sampleDataTypeByRaptriCode, "114");
+// SampleDataType sampleDataTypeMeanWeight = sampleDataTypeDAO.findByName("MeanWeightg");
+ SampleDataType sampleDataTypeMeanWeight = getFK(sampleDataTypeByRaptriCode, "115");
+// SampleDataType sampleDataTypeNoPerKg = sampleDataTypeDAO.findByName("NoPerKg");
+ SampleDataType sampleDataTypeNoPerKg = getFK(sampleDataTypeByRaptriCode, "116");
+// SampleDataType sampleDataTypeNumberAtLength = sampleDataTypeDAO.findByName("NumberAtLength");
+ SampleDataType sampleDataTypeNumberAtLength = getFK(sampleDataTypeByRaptriCode, "112");
+// SampleDataType sampleDataTypeWeightAtLength = sampleDataTypeDAO.findByName("WeightAtLengthkg");
+ SampleDataType sampleDataTypeWeightAtLength = getFK(sampleDataTypeByRaptriCode, "113");
+
TopiaDAO<Sample> dao = getDAO();
int nbSampleUnsorted = 0;
int nbSampleTotal = 0;
int nbSubSample = 0;
+ int nbIndividualSample = 0;
for (String operationId : capturesByNosta.keySet()) {
Preconditions.checkNotNull(operationId);
@@ -162,6 +180,13 @@
}
continue;
}
+ Collection<Map<String, Object>> biometryValues =
+ biometryValuesByNosta.get(operationId);
+
+ Multimap<String, Map<String, Object>> biometryValuesBySpecies = Multimaps.index(
+ biometryValues,
+ EchoBaseFunctions.newRowFunction("GENRE_ESP_VALEUR_BIOMETRIE")
+ );
for (Map<String, Object> row : capturesByNosta.get(operationId)) {
String type = (String) row.get("CATEG");
@@ -214,7 +239,7 @@
"NA",
row.get("MOULE_MENS"));
- Collection<Map<String, Object>> mesnurationRows =
+ Collection<Map<String, Object>> mensurationRows =
mensurationByNosta.get(operationId);
Float sampleWeight = (Float) row.get("PESP_MENS");
@@ -224,6 +249,7 @@
}
sampleWeight = 0f;
}
+
addSubSamples(dao,
sampleDataDAO,
sampleTypeSubsample,
@@ -233,22 +259,105 @@
type,
species,
sampleWeight,
- mesnurationRows);
+ mensurationRows);
int nbSamples = operation.sizeSample();
nbSubSample += nbSamples - 1;
+
+ Collection<Map<String, Object>> biometryValuesRows =
+ biometryValuesBySpecies.get(speciesId);
+
+ int nbSampleIndiv = addSampleIndividuals(dao,
+ sampleDataDAO,
+ operation,
+ species,
+ sampleTypeIndividual,
+ sampleDataTypeByRaptriCode,
+ biometryScalesByRaptri,
+ biometryValuesRows);
+ nbIndividualSample += nbSampleIndiv;
+
}
}
-
if (log.isInfoEnabled()) {
log.info("Found " + nbSampleTotal + " 'total' sample(s).");
log.info("Found " + nbSampleUnsorted + " 'unsorted' sample(s).");
log.info("Found " + nbSubSample + " 'sub' sample(s).");
- log.info("Total " + (nbSampleTotal + nbSampleUnsorted + nbSubSample) + " sample(s).");
+ log.info("Found " + nbIndividualSample + " 'Individual' sample(s).");
+ log.info("Total " + (nbSampleTotal + nbSampleUnsorted + nbIndividualSample + nbSubSample) + " sample(s).");
}
}
+ private int addSampleIndividuals(TopiaDAO<Sample> dao,
+ SampleDataDAO sampleDataDAO,
+ Operation operation,
+ Species species,
+ SampleType sampleTypeIndividual,
+ Map<String, SampleDataType> sampleDataTypeByRaptriCode,
+ Multimap<Integer, Map<String, Object>> biometryScalesByRaptri,
+ Collection<Map<String, Object>> biometryValuesRows) throws TopiaException {
+ int result = 0;
+ Sample sample = null;
+ Set<Integer> individus = Sets.newHashSet();
+ for (Map<String, Object> biometryValuesRow : biometryValuesRows) {
+ Integer ind = Integer.valueOf(biometryValuesRow.get("NUMIND_VALEUR_BIOMETRIE").toString());
+ Integer codeParameter = (Integer) biometryValuesRow.get("CODE_PARAM_VALEUR_BIOMETRIE");
+ String label = null;
+ Float value = (Float) biometryValuesRow.get("VALEUR_BIOMETRIE");
+ if (value==null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Null value of VALEUR_BIOMETRIE for operationId/Species/Individu/Code param " + operation.getId() + "/" + species.getBaracoudaCode() + "/" + ind+"/"+codeParameter);
+ }
+ continue;
+ }
+ Preconditions.checkNotNull(value, "Null value of VALEUR_BIOMETRIE for operationId/Species/Individu/Code param " + operation.getId() + "/" + species.getBaracoudaCode() + "/" + ind+"/"+codeParameter);
+ SampleDataType sampleDataType = getFK(sampleDataTypeByRaptriCode, String.valueOf(codeParameter));
+
+ boolean add = individus.add(ind);
+ if (add) {
+
+ // new sample
+ sample = dao.create(
+ Sample.PROPERTY_SPECIES, species,
+ Sample.PROPERTY_SAMPLE_TYPE, sampleTypeIndividual
+ );
+
+ operation.addSample(sample);
+ result++;
+ }
+
+ Collection<Map<String, Object>> scalesRows =
+ biometryScalesByRaptri.get(codeParameter);
+
+ if (scalesRows == null) {
+
+ label = "NA";
+ } else {
+
+ // find the correct line
+ int valueAsInteger = value.intValue();
+
+ for (Map<String, Object> scalesRow : scalesRows) {
+ Float scaleCode = (Float) scalesRow.get("Code_echelle");
+ if (valueAsInteger == scaleCode.intValue()) {
+
+ // ok find the correct scale
+ label = (String) scalesRow.get("Descriptif");
+ break;
+ }
+ }
+ }
+ addSampleData(sampleDataDAO,
+ sample,
+ sampleDataType,
+ label,
+ value
+ );
+ }
+ return result;
+ }
+
private void addSubSamples(TopiaDAO<Sample> dao,
SampleDataDAO sampleDataDAO,
SampleType sampleTypeSubsample,
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java 2011-12-16 17:54:16 UTC (rev 199)
@@ -35,7 +35,7 @@
public class SampleLoaderIT extends AbstractLoaderIT<Sample, SampleLoader> {
public SampleLoaderIT() {
- super(SampleLoader.class, 0, 208199);
+ super(SampleLoader.class, 0, 324809);
}
@Test
Modified: trunk/src/doc/reunions/reunion-2011-12-14.txt
===================================================================
--- trunk/src/doc/reunions/reunion-2011-12-14.txt 2011-12-16 01:46:20 UTC (rev 198)
+++ trunk/src/doc/reunions/reunion-2011-12-14.txt 2011-12-16 17:54:16 UTC (rev 199)
@@ -50,6 +50,7 @@
- Remplissage du référentiel Gear
- Import des opérations (depuis table STATIONS)
+- Import des samples (depuis table CAPTURES/MENSURATIONS/BIOMETRIE_VALEURS)
Action
------
1
0
r198 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase echobase-entities/src/main/xmi echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders echobase-tools/src/test/resources/csv/new src/doc/reunions
by tchemit@users.forge.codelutin.com 16 Dec '11
by tchemit@users.forge.codelutin.com 16 Dec '11
16 Dec '11
Author: tchemit
Date: 2011-12-16 02:46:20 +0100 (Fri, 16 Dec 2011)
New Revision: 198
Url: http://forge.codelutin.com/repositories/revision/echobase/198
Log:
Import des Operation + Sample
Added:
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java
trunk/echobase-tools/src/test/resources/csv/new/input-AgeCategory.csv
trunk/echobase-tools/src/test/resources/csv/new/input-SpeciesCategory.csv
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-entities/src/main/xmi/echobase.zargo
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java
trunk/src/doc/reunions/reunion-2011-12-14.txt
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2011-12-15 21:53:41 UTC (rev 197)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -25,6 +25,7 @@
import com.google.common.base.Function;
import fr.ifremer.echobase.entities.data.DataProcessing;
+import fr.ifremer.echobase.entities.data.Operation;
import fr.ifremer.echobase.entities.data.Voyage;
import fr.ifremer.echobase.entities.references.AcousticInstrument;
import fr.ifremer.echobase.entities.references.AreaOfOperation;
@@ -33,6 +34,7 @@
import fr.ifremer.echobase.entities.references.DataType;
import fr.ifremer.echobase.entities.references.DepthStratum;
import fr.ifremer.echobase.entities.references.EchotypeCategory;
+import fr.ifremer.echobase.entities.references.Gear;
import fr.ifremer.echobase.entities.references.Mission;
import fr.ifremer.echobase.entities.references.OperationEvent;
import fr.ifremer.echobase.entities.references.ReferenceDatum;
@@ -40,8 +42,10 @@
import fr.ifremer.echobase.entities.references.SampleDataType;
import fr.ifremer.echobase.entities.references.Species;
import fr.ifremer.echobase.entities.references.Vessel;
+import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.persistence.TopiaEntity;
+import javax.annotation.Nullable;
import java.io.File;
import java.util.Map;
@@ -174,6 +178,20 @@
return input.getName();
}
};
+ public static final Function<Gear, String> GEAR_CASINO_GEAR_NAME = new Function<Gear, String>() {
+ @Override
+ public String apply(Gear input) {
+ //FIXME : Remove the dummy test when all gear in db have a casino name
+ String casinoGearName = input.getCasinoGearName();
+ return StringUtils.isEmpty(casinoGearName) ? input.getName() : casinoGearName;
+ }
+ };
+ public static final Function<Operation, String> OPERATION_ID = new Function<Operation, String>() {
+ @Override
+ public String apply(Operation input) {
+ return input.getId();
+ }
+ };
public static Function<Map<String, Object>, String> newRowFunction(final String key) {
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,56 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.entities.references.AgeCategory;
+import fr.ifremer.echobase.services.models.EntityCsvModel;
+import fr.ifremer.echobase.tools.FileType;
+
+/**
+ * To load {@link AgeCategory} entities.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class AgeCategoryLoader extends EntityLoader<AgeCategory> {
+
+ public AgeCategoryLoader() {
+ super(AgeCategory.class, FileType.NEW);
+ }
+
+
+ @Override
+ protected EntityCsvModel<AgeCategory> createCsvImportModel(TableMeta meta) {
+
+ EntityCsvModel<AgeCategory> model = EntityCsvModel.newModel(
+ getCsvSeparator(),
+ meta
+ );
+ model.newMandatoryColumn(AgeCategory.PROPERTY_NAME);
+ model.newMandatoryColumn(AgeCategory.PROPERTY_MEANING);
+ return model;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellLoader.java 2011-12-15 21:53:41 UTC (rev 197)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/CellLoader.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -118,8 +118,7 @@
super.exportDatas(outputDir, targetType);
// also export Data
- TableMeta dataMeta = getTable(EchoBaseEntityEnum.Data);
- exportData(outputDir, targetType, dataMeta);
+ exportData(outputDir, targetType, getTable(EchoBaseEntityEnum.Data));
}
@Override
@@ -127,14 +126,12 @@
FileType targetType) throws IOException {
super.exportAssociations(outputDir, targetType);
- AssociationMeta associationMeta;
-
// also export cells associations
- associationMeta = getMeta().getAssociations(Cell.PROPERTY_CHILDS);
- exportAssociation(outputDir, targetType, associationMeta);
+ exportAssociation(outputDir, targetType,
+ getMeta().getAssociations(Cell.PROPERTY_CHILDS));
- associationMeta = getMeta().getAssociations(Cell.PROPERTY_DATA);
- exportAssociation(outputDir, targetType, associationMeta);
+ exportAssociation(outputDir, targetType,
+ getMeta().getAssociations(Cell.PROPERTY_DATA));
}
@Override
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java 2011-12-15 21:53:41 UTC (rev 197)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EntityLoader.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -400,22 +400,10 @@
return universe;
}
-// protected <E> E getFK(Map<String, E> universe, String fk) {
-// return getFK(universe, fk, true);
-// }
-
protected <E> E getFK(Map<String, E> universe, String fk) {
-// E entity = universe.get(lowerCase ? fk.toLowerCase() : fk);
E entity = universe.get(fk);
-// if (strict)
- Preconditions.checkNotNull(entity, "Could not find entity with id " + fk);
-// else {
-// if (entity == null) {
-// if (log.isWarnEnabled()) {
-// log.warn("Could not find entity with id " + fk);
-// }
-// }
-// }
+ Preconditions.checkNotNull(entity,
+ "Could not find entity with id " + fk);
return entity;
}
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,350 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.data.GearMetadataValue;
+import fr.ifremer.echobase.entities.data.Operation;
+import fr.ifremer.echobase.entities.data.OperationMetadataValue;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.entities.references.DepthStratum;
+import fr.ifremer.echobase.entities.references.Gear;
+import fr.ifremer.echobase.entities.references.GearMetadata;
+import fr.ifremer.echobase.entities.references.GearMetadataDAO;
+import fr.ifremer.echobase.entities.references.OperationEvent;
+import fr.ifremer.echobase.entities.references.OperationMetadata;
+import fr.ifremer.echobase.entities.references.OperationMetadataDAO;
+import fr.ifremer.echobase.tools.FileType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * To load {@link Operation} entities.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class OperationLoader extends EntityLoader<Operation> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(OperationLoader.class);
+
+ public OperationLoader() {
+ super(Operation.class, EchoBaseEntityEnum.Transect,
+ Transect.PROPERTY_OPERATION, new EchoBaseEntityEnum[]{
+ EchoBaseEntityEnum.OperationMetadata,
+ EchoBaseEntityEnum.GearMetadata
+ },
+ FileType.BARACOUDA);
+ }
+
+ @Override
+ protected void exportDatas(File outputDir, FileType targetType) throws IOException {
+ super.exportDatas(outputDir, targetType);
+
+ // also export OperationMetadataValue
+ exportData(outputDir, targetType,
+ getTable(EchoBaseEntityEnum.OperationMetadataValue));
+
+ // also export GearMetadataValue
+ exportData(outputDir, targetType,
+ getTable(EchoBaseEntityEnum.GearMetadataValue));
+ }
+
+ @Override
+ protected void exportAssociations(File outputDir, FileType targetType) throws IOException {
+ super.exportAssociations(outputDir, targetType);
+
+ TableMeta meta = getMeta();
+
+ // export operation metadata values
+ exportAssociation(outputDir, targetType,
+ meta.getAssociations(Operation.PROPERTY_OPERATION_METADATA_VALUE));
+
+ // export gear metadata values
+ exportAssociation(outputDir, targetType,
+ meta.getAssociations(Operation.PROPERTY_GEAR_METADATA_VALUE));
+ }
+
+ @Override
+ protected void copyAndLoad(File outputDir) throws IOException, TopiaException {
+
+ super.copyAndLoad(outputDir);
+
+ copyAndLoadEntities(outputDir, getTable(EchoBaseEntityEnum.OperationMetadataValue), false, FileType.BARACOUDA);
+ copyAndLoadEntities(outputDir, getTable(EchoBaseEntityEnum.GearMetadataValue), false, FileType.BARACOUDA);
+
+ TableMeta meta = getMeta();
+
+ copyAndLoadEntities(outputDir, meta.getAssociations(Operation.PROPERTY_OPERATION_METADATA_VALUE), false, FileType.ASSOCIATION);
+ copyAndLoadEntities(outputDir, meta.getAssociations(Operation.PROPERTY_GEAR_METADATA_VALUE), false, FileType.ASSOCIATION);
+
+ }
+
+ @Override
+ protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
+
+ Map<String, Voyage> voyagesByName = getUniverse(
+ Voyage.class, EchoBaseFunctions.VOYAGE_NAME);
+
+ Map<String, DepthStratum> depthStratumByName = getUniverse(
+ DepthStratum.class, EchoBaseFunctions.DEPTH_STRATUM_ID);
+
+ Map<String, Gear> gearByCasinoGearName = getUniverse(
+ Gear.class, EchoBaseFunctions.GEAR_CASINO_GEAR_NAME);
+
+ OperationMetadataDAO operationMetadataDAO =
+ (OperationMetadataDAO) getDAO(OperationMetadata.class);
+
+ //SONDE
+ OperationMetadata MeanWaterDepthOperationMeta =
+ operationMetadataDAO.findByName("MeanWaterDepth");
+ Preconditions.checkNotNull(MeanWaterDepthOperationMeta);
+ //JOUR_NUIT
+ OperationMetadata DielPeriodOperationMeta =
+ operationMetadataDAO.findByName("DielPeriod");
+ Preconditions.checkNotNull(DielPeriodOperationMeta);
+ //SONDEDEB
+ OperationMetadata StartWaterDepthOperationMeta = operationMetadataDAO.findByProperties(
+ OperationMetadata.PROPERTY_NAME, "WaterDepth",
+ OperationMetadata.PROPERTY_OPERATION_EVENT + "." + OperationEvent.PROPERTY_NAME, "ShootingStart"
+ );
+ Preconditions.checkNotNull(StartWaterDepthOperationMeta);
+ //SONDEFIN
+ OperationMetadata EndWaterDepthOperationMeta = operationMetadataDAO.findByProperties(
+ OperationMetadata.PROPERTY_NAME, "WaterDepth",
+ OperationMetadata.PROPERTY_OPERATION_EVENT + "." + OperationEvent.PROPERTY_NAME, "HaulingEnd"
+ );
+ Preconditions.checkNotNull(EndWaterDepthOperationMeta);
+
+ GearMetadataDAO gearMetadataDAO =
+ (GearMetadataDAO) getDAO(GearMetadata.class);
+
+ //LFUNES
+ GearMetadata CableLengthGearMeta = gearMetadataDAO.findByType("CableLength");
+ Preconditions.checkNotNull(CableLengthGearMeta);
+
+ //VMIN
+ GearMetadata MinSpeedGearMeta = gearMetadataDAO.findByType("MinSpeed");
+ Preconditions.checkNotNull(MinSpeedGearMeta);
+
+ //VMAX
+ GearMetadata MaxSpeedGearMeta = gearMetadataDAO.findByType("MaxSpeed");
+ Preconditions.checkNotNull(MaxSpeedGearMeta);
+
+ TopiaDAO<Operation> dao = getDAO();
+ TopiaDAO<OperationMetadataValue> operationMetadataValueDAO =
+ getDAO(OperationMetadataValue.class);
+
+ TopiaDAO<GearMetadataValue> gearMetadataValueDAO =
+ getDAO(GearMetadataValue.class);
+
+ Multimap<String, Map<String, Object>> stationByCampagneName = Multimaps.index(
+ db.getTable("STATIONS"), EchoBaseFunctions.newRowFunction("CAMPAGNE"));
+
+ List<Operation> operations = Lists.newArrayList();
+
+ List<String> messages = Lists.newArrayList();
+
+ for (String voyageName : stationByCampagneName.keySet()) {
+ Voyage voyage = voyagesByName.get(voyageName);
+ Preconditions.checkNotNull(voyage);
+ Transit transit = voyage.getTransit().iterator().next();
+ Preconditions.checkNotNull(transit);
+ Transect transect = transit.getTransect().iterator().next();
+ Preconditions.checkNotNull(transect);
+ Collection<Map<String, Object>> rows =
+ stationByCampagneName.get(voyageName);
+ for (Map<String, Object> row : rows) {
+
+ String status = (String) row.get("ETAT");
+ if ("FICTIF".equalsIgnoreCase(status)) {
+
+ // skip fictif operation
+ continue;
+ }
+ String operationId = (String) row.get("NOSTA");
+
+ DepthStratum depthStratum = null;
+ String depthStratumId = (String) row.get("STA_IMAGES");
+ if (StringUtils.isBlank(depthStratumId) ||
+ "nul".equals(depthStratumId)) {
+ messages.add("No depthStraum defined");
+ } else {
+ depthStratum = getFK(depthStratumByName, depthStratumId.trim());
+ }
+
+ String gearId = (String) row.get("ENGIN");
+ if (gearId == null) {
+ messages.add("No gear id");
+ } else {
+ Gear gear = getFK(gearByCasinoGearName, gearId);
+
+ Float shootingStartLatitude = (Float) row.get("LATDEB");
+ if (shootingStartLatitude == null) {
+ messages.add("No shootingStartLatitude");
+ shootingStartLatitude = 0f;
+ }
+ Float shootingEndLatitude = (Float) row.get("LATDD");
+ if (shootingEndLatitude == null) {
+ messages.add("No shootingEndLatitude");
+ shootingEndLatitude = 0f;
+ }
+ Float shootingStartLongitude = (Float) row.get("LGDEB");
+ if (shootingStartLongitude == null) {
+ messages.add("No shootingStartLongitude");
+ shootingStartLongitude = 0f;
+ }
+ Float shootingEndLongitude = (Float) row.get("LGDD");
+ if (shootingEndLongitude == null) {
+ messages.add("No shootingEndLongitude");
+ shootingEndLongitude = 0f;
+ }
+
+ Date shootingStartTime = (Date) row.get("DHTUDEB");
+ Date shootingEndTime = (Date) row.get("DHTUFIN");
+
+ String comment = (String) row.get("COMMENTAIRE");
+
+ // create a operation
+ Operation operation = dao.create(
+ Operation.PROPERTY_ID, operationId,
+ Operation.PROPERTY_DEPTH_STRATUM, depthStratum,
+ Operation.PROPERTY_GEAR, gear,
+ Operation.PROPERTY_GEAR_SHOOTING_START_LATITUDE, shootingStartLatitude,
+ Operation.PROPERTY_GEAR_SHOOTING_END_LATITUDE, shootingEndLatitude,
+ Operation.PROPERTY_GEAR_SHOOTING_START_LONGITUDE, shootingStartLongitude,
+ Operation.PROPERTY_GEAR_SHOOTING_END_LONGITUDE, shootingEndLongitude,
+ Operation.PROPERTY_GEAR_SHOOTING_START_TIME, shootingStartTime,
+ Operation.PROPERTY_GEAR_SHOOTING_END_TIME, shootingEndTime,
+ Operation.PROPERTY_COMMENT, comment
+ );
+
+ addOperationMetadataValue(operationMetadataValueDAO,
+ operation,
+ MeanWaterDepthOperationMeta,
+ row.get("SONDE"));
+
+ addOperationMetadataValue(operationMetadataValueDAO,
+ operation,
+ DielPeriodOperationMeta,
+ row.get("JOUR_NUIT"));
+
+ addOperationMetadataValue(operationMetadataValueDAO,
+ operation,
+ StartWaterDepthOperationMeta,
+ row.get("SONDEDEB"));
+
+ addOperationMetadataValue(operationMetadataValueDAO,
+ operation,
+ EndWaterDepthOperationMeta,
+ row.get("SONDEFIN"));
+
+ addGearMetadataValue(gearMetadataValueDAO,
+ operation,
+ CableLengthGearMeta,
+ row.get("LFUNES"));
+
+ addGearMetadataValue(gearMetadataValueDAO,
+ operation,
+ MinSpeedGearMeta,
+ row.get("VMIN"));
+
+ addGearMetadataValue(gearMetadataValueDAO,
+ operation,
+ MaxSpeedGearMeta,
+ row.get("VMAX"));
+
+ operations.add(operation);
+ transect.addOperation(operation);
+
+ }
+ if (!messages.isEmpty()) {
+
+ if (log.isWarnEnabled()) {
+ log.warn("For operation " + operationId + ", status " + status + " : " + messages);
+ }
+ messages.clear();
+ }
+ }
+ }
+
+ if (log.isInfoEnabled()) {
+ log.info("Found " + operations.size() + " operation(s).");
+ }
+ }
+
+ protected void addOperationMetadataValue(TopiaDAO<OperationMetadataValue> dao,
+ Operation operation,
+ OperationMetadata meta,
+ Object value
+ ) throws TopiaException {
+ if (value == null) {
+ return;
+ }
+ OperationMetadataValue operationMetadataValue = dao.create(
+ OperationMetadataValue.PROPERTY_OPERATION_METADATA, meta,
+ OperationMetadataValue.PROPERTY_DATA_VALUE, value.toString()
+ );
+ operation.addOperationMetadataValue(operationMetadataValue);
+ }
+
+ protected void addGearMetadataValue(TopiaDAO<GearMetadataValue> dao,
+ Operation operation,
+ GearMetadata meta,
+ Object value
+ ) throws TopiaException {
+
+ if (value == null) {
+ return;
+ }
+ GearMetadataValue gearMetadataValue = dao.create(
+ GearMetadataValue.PROPERTY_GEAR_METADATA, meta,
+ GearMetadataValue.PROPERTY_DATA_VALUE, value.toString(),
+ GearMetadataValue.PROPERTY_GEAR, operation.getGear()
+ );
+ operation.addGearMetadataValue(gearMetadataValue);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/OperationLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,329 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.data.Operation;
+import fr.ifremer.echobase.entities.data.Sample;
+import fr.ifremer.echobase.entities.data.SampleData;
+import fr.ifremer.echobase.entities.data.SampleDataDAO;
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.entities.references.SampleDataType;
+import fr.ifremer.echobase.entities.references.SampleDataTypeDAO;
+import fr.ifremer.echobase.entities.references.SampleType;
+import fr.ifremer.echobase.entities.references.SampleTypeDAO;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.tools.FileType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * To load {@link Sample} entities.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SampleLoader extends EntityLoader<Sample> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(SampleLoader.class);
+
+ public SampleLoader() {
+ super(Sample.class, EchoBaseEntityEnum.Operation,
+ Operation.PROPERTY_SAMPLE, new EchoBaseEntityEnum[]{
+ EchoBaseEntityEnum.SampleDataType,
+ EchoBaseEntityEnum.SampleType,
+ },
+ FileType.BARACOUDA);
+ }
+
+ @Override
+ protected void exportDatas(File outputDir, FileType targetType) throws IOException {
+ super.exportDatas(outputDir, targetType);
+
+ exportData(outputDir, targetType,
+ getTable(EchoBaseEntityEnum.SampleData));
+ }
+
+ @Override
+ protected void exportAssociations(File outputDir, FileType targetType) throws IOException {
+ super.exportAssociations(outputDir, targetType);
+
+ TableMeta meta = getMeta();
+
+ exportAssociation(outputDir, targetType,
+ meta.getAssociations(Sample.PROPERTY_SAMPLE_DATA));
+
+ }
+
+ @Override
+ protected void copyAndLoad(File outputDir) throws IOException, TopiaException {
+
+ super.copyAndLoad(outputDir);
+
+ copyAndLoadEntities(outputDir, getTable(EchoBaseEntityEnum.SampleData), false, FileType.BARACOUDA);
+
+ TableMeta meta = getMeta();
+
+ copyAndLoadEntities(outputDir, meta.getAssociations(Sample.PROPERTY_SAMPLE_DATA), false, FileType.ASSOCIATION);
+
+ }
+
+ @Override
+ protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
+
+ Map<String, Operation> operationById = getUniverse(
+ Operation.class, EchoBaseFunctions.OPERATION_ID);
+
+ Map<String, Species> speciesByName = getUniverse(
+ Species.class, EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
+
+ Multimap<String, Map<String, Object>> mensurationByNosta = Multimaps.index(
+ db.getTable("MENSURATIONS", true),
+ EchoBaseFunctions.newRowFunction("NOSTA")
+ );
+
+ Multimap<String, Map<String, Object>> capturesByNosta = Multimaps.index(
+ db.getTable("CAPTURES", true),
+ EchoBaseFunctions.newRowFunction("NOSTA")
+ );
+ SampleTypeDAO sampleTypeDAO =
+ (SampleTypeDAO) getDAO(SampleType.class);
+
+ SampleType sampleTypeTotal = sampleTypeDAO.findByName("Total");
+ Preconditions.checkNotNull(sampleTypeTotal);
+ SampleType sampleTypeUnsorted = sampleTypeDAO.findByName("Unsorted");
+ Preconditions.checkNotNull(sampleTypeUnsorted);
+ SampleType sampleTypeSubsample = sampleTypeDAO.findByName("Subsample");
+ Preconditions.checkNotNull(sampleTypeSubsample);
+
+ SampleDataTypeDAO sampleDataTypeDAO =
+ (SampleDataTypeDAO) getDAO(SampleDataType.class);
+
+ SampleDataDAO sampleDataDAO = (SampleDataDAO) getDAO(SampleData.class);
+
+ SampleDataType sampleDataTypeMeanLength = sampleDataTypeDAO.findByName("MeanLengthcm");
+ Preconditions.checkNotNull(sampleDataTypeMeanLength);
+ SampleDataType sampleDataTypeMeanWeight = sampleDataTypeDAO.findByName("MeanWeightg");
+ Preconditions.checkNotNull(sampleDataTypeMeanWeight);
+ SampleDataType sampleDataTypeNoPerKg = sampleDataTypeDAO.findByName("NoPerKg");
+ Preconditions.checkNotNull(sampleDataTypeNoPerKg);
+ SampleDataType sampleDataTypeNumberAtLength = sampleDataTypeDAO.findByName("NumberAtLength");
+ Preconditions.checkNotNull(sampleDataTypeNumberAtLength);
+ SampleDataType sampleDataTypeWeightAtLength = sampleDataTypeDAO.findByName("WeightAtLengthkg");
+ Preconditions.checkNotNull(sampleDataTypeWeightAtLength);
+
+ TopiaDAO<Sample> dao = getDAO();
+
+ int nbSampleUnsorted = 0;
+ int nbSampleTotal = 0;
+ int nbSubSample = 0;
+
+ for (String operationId : capturesByNosta.keySet()) {
+ Preconditions.checkNotNull(operationId);
+ Operation operation = operationById.get(operationId);
+ if (operation == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Operation " + operationId + " not found...");
+ }
+ continue;
+ }
+ for (Map<String, Object> row : capturesByNosta.get(operationId)) {
+ String type = (String) row.get("CATEG");
+
+ SampleType sampleType;
+
+ if ("H".equals(type)) {
+ sampleType = sampleTypeUnsorted;
+ nbSampleUnsorted++;
+ } else {
+ sampleType = sampleTypeTotal;
+ nbSampleTotal++;
+ }
+
+ String speciesId = (String) row.get("GENRE_ESP");
+ Species species = getFK(speciesByName, speciesId);
+
+ Integer number = (Integer) row.get("NTOT");
+ if (number == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("NTOT is null for operation " + operationId + "/" + speciesId);
+ }
+ number = 0;
+ }
+ Float weight = (Float) row.get("PT_ESP");
+
+ Sample sample = dao.create(
+ Sample.PROPERTY_SPECIES, species,
+ Sample.PROPERTY_SAMPLE_TYPE, sampleType,
+ Sample.PROPERTY_NUMBER_SAMPLED, number,
+ Sample.PROPERTY_SAMPLE_WEIGHT, weight
+ );
+
+ operation.addSample(sample);
+
+ addSampleData(sampleDataDAO,
+ sample,
+ sampleDataTypeMeanWeight,
+ "NA",
+ row.get("PMOY"));
+
+ addSampleData(sampleDataDAO,
+ sample,
+ sampleDataTypeMeanLength,
+ "NA",
+ row.get("LMOY"));
+
+ addSampleData(sampleDataDAO,
+ sample,
+ sampleDataTypeNoPerKg,
+ "NA",
+ row.get("MOULE_MENS"));
+
+ Collection<Map<String, Object>> mesnurationRows =
+ mensurationByNosta.get(operationId);
+
+ Float sampleWeight = (Float) row.get("PESP_MENS");
+ if (sampleWeight == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("PESP_MENS is null for operation " + operationId + "/" + speciesId);
+ }
+ sampleWeight = 0f;
+ }
+ addSubSamples(dao,
+ sampleDataDAO,
+ sampleTypeSubsample,
+ sampleDataTypeNumberAtLength,
+ sampleDataTypeWeightAtLength,
+ operation,
+ type,
+ species,
+ sampleWeight,
+ mesnurationRows);
+
+ int nbSamples = operation.sizeSample();
+ nbSubSample += nbSamples - 1;
+ }
+ }
+
+
+ if (log.isInfoEnabled()) {
+ log.info("Found " + nbSampleTotal + " 'total' sample(s).");
+ log.info("Found " + nbSampleUnsorted + " 'unsorted' sample(s).");
+ log.info("Found " + nbSubSample + " 'sub' sample(s).");
+ log.info("Total " + (nbSampleTotal + nbSampleUnsorted + nbSubSample) + " sample(s).");
+ }
+ }
+
+ private void addSubSamples(TopiaDAO<Sample> dao,
+ SampleDataDAO sampleDataDAO,
+ SampleType sampleTypeSubsample,
+ SampleDataType sampleDataTypeNumberAtLength,
+ SampleDataType sampleDataTypeWeightAtLength,
+ Operation operation,
+ String type,
+ Species species,
+ Float sampleWeight,
+ Collection<Map<String, Object>> mesnurationRows) throws TopiaException {
+
+ String speciesId = species.getBaracoudaCode();
+
+ for (Map<String, Object> row : mesnurationRows) {
+ String categ = (String) row.get("CATEG");
+ if (!type.equals(categ)) {
+
+ // not good category
+ continue;
+ }
+ String rowSpeciesId = (String) row.get("GENRE_ESP");
+ if (!speciesId.equals(rowSpeciesId)) {
+
+ // not good species
+ continue;
+ }
+
+ // ok found a good row
+ Sample subsample = dao.create(
+ Sample.PROPERTY_SPECIES, species,
+ Sample.PROPERTY_SAMPLE_TYPE, sampleTypeSubsample,
+ Sample.PROPERTY_SAMPLE_WEIGHT, sampleWeight
+ );
+
+ Object lengthClass = row.get("TAILLE");
+
+ addSampleData(sampleDataDAO,
+ subsample,
+ sampleDataTypeNumberAtLength,
+ lengthClass,
+ row.get("NBIND")
+ );
+
+ addSampleData(sampleDataDAO,
+ subsample,
+ sampleDataTypeWeightAtLength,
+ lengthClass,
+ row.get("POIDSTAILLE")
+ );
+
+
+ operation.addSample(subsample);
+
+ }
+ }
+
+
+ protected void addSampleData(TopiaDAO<SampleData> dao,
+ Sample operation,
+ SampleDataType sampleDataType,
+ Object label,
+ Object value
+ ) throws TopiaException {
+
+ if (value == null || label == null) {
+ return;
+ }
+
+ SampleData sampleData = dao.create(
+ SampleData.PROPERTY_SAMPLE_DATA_TYPE, sampleDataType,
+ SampleData.PROPERTY_DATA_LABEL, label.toString(),
+ SampleData.PROPERTY_DATA_VALUE, Float.valueOf(value.toString())
+ );
+ operation.addSampleData(sampleData);
+ }
+
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,58 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import fr.ifremer.echobase.services.models.EntityCsvModel;
+import fr.ifremer.echobase.tools.FileType;
+
+/**
+ * To load {@link SpeciesCategory} entities.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SpeciesCategoryLoader extends EntityLoader<SpeciesCategory> {
+
+ public SpeciesCategoryLoader() {
+ super(SpeciesCategory.class, FileType.NEW);
+ }
+
+
+ @Override
+ protected EntityCsvModel<SpeciesCategory> createCsvImportModel(TableMeta meta) {
+
+ EntityCsvModel<SpeciesCategory> model = EntityCsvModel.newModel(
+ getCsvSeparator(),
+ meta
+ );
+ model.newMandatoryColumn(SpeciesCategory.PROPERTY_SPECIES);
+ model.newMandatoryColumn(SpeciesCategory.PROPERTY_SIZE_CATEGORY);
+ model.newMandatoryColumn(SpeciesCategory.PROPERTY_AGE_CATEGORY);
+ model.newMandatoryColumn(SpeciesCategory.PROPERTY_SEX_CATEGORY);
+ return model;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -362,6 +362,9 @@
entityLoaders.add(newService(SizeCategoryLoader.class));
entityLoaders.add(newService(OperationMetadataLoader.class));
entityLoaders.add(newService(GearMetadataLoader.class));
+ entityLoaders.add(newService(GearLoader.class));
+ entityLoaders.add(newService(AgeCategoryLoader.class));
+ entityLoaders.add(newService(SpeciesCategoryLoader.class));
entityLoaders.add(newService(VoyageLoader.class));
entityLoaders.add(newService(TransitLoader.class));
@@ -369,6 +372,7 @@
entityLoaders.add(newService(DataAcquisitionLoader.class));
entityLoaders.add(newService(DataProcessingLoader.class));
entityLoaders.add(newService(CellLoader.class));
+ entityLoaders.add(newService(OperationLoader.class));
}
return entityLoaders;
}
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoaderIT.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.AgeCategory;
+import org.junit.Test;
+
+/**
+ * To test the {@link AgeCategoryLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class AgeCategoryLoaderIT extends AbstractLoaderIT<AgeCategory, AgeCategoryLoader> {
+
+ public AgeCategoryLoaderIT() {
+ super(AgeCategoryLoader.class, 0, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AgeCategoryLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.data.Operation;
+import org.junit.Test;
+
+/**
+ * To test the {@link OperationLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class OperationLoaderIT extends AbstractLoaderIT<Operation, OperationLoader> {
+
+ public OperationLoaderIT() {
+ super(OperationLoader.class, 0, 1374);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.data.Sample;
+import org.junit.Test;
+
+/**
+ * To test the {@link SampleLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SampleLoaderIT extends AbstractLoaderIT<Sample, SampleLoader> {
+
+ public SampleLoaderIT() {
+ super(SampleLoader.class, 0, 208199);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import org.junit.Test;
+
+/**
+ * To test the {@link SpeciesCategoryLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SpeciesCategoryLoaderIT extends AbstractLoaderIT<SpeciesCategory, SpeciesCategoryLoader> {
+
+ public SpeciesCategoryLoaderIT() {
+ super(SpeciesCategoryLoader.class, 0, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesCategoryLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/test/resources/csv/new/input-AgeCategory.csv
===================================================================
--- trunk/echobase-tools/src/test/resources/csv/new/input-AgeCategory.csv (rev 0)
+++ trunk/echobase-tools/src/test/resources/csv/new/input-AgeCategory.csv 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1 @@
+name;meaning
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/resources/csv/new/input-AgeCategory.csv
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-tools/src/test/resources/csv/new/input-SpeciesCategory.csv
===================================================================
--- trunk/echobase-tools/src/test/resources/csv/new/input-SpeciesCategory.csv (rev 0)
+++ trunk/echobase-tools/src/test/resources/csv/new/input-SpeciesCategory.csv 2011-12-16 01:46:20 UTC (rev 198)
@@ -0,0 +1 @@
+species;sizeCategory;ageCategory;sexCategory
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/resources/csv/new/input-SpeciesCategory.csv
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/doc/reunions/reunion-2011-12-14.txt
===================================================================
--- trunk/src/doc/reunions/reunion-2011-12-14.txt 2011-12-15 21:53:41 UTC (rev 197)
+++ trunk/src/doc/reunions/reunion-2011-12-14.txt 2011-12-16 01:46:20 UTC (rev 198)
@@ -49,6 +49,8 @@
- Remplissage du référentiel GearMetadata
- Remplissage du référentiel Gear
+- Import des opérations (depuis table STATIONS)
+
Action
------
1
0
15 Dec '11
Author: tchemit
Date: 2011-12-15 22:53:41 +0100 (Thu, 15 Dec 2011)
New Revision: 197
Url: http://forge.codelutin.com/repositories/revision/echobase/197
Log:
- rename LoaderTest to LoaderIT (otherwise run-loaders profile can not work)
- fill Gear references
- prepare Operation model
Added:
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderIT.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderIT.java
trunk/echobase-tools/src/test/resources/csv/new/input-Gear.csv
Removed:
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderTest.java
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-entities/src/main/xmi/echobase.zargo
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/CsvModelUtil.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/EntityCsvModel.java
trunk/echobase-tools/pom.xml
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java
trunk/src/doc/reunions/reunion-2011-12-14.txt
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseDecoratorProvider.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -59,7 +59,6 @@
import fr.ifremer.echobase.entities.references.GearCharacteristic;
import fr.ifremer.echobase.entities.references.GearCharacteristicValue;
import fr.ifremer.echobase.entities.references.GearMetadata;
-import fr.ifremer.echobase.entities.references.GearType;
import fr.ifremer.echobase.entities.references.Impacte;
import fr.ifremer.echobase.entities.references.LengthAgeKey;
import fr.ifremer.echobase.entities.references.MeasureType;
@@ -169,9 +168,6 @@
// GearMetadataValue decorator
registerJXPathDecorator(locale, GearMetadataValue.class, "${dataValue}$s");
- // GearType decorator
- registerJXPathDecorator(locale, GearType.class, "${name}$s");
-
// Impacte decorator
registerJXPathDecorator(locale, Impacte.class, "${measurementUnit}$s - ${species.genusSpecies}");
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntitiesUtil.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -105,7 +105,6 @@
result.add(EchoBaseEntityEnum.CellMethod);
result.add(EchoBaseEntityEnum.AcousticInstrument);
result.add(EchoBaseEntityEnum.CategoryType);
- result.add(EchoBaseEntityEnum.GearType);
result.add(EchoBaseEntityEnum.CategoryMeaning);
result.add(EchoBaseEntityEnum.Species);
result.add(EchoBaseEntityEnum.GearCharacteristic);
@@ -173,6 +172,7 @@
result.add(EchoBaseEntityEnum.DataMetadata);
result.add(EchoBaseEntityEnum.OperationMetadata);
result.add(EchoBaseEntityEnum.GearMetadata);
+ result.add(EchoBaseEntityEnum.Gear);
return result.toArray(new EchoBaseEntityEnum[result.size()]);
}
Modified: trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
===================================================================
--- trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-12-15 21:53:41 UTC (rev 197)
@@ -5,6 +5,7 @@
echobase.common.acousticDensityUnit=
echobase.common.acousticInstrument=
echobase.common.acquisitionSoftwareVersion=
+echobase.common.active=
echobase.common.addOffset=
echobase.common.admin=Administrateur
echobase.common.age=
@@ -26,6 +27,7 @@
echobase.common.calendar=
echobase.common.calibration=calibration
echobase.common.callsign=
+echobase.common.casinoGearName=
echobase.common.category=
echobase.common.categoryMeaning=
echobase.common.categoryRef=
@@ -78,11 +80,13 @@
echobase.common.exportQuery=Requête d'export
echobase.common.exportQueryDTO=
echobase.common.fillValue=
+echobase.common.fishingGear=
echobase.common.flagMeanings=
echobase.common.frequency=
echobase.common.gear=
echobase.common.gearCharacteristic=
echobase.common.gearCharacteristicValue=
+echobase.common.gearClassification=
echobase.common.gearMetadata=
echobase.common.gearMetadataValue=
echobase.common.gearShootingEndLatitude=
@@ -108,6 +112,7 @@
echobase.common.institution=Institution
echobase.common.invalidSince=
echobase.common.keywords=Môts clefs
+echobase.common.label=
echobase.common.lastModifiedDate=Date de dernière modification
echobase.common.lastModifiedUser=Utilisateur de dernière modification
echobase.common.length=
@@ -153,6 +158,7 @@
echobase.common.operator=
echobase.common.organisationLevelAcknowledgements=
echobase.common.organisationReferences=
+echobase.common.parentGear=
echobase.common.password=Mot de passe
echobase.common.percentAtAge=
echobase.common.pingDutyCycle=
@@ -196,6 +202,7 @@
echobase.common.startLocality=
echobase.common.startPort=
echobase.common.startTime=
+echobase.common.status=
echobase.common.strata=
echobase.common.taxonCode=
echobase.common.taxonFatherMemocode=
@@ -205,6 +212,7 @@
echobase.common.timeCoverageStart=
echobase.common.title=
echobase.common.tonnage=
+echobase.common.towed=
echobase.common.transceiverAcquisitionAbsorption=
echobase.common.transceiverAcquisitionAbsorptionDescription=
echobase.common.transceiverAcquisitionGain=
@@ -240,6 +248,7 @@
echobase.common.type=
echobase.common.unit=
echobase.common.units=
+echobase.common.updateDate=
echobase.common.validMax=
echobase.common.validMin=
echobase.common.validSince=
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/CsvModelUtil.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/CsvModelUtil.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/CsvModelUtil.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -40,6 +40,7 @@
import java.text.ParseException;
import java.util.Collection;
+import java.util.Date;
import java.util.Locale;
import java.util.Map;
@@ -83,6 +84,55 @@
return new AssociationValueParserFormatter<E>(entityType, universe);
}
+ public static final ValueParser<Date> IMPORT_DAY = new DateValue("dd/MM/yy");
+
+ public static class BooleanParserFormatter extends NullableParserFormatter<Boolean> {
+
+ public BooleanParserFormatter(Boolean defaultValue, boolean nullAllowed) {
+ super(defaultValue, nullAllowed);
+ }
+
+ @Override
+ public String format(Boolean bool) {
+ String value;
+ if (bool == null) {
+ if (nullAllowed) {
+ value = "?";
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else if (bool) {
+ value = "Y";
+ } else {
+ value = "N";
+ }
+ return value;
+ }
+
+ @Override
+ protected Boolean parseNoneEmptyValue(String value) {
+ Boolean result;
+ if ("?".equals(value)) {
+ result = null;
+ } else if ("Y".equals(value)) {
+ result = true;
+ } else if ("N".equals(value)) {
+ result = false;
+ } else {
+ result = Boolean.parseBoolean(value);
+ }
+ return result;
+ }
+ }
+
+ public static final ValueParser<Boolean> INT_TO_BOOLEAN_PARSER = new ValueParser<Boolean>() {
+
+ @Override
+ public Boolean parse(String value) {
+ return "1".equals(value);
+ }
+ };
+
public static class AssociationValueParserFormatter<E extends TopiaEntity> implements ValueParserFormatter<Collection<E>> {
protected final Class<E> entityType;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/EntityCsvModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/EntityCsvModel.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/models/EntityCsvModel.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -30,6 +30,7 @@
import org.nuiton.util.csv.ImportExportModel;
import org.nuiton.util.csv.ImportableColumn;
import org.nuiton.util.csv.ModelBuilder;
+import org.nuiton.util.csv.ValueParser;
import java.util.Collection;
import java.util.Date;
@@ -232,6 +233,10 @@
return modelBuilder.newMandatoryColumn(headerName, headerName);
}
+ public <T> ImportableColumn<E, T> newMandatoryColumn(String headerName, String propertyName, ValueParser<T> valueParser) {
+ return modelBuilder.newMandatoryColumn(headerName, valueParser, CsvModelUtil.<E, T>newBeanProperty(propertyName));
+ }
+
protected EntityCsvModel(char separator,
TableMeta tableMeta) {
this.separator = separator;
Modified: trunk/echobase-tools/pom.xml
===================================================================
--- trunk/echobase-tools/pom.xml 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/pom.xml 2011-12-15 21:53:41 UTC (rev 197)
@@ -132,37 +132,21 @@
</plugin>
</plugins>
</pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <excludes>**/*LoaderTest.java</excludes>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
</build>
<profiles>
<profile>
<id>run-loaders</id>
- <activation>
- <property>
- <name>runLoaders</name>
- <value>true</value>
- </property>
- </activation>
<build>
+ <defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
- <include>**/*LoaderTest.java</include>
+ <include>**/*LoaderIT.java</include>
</includes>
</configuration>
</plugin>
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/EchotypeLoader.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -42,162 +42,10 @@
*/
public class EchotypeLoader extends EntityLoader<Echotype> {
-// /** Logger. */
-// private static final Log log =
-// LogFactory.getLog(EchotypeLoader.class);
-
public EchotypeLoader() {
super(Echotype.class, FileType.NEW);
}
-// @Override
-// protected void importBaracoudaEntities(Database db) throws IOException, TopiaException {
-//
-// // require referenceDatum, dataType and cellMethod
-//
-// TopiaContext tx = serviceContext.getTransaction();
-//
-// List<DepthStratum> allDepthStratum = EchoBaseDAOHelper.getDepthStratumDAO(tx).findAll();
-// ImmutableMap<String, DepthStratum> depthStratumsById = Maps.uniqueIndex(allDepthStratum, EchoBaseFunctions.DEPTH_STRATUM_ID);
-//
-// List<EchotypeCategory> allEchotypeCategory = EchoBaseDAOHelper.getEchotypeCategoryDAO(tx).findAll();
-// ImmutableMap<String, EchotypeCategory> categoriesByName = Maps.uniqueIndex(allEchotypeCategory, EchoBaseFunctions.ECHO_TYPE_CATEGORY_NAME);
-//
-// // get all descriptions of echotyped indexed by their id
-// Map<Integer, Map<String, Object>> descriptEchoById = Maps.uniqueIndex(
-// db.getTable("EIT_DESCRIPT_ECHOS"), EchoBaseFunctions.newRowIntegerFunction("ID_DESCRIPTION_DEVIATION"));
-//
-// // obtain Species fro table ESPECE_ECHOS
-// ImmutableListMultimap<Integer, Map<String, Object>> especeEchoById = Multimaps.index(
-// db.getTable("ESPECE_ECHOS"), EchoBaseFunctions.newRowIntegerFunction("CODE_DESCRIPTION_DEVIATION"));
-//
-//
-// Set<Integer> ids = descriptEchoById.keySet();
-//
-// // obtain for each id the corresponding name in EIT_VALEUR_ECHOS
-// Map<Integer, String> pairs = Maps.newTreeMap();
-// for (Map<String, Object> row : db.getTable("EIT_VALEUR_ECHOS")) {
-// Integer id = (Integer) row.get("ID_DESCRIPTION_DEVIATION");
-// String name = (String) row.get("LIBELLE_DEVIATION");
-// if (!pairs.containsKey(id)) {
-//
-// // this id is new push the name
-// pairs.put(id, name);
-// if (pairs.size() == ids.size()) {
-// // ok all ids are covered
-// break;
-// }
-// }
-// }
-//
-// SpeciesDAO speciesDAO = EchoBaseDAOHelper.getSpeciesDAO(tx);
-//
-// TopiaDAO<Echotype> dao = getDAO();
-//
-// List<Echotype> echotypes = Lists.newArrayList();
-//
-// Set<String> missingDepthStratum = Sets.newHashSet();
-// Set<String> missingCategories = Sets.newHashSet();
-// Set<String> missingSpecies = Sets.newHashSet();
-//
-// // to get a cache of species
-// Map<String, Species> speciesMap = Maps.newTreeMap();
-//
-// for (Map.Entry<Integer, Map<String, Object>> entry : descriptEchoById.entrySet()) {
-// Map<String, Object> row = entry.getValue();
-//
-// Integer id = entry.getKey();
-//
-// String name = pairs.get(id);
-//
-// String meaning = (String) row.get("LIBELLE_DESCRIPTION_DEVIATION");
-//
-// // get echotype category
-// String categoryId = (String) row.get("TYPE_DEVIATION");
-// EchotypeCategory echotypeCategory = categoriesByName.get(categoryId.toLowerCase());
-// if (echotypeCategory == null) {
-// missingCategories.add(categoryId);
-// }
-//
-// // get echotype depthstratum
-// String depthStratumId = (String) row.get("IMAGES");
-// DepthStratum depthStratum = depthStratumsById.get(depthStratumId.toLowerCase());
-// if (depthStratum == null) {
-// missingDepthStratum.add(depthStratumId);
-// }
-//
-// // get all species for this id
-// ImmutableList<Map<String, Object>> speciesRows = especeEchoById.get(id);
-// for (Map<String, Object> speciesRow : speciesRows) {
-//
-// String speciesId = (String) speciesRow.get("GENRE_ESP");
-// Species species;
-// if (speciesMap.containsKey(speciesId.toLowerCase())) {
-//
-// // already in cache (even if was a not found species)
-// species = speciesMap.get(speciesId.toLowerCase());
-// } else {
-//
-// // first time this species is requested
-// species = speciesDAO.findByBaracoudaCode(speciesId);
-//
-// if (species == null) {
-// missingSpecies.add(speciesId);
-// }
-// speciesMap.put(speciesId.toLowerCase(), species);
-// }
-//
-// Echotype echotype = dao.create(Echotype.PROPERTY_ID, id,
-// Echotype.PROPERTY_NAME, name
-// );
-//
-// echotype.setSpecies(species);
-// echotype.setMeaning(meaning);
-// echotype.setSpecies(species);
-// echotype.setEchotypeCategory(echotypeCategory);
-// echotype.setDepthStratum(depthStratum);
-//
-// echotypes.add(echotype);
-// }
-// }
-//
-// if (!missingDepthStratum.isEmpty()) {
-//
-// // there is some missing id in this table
-// List<String> missingDepthStratumList = Lists.newArrayList(missingDepthStratum);
-// Collections.sort(missingDepthStratumList);
-//
-// if (log.isWarnEnabled()) {
-// log.warn("There is " + missingDepthStratumList.size() + " missing depth stratum ids in table EIT_DESCRIPT_ECHOS : " + missingDepthStratumList);
-// }
-// }
-// if (!missingCategories.isEmpty()) {
-//
-// // there is some missing id in this table
-// List<String> missingCategoriesList = Lists.newArrayList(missingDepthStratum);
-// Collections.sort(missingCategoriesList);
-//
-// if (log.isWarnEnabled()) {
-// log.warn("There is " + missingCategories.size() + " missing echotypecategories ids in table EIT_DESCRIPT_ECHOS : " + missingCategoriesList);
-// }
-// }
-//
-// if (!missingSpecies.isEmpty()) {
-//
-// // there is some missing id in this table
-// List<String> missingSpeciesList = Lists.newArrayList(missingSpecies);
-// Collections.sort(missingSpeciesList);
-//
-// if (log.isWarnEnabled()) {
-// log.warn("There is " + missingSpeciesList.size() + " missing species baracouda codesids in table ESPECE_ECHOS : " + missingSpeciesList);
-// }
-// }
-//
-// if (log.isInfoEnabled()) {
-// log.info("Found " + echotypes.size() + " Echotype(s).");
-// }
-// }
-
@Override
protected EntityCsvModel<Echotype> createCsvImportModel(TableMeta meta) {
Added: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java (rev 0)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,72 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.entities.references.Gear;
+import fr.ifremer.echobase.services.models.CsvModelUtil;
+import fr.ifremer.echobase.services.models.EntityCsvModel;
+import fr.ifremer.echobase.tools.FileType;
+
+import java.util.Date;
+
+/**
+ * {@link Gear} loader.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class GearLoader extends EntityLoader<Gear> {
+
+ public GearLoader() {
+ super(Gear.class, FileType.NEW);
+ }
+
+ @Override
+ protected EntityCsvModel<Gear> createCsvImportModel(TableMeta meta) {
+
+ EntityCsvModel<Gear> model = EntityCsvModel.newModel(
+ getCsvSeparator(),
+ meta
+ );
+
+ /*
+ CasinoGearName;ValidSince;InvalidSince;IsFishingGear;gearLabel;GearName;Description;UpdateDate;GearClassification;ParentGear;Status;IsActive;IsTowed
+ */
+ model.newMandatoryColumn("CasinoGearName", Gear.PROPERTY_CASINO_GEAR_NAME);
+ model.newMandatoryColumn("ValidSince", Gear.PROPERTY_VALID_SINCE, CsvModelUtil.IMPORT_DAY);
+ model.newMandatoryColumn("InvalidSince", Gear.PROPERTY_INVALID_SINCE, CsvModelUtil.IMPORT_DAY);
+ model.newMandatoryColumn("IsFishingGear", Gear.PROPERTY_FISHING_GEAR, CsvModelUtil.INT_TO_BOOLEAN_PARSER);
+ model.newMandatoryColumn("gearLabel", Gear.PROPERTY_LABEL);
+ model.newMandatoryColumn("GearName", Gear.PROPERTY_NAME);
+ model.newMandatoryColumn("Description", Gear.PROPERTY_DESCRIPTION);
+ model.addDefaultColumn("UpdateDate", Gear.PROPERTY_UPDATE_DATE, Date.class);
+ model.addDefaultColumn("GearClassification", Gear.PROPERTY_GEAR_CLASSIFICATION, int.class);
+ model.addDefaultColumn("ParentGear", Gear.PROPERTY_PARENT_GEAR, int.class);
+ model.addDefaultColumn("Status", Gear.PROPERTY_STATUS, int.class);
+ model.newMandatoryColumn("IsActive", Gear.PROPERTY_ACTIVE, CsvModelUtil.INT_TO_BOOLEAN_PARSER);
+ model.newMandatoryColumn("IsTowed", Gear.PROPERTY_TOWED, CsvModelUtil.INT_TO_BOOLEAN_PARSER);
+ return model;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/GearLoader.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoader.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -55,7 +55,7 @@
model.newMandatoryColumn("sampleDataType", SampleDataType.PROPERTY_NAME);
model.newMandatoryColumn("sampleDataTypeMeaningFr",SampleDataType.PROPERTY_MEANING_FR);
model.newMandatoryColumn("Units",SampleDataType.PROPERTY_UNITS);
- model.newMandatoryColumn("Precision",SampleDataType.PROPERTY_UNITS);
+ model.newMandatoryColumn("Precision",SampleDataType.PROPERTY_PRECISION);
return model;
}
}
\ No newline at end of file
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,376 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.meta.AssociationMeta;
+import fr.ifremer.echobase.entities.meta.DbMeta;
+import fr.ifremer.echobase.entities.meta.MetaFilenameAware;
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.services.CsvImportResult;
+import fr.ifremer.echobase.tools.AbstractToolTest;
+import fr.ifremer.echobase.tools.FileType;
+import fr.ifremer.echobase.tools.TestHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.util.FileUtil;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Abstract entity loader test.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public abstract class AbstractLoaderIT<E extends TopiaEntity, L extends EntityLoader<E>> extends AbstractToolTest {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AbstractLoaderIT.class);
+
+ protected static File msAccessFile;
+
+ protected File exportdir;
+
+ protected L loader;
+
+ private final Class<L> loaderType;
+
+ private Database db;
+
+ protected final long expectedNewEntities;
+
+ protected final long expectedBaracoudaEntities;
+
+ protected boolean loadDependencies = true;
+
+ protected List<EntityLoader<?>> entityLoaders;
+
+
+ @BeforeClass
+ public static void beforeClass() {
+
+ AbstractToolTest.beforeClass();
+
+ msAccessFile = FileUtil.getFileFromPaths(TestHelper.getBasedir(),
+ "src",
+ "test",
+ "private",
+ "baracouda.mdb"
+ );
+ if (!msAccessFile.exists()) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find " + msAccessFile +
+ ", the test will be skip.");
+ }
+ }
+ Assume.assumeTrue(msAccessFile.exists());
+ }
+
+ @Before
+ public void setUp() throws Exception {
+
+ super.setUp();
+
+ exportdir = new File(testdir, "export");
+
+ // exportdir should not exist
+ Assert.assertFalse(exportdir.exists());
+
+ // creates it
+ FileUtil.createDirectoryIfNecessary(exportdir);
+
+ // get loader
+ loader = newService(loaderType);
+
+ if (loadDependencies) {
+ loadDependencies();
+ }
+ }
+
+ protected AbstractLoaderIT(Class<L> loaderType,
+ long expectedNewEntities,
+ long expectedBaracoudaEntities) {
+ this.loaderType = loaderType;
+ this.expectedNewEntities = expectedNewEntities;
+ this.expectedBaracoudaEntities = expectedBaracoudaEntities;
+ }
+
+ protected void generateNewEntities() throws Exception {
+ Assume.assumeTrue(loader.canGenerateNew());
+
+ File inFile = new File(testdir, "input-" + loader.getEntityType().name() + ".csv");
+ File outFile = getTableFile(FileType.NEW);
+ Assert.assertFalse(inFile.exists());
+ Assert.assertFalse(outFile.exists());
+
+ loader.copyStreamToFile(inFile, FileType.NEW);
+
+ // input file now exists
+ Assert.assertTrue(inFile.exists());
+
+ loader.generateNewEntities(inFile, exportdir, true);
+
+ long beforeCount = getDAO().count();
+
+ // no species in initial db
+ Assert.assertEquals(0, beforeCount);
+
+ importEntities(outFile, expectedNewEntities);
+ }
+
+ protected void generateBaracoudaEntities() throws Exception {
+
+ File outFile = getTableFile(FileType.BARACOUDA);
+ Assert.assertFalse(outFile.exists());
+
+ long beforeCount = getDAO().count();
+
+ // no species in initial db
+ Assert.assertEquals(0, beforeCount);
+
+ launchEntitiesFromBaracouda(loader, getDb(), exportdir);
+
+ importEntities(outFile, expectedBaracoudaEntities);
+ }
+
+ protected void launchEntitiesFromBaracouda(L loader,
+ Database db,
+ File exportdir) throws IOException, TopiaException, ParseException {
+ loader.generateBaracoudaEntities(db, exportdir, true);
+ }
+
+ protected void loadDependencies() throws IOException, TopiaException {
+ Set<MetaFilenameAware> dones = Sets.newHashSet();
+ loadDependencies(dones);
+ }
+
+ protected void loadDependencies(Set<MetaFilenameAware> dones) throws IOException, TopiaException {
+
+ for (EchoBaseEntityEnum dependency : loader.getDependencies()) {
+ loadDependencies(dependency, dones);
+ }
+ for (EchoBaseEntityEnum dependency : loader.getExtraDependencies()) {
+ loadDependencies(dependency, dones);
+ }
+ AssociationMeta parentAssociationMeta =
+ loader.getParentAssociationMeta();
+ if (parentAssociationMeta != null) {
+ loadDependencies(parentAssociationMeta.getSource(), dones);
+ }
+ }
+
+ protected void loadDependencies(EchoBaseEntityEnum dependency,
+ Set<MetaFilenameAware> dones) throws IOException, TopiaException {
+ DbMeta dbMeta = serviceContext.getDbMeta();
+ TableMeta meta = dbMeta.getTable(dependency);
+ loadDependencies(meta, dones);
+ }
+
+ private void loadDependencies(MetaFilenameAware meta,
+ Set<MetaFilenameAware> dones) throws IOException, TopiaException {
+
+
+ // mark it as load (to prevent reloading of it twice)
+ if (!dones.add(meta)) {
+
+ // was already loaded
+ if (log.isDebugEnabled()) {
+ log.debug("Skip already loaded type " + meta);
+ }
+ return;
+ }
+
+ EntityLoader<? extends TopiaEntity> entityLoader =
+ getEntityLoader(meta.getSource().getContract());
+
+ if (meta instanceof AssociationMeta) {
+
+ // import association
+
+ loadDependencies(meta.getSource(), dones);
+ loadDependencies(((AssociationMeta) meta).getTarget(), dones);
+ entityLoader.copyAndLoadEntities(exportdir, meta, true, FileType.ASSOCIATION);
+
+ } else {
+
+ // load dependencies before
+ for (EchoBaseEntityEnum dependency : entityLoader.getDependencies()) {
+ loadDependencies(dependency, dones);
+ }
+ // load extra dependencies before
+ for (EchoBaseEntityEnum dependency : entityLoader.getExtraDependencies()) {
+ loadDependencies(dependency, dones);
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Load for " + meta);
+ }
+
+ if (entityLoader.canGenerateNew()) {
+
+ // copy and load new stuff
+ entityLoader.copyAndLoadEntities(exportdir, meta, true, FileType.NEW);
+ }
+
+ if (entityLoader.canGenerateBaracouda()) {
+
+ // copy and load of baracouda stuff
+ entityLoader.copyAndLoadEntities(exportdir, meta, true, FileType.BARACOUDA);
+ }
+
+ // load associations
+ AssociationMeta parentAssociationMeta =
+ entityLoader.getParentAssociationMeta();
+ if (parentAssociationMeta != null) {
+ loadDependencies(parentAssociationMeta, dones);
+ }
+ }
+
+ }
+
+ private TopiaDAO<E> getDAO() throws TopiaException {
+ return getDao(loader.getEntityClass());
+ }
+
+ private File getTableFile(FileType fileType) throws IOException {
+
+ File outFile = loader.getTableFile(exportdir, loader.getMeta(), fileType);
+ return outFile;
+ }
+
+ protected void importEntities(File inFile,
+ long nbExpected) throws IOException, TopiaException {
+
+ TopiaDAO<E> dao = getDAO();
+
+ // input file now exists
+ Assert.assertTrue(inFile.exists());
+
+ long beforeCount = dao.count();
+
+ // no species in initial db
+ Assert.assertEquals(0, beforeCount);
+
+ if (log.isInfoEnabled()) {
+ log.info("Import " + inFile);
+ }
+ CsvImportResult csvImportResult = getService().importDatas(
+ loader.getEntityType(),
+ inFile.getAbsolutePath(),
+ inFile,
+ true,
+ null
+ );
+ Assert.assertNotNull(csvImportResult);
+
+ long afterCount = dao.count();
+
+ // nbExpected entities after import
+ Assert.assertEquals(nbExpected, afterCount);
+
+ // no entity updated
+ Assert.assertEquals(0, csvImportResult.getNumberUpdated());
+
+ // all entities created
+ Assert.assertEquals(afterCount, csvImportResult.getNumberCreated());
+ }
+
+ protected Database getDb() throws IOException {
+ if (db == null) {
+ db = Database.open(msAccessFile);
+ }
+ return db;
+ }
+
+ public <E extends TopiaEntity> EntityLoader<E> getEntityLoader(Class<E> entityClass) {
+ EntityLoader<E> result = null;
+ for (EntityLoader<?> entityLoader : getEntityLoaders()) {
+ if (entityClass.equals(entityLoader.getEntityType().getContract())) {
+ result = (EntityLoader<E>) entityLoader;
+ break;
+ }
+ }
+ Preconditions.checkNotNull(result, "Could not find EntityLoader for " +
+ entityClass.getName());
+ return result;
+ }
+
+ public List<EntityLoader<?>> getEntityLoaders() {
+ if (entityLoaders == null) {
+ entityLoaders = Lists.newArrayList();
+ entityLoaders.add(newService(SpeciesLoader.class));
+ entityLoaders.add(newService(MissionLoader.class));
+ entityLoaders.add(newService(AreaOfOperationLoader.class));
+ entityLoaders.add(newService(AcousticInstrumentLoader.class));
+ entityLoaders.add(newService(DepthStratumLoader.class));
+ entityLoaders.add(newService(DataQualityLoader.class));
+ entityLoaders.add(newService(ReferenceDatumTypeLoader.class));
+ entityLoaders.add(newService(ReferenceDatumLoader.class));
+ entityLoaders.add(newService(DataTypeLoader.class));
+ entityLoaders.add(newService(CellTypeLoader.class));
+ entityLoaders.add(newService(CellMethodLoader.class));
+ entityLoaders.add(newService(DataMetadataLoader.class));
+ entityLoaders.add(newService(TSParametersLoader.class));
+ entityLoaders.add(newService(StrataLoader.class));
+ entityLoaders.add(newService(EchotypeCategoryLoader.class));
+ entityLoaders.add(newService(EchotypeLoader.class));
+ entityLoaders.add(newService(VesselTypeLoader.class));
+ entityLoaders.add(newService(VesselLoader.class));
+ entityLoaders.add(newService(OperationEventLoader.class));
+ entityLoaders.add(newService(SampleDataTypeLoader.class));
+ entityLoaders.add(newService(SampleTypeLoader.class));
+ entityLoaders.add(newService(BiometryScaleLoader.class));
+ entityLoaders.add(newService(SexCategoryLoader.class));
+ entityLoaders.add(newService(SizeCategoryLoader.class));
+ entityLoaders.add(newService(OperationMetadataLoader.class));
+ entityLoaders.add(newService(GearMetadataLoader.class));
+
+ entityLoaders.add(newService(VoyageLoader.class));
+ entityLoaders.add(newService(TransitLoader.class));
+ entityLoaders.add(newService(TransectLoader.class));
+ entityLoaders.add(newService(DataAcquisitionLoader.class));
+ entityLoaders.add(newService(DataProcessingLoader.class));
+ entityLoaders.add(newService(CellLoader.class));
+ }
+ return entityLoaders;
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AbstractLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,376 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.healthmarketscience.jackcess.Database;
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.meta.AssociationMeta;
-import fr.ifremer.echobase.entities.meta.DbMeta;
-import fr.ifremer.echobase.entities.meta.MetaFilenameAware;
-import fr.ifremer.echobase.entities.meta.TableMeta;
-import fr.ifremer.echobase.services.CsvImportResult;
-import fr.ifremer.echobase.tools.AbstractToolTest;
-import fr.ifremer.echobase.tools.FileType;
-import fr.ifremer.echobase.tools.TestHelper;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.persistence.TopiaDAO;
-import org.nuiton.topia.persistence.TopiaEntity;
-import org.nuiton.util.FileUtil;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Abstract entity loader test.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public abstract class AbstractLoaderTest<E extends TopiaEntity, L extends EntityLoader<E>> extends AbstractToolTest {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(AbstractLoaderTest.class);
-
- protected static File msAccessFile;
-
- protected File exportdir;
-
- protected L loader;
-
- private final Class<L> loaderType;
-
- private Database db;
-
- protected final long expectedNewEntities;
-
- protected final long expectedBaracoudaEntities;
-
- protected boolean loadDependencies = true;
-
- protected List<EntityLoader<?>> entityLoaders;
-
-
- @BeforeClass
- public static void beforeClass() {
-
- AbstractToolTest.beforeClass();
-
- msAccessFile = FileUtil.getFileFromPaths(TestHelper.getBasedir(),
- "src",
- "test",
- "private",
- "baracouda.mdb"
- );
- if (!msAccessFile.exists()) {
- if (log.isWarnEnabled()) {
- log.warn("Could not find " + msAccessFile +
- ", the test will be skip.");
- }
- }
- Assume.assumeTrue(msAccessFile.exists());
- }
-
- @Before
- public void setUp() throws Exception {
-
- super.setUp();
-
- exportdir = new File(testdir, "export");
-
- // exportdir should not exist
- Assert.assertFalse(exportdir.exists());
-
- // creates it
- FileUtil.createDirectoryIfNecessary(exportdir);
-
- // get loader
- loader = newService(loaderType);
-
- if (loadDependencies) {
- loadDependencies();
- }
- }
-
- protected AbstractLoaderTest(Class<L> loaderType,
- long expectedNewEntities,
- long expectedBaracoudaEntities) {
- this.loaderType = loaderType;
- this.expectedNewEntities = expectedNewEntities;
- this.expectedBaracoudaEntities = expectedBaracoudaEntities;
- }
-
- protected void generateNewEntities() throws Exception {
- Assume.assumeTrue(loader.canGenerateNew());
-
- File inFile = new File(testdir, "input-" + loader.getEntityType().name() + ".csv");
- File outFile = getTableFile(FileType.NEW);
- Assert.assertFalse(inFile.exists());
- Assert.assertFalse(outFile.exists());
-
- loader.copyStreamToFile(inFile, FileType.NEW);
-
- // input file now exists
- Assert.assertTrue(inFile.exists());
-
- loader.generateNewEntities(inFile, exportdir, true);
-
- long beforeCount = getDAO().count();
-
- // no species in initial db
- Assert.assertEquals(0, beforeCount);
-
- importEntities(outFile, expectedNewEntities);
- }
-
- protected void generateBaracoudaEntities() throws Exception {
-
- File outFile = getTableFile(FileType.BARACOUDA);
- Assert.assertFalse(outFile.exists());
-
- long beforeCount = getDAO().count();
-
- // no species in initial db
- Assert.assertEquals(0, beforeCount);
-
- launchEntitiesFromBaracouda(loader, getDb(), exportdir);
-
- importEntities(outFile, expectedBaracoudaEntities);
- }
-
- protected void launchEntitiesFromBaracouda(L loader,
- Database db,
- File exportdir) throws IOException, TopiaException, ParseException {
- loader.generateBaracoudaEntities(db, exportdir, true);
- }
-
- protected void loadDependencies() throws IOException, TopiaException {
- Set<MetaFilenameAware> dones = Sets.newHashSet();
- loadDependencies(dones);
- }
-
- protected void loadDependencies(Set<MetaFilenameAware> dones) throws IOException, TopiaException {
-
- for (EchoBaseEntityEnum dependency : loader.getDependencies()) {
- loadDependencies(dependency, dones);
- }
- for (EchoBaseEntityEnum dependency : loader.getExtraDependencies()) {
- loadDependencies(dependency, dones);
- }
- AssociationMeta parentAssociationMeta =
- loader.getParentAssociationMeta();
- if (parentAssociationMeta != null) {
- loadDependencies(parentAssociationMeta.getSource(), dones);
- }
- }
-
- protected void loadDependencies(EchoBaseEntityEnum dependency,
- Set<MetaFilenameAware> dones) throws IOException, TopiaException {
- DbMeta dbMeta = serviceContext.getDbMeta();
- TableMeta meta = dbMeta.getTable(dependency);
- loadDependencies(meta, dones);
- }
-
- private void loadDependencies(MetaFilenameAware meta,
- Set<MetaFilenameAware> dones) throws IOException, TopiaException {
-
-
- // mark it as load (to prevent reloading of it twice)
- if (!dones.add(meta)) {
-
- // was already loaded
- if (log.isDebugEnabled()) {
- log.debug("Skip already loaded type " + meta);
- }
- return;
- }
-
- EntityLoader<? extends TopiaEntity> entityLoader =
- getEntityLoader(meta.getSource().getContract());
-
- if (meta instanceof AssociationMeta) {
-
- // import association
-
- loadDependencies(meta.getSource(), dones);
- loadDependencies(((AssociationMeta) meta).getTarget(), dones);
- entityLoader.copyAndLoadEntities(exportdir, meta, true, FileType.ASSOCIATION);
-
- } else {
-
- // load dependencies before
- for (EchoBaseEntityEnum dependency : entityLoader.getDependencies()) {
- loadDependencies(dependency, dones);
- }
- // load extra dependencies before
- for (EchoBaseEntityEnum dependency : entityLoader.getExtraDependencies()) {
- loadDependencies(dependency, dones);
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Load for " + meta);
- }
-
- if (entityLoader.canGenerateNew()) {
-
- // copy and load new stuff
- entityLoader.copyAndLoadEntities(exportdir, meta, true, FileType.NEW);
- }
-
- if (entityLoader.canGenerateBaracouda()) {
-
- // copy and load of baracouda stuff
- entityLoader.copyAndLoadEntities(exportdir, meta, true, FileType.BARACOUDA);
- }
-
- // load associations
- AssociationMeta parentAssociationMeta =
- entityLoader.getParentAssociationMeta();
- if (parentAssociationMeta != null) {
- loadDependencies(parentAssociationMeta, dones);
- }
- }
-
- }
-
- private TopiaDAO<E> getDAO() throws TopiaException {
- return getDao(loader.getEntityClass());
- }
-
- private File getTableFile(FileType fileType) throws IOException {
-
- File outFile = loader.getTableFile(exportdir, loader.getMeta(), fileType);
- return outFile;
- }
-
- protected void importEntities(File inFile,
- long nbExpected) throws IOException, TopiaException {
-
- TopiaDAO<E> dao = getDAO();
-
- // input file now exists
- Assert.assertTrue(inFile.exists());
-
- long beforeCount = dao.count();
-
- // no species in initial db
- Assert.assertEquals(0, beforeCount);
-
- if (log.isInfoEnabled()) {
- log.info("Import " + inFile);
- }
- CsvImportResult csvImportResult = getService().importDatas(
- loader.getEntityType(),
- inFile.getAbsolutePath(),
- inFile,
- true,
- null
- );
- Assert.assertNotNull(csvImportResult);
-
- long afterCount = dao.count();
-
- // nbExpected entities after import
- Assert.assertEquals(nbExpected, afterCount);
-
- // no entity updated
- Assert.assertEquals(0, csvImportResult.getNumberUpdated());
-
- // all entities created
- Assert.assertEquals(afterCount, csvImportResult.getNumberCreated());
- }
-
- protected Database getDb() throws IOException {
- if (db == null) {
- db = Database.open(msAccessFile);
- }
- return db;
- }
-
- public <E extends TopiaEntity> EntityLoader<E> getEntityLoader(Class<E> entityClass) {
- EntityLoader<E> result = null;
- for (EntityLoader<?> entityLoader : getEntityLoaders()) {
- if (entityClass.equals(entityLoader.getEntityType().getContract())) {
- result = (EntityLoader<E>) entityLoader;
- break;
- }
- }
- Preconditions.checkNotNull(result, "Could not find EntityLoader for " +
- entityClass.getName());
- return result;
- }
-
- public List<EntityLoader<?>> getEntityLoaders() {
- if (entityLoaders == null) {
- entityLoaders = Lists.newArrayList();
- entityLoaders.add(newService(SpeciesLoader.class));
- entityLoaders.add(newService(MissionLoader.class));
- entityLoaders.add(newService(AreaOfOperationLoader.class));
- entityLoaders.add(newService(AcousticInstrumentLoader.class));
- entityLoaders.add(newService(DepthStratumLoader.class));
- entityLoaders.add(newService(DataQualityLoader.class));
- entityLoaders.add(newService(ReferenceDatumTypeLoader.class));
- entityLoaders.add(newService(ReferenceDatumLoader.class));
- entityLoaders.add(newService(DataTypeLoader.class));
- entityLoaders.add(newService(CellTypeLoader.class));
- entityLoaders.add(newService(CellMethodLoader.class));
- entityLoaders.add(newService(DataMetadataLoader.class));
- entityLoaders.add(newService(TSParametersLoader.class));
- entityLoaders.add(newService(StrataLoader.class));
- entityLoaders.add(newService(EchotypeCategoryLoader.class));
- entityLoaders.add(newService(EchotypeLoader.class));
- entityLoaders.add(newService(VesselTypeLoader.class));
- entityLoaders.add(newService(VesselLoader.class));
- entityLoaders.add(newService(OperationEventLoader.class));
- entityLoaders.add(newService(SampleDataTypeLoader.class));
- entityLoaders.add(newService(SampleTypeLoader.class));
- entityLoaders.add(newService(BiometryScaleLoader.class));
- entityLoaders.add(newService(SexCategoryLoader.class));
- entityLoaders.add(newService(SizeCategoryLoader.class));
- entityLoaders.add(newService(OperationMetadataLoader.class));
- entityLoaders.add(newService(GearMetadataLoader.class));
-
- entityLoaders.add(newService(VoyageLoader.class));
- entityLoaders.add(newService(TransitLoader.class));
- entityLoaders.add(newService(TransectLoader.class));
- entityLoaders.add(newService(DataAcquisitionLoader.class));
- entityLoaders.add(newService(DataProcessingLoader.class));
- entityLoaders.add(newService(CellLoader.class));
- }
- return entityLoaders;
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.AcousticInstrument;
+import org.junit.Test;
+
+/**
+ * To test the {@link AcousticInstrumentLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class AcousticInstrumentLoaderIT extends AbstractLoaderIT<AcousticInstrument, AcousticInstrumentLoader> {
+
+ public AcousticInstrumentLoaderIT() {
+ super(AcousticInstrumentLoader.class, 0, 20);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AcousticInstrumentLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.AcousticInstrument;
-import org.junit.Test;
-
-/**
- * To test the {@link AcousticInstrumentLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class AcousticInstrumentLoaderTest extends AbstractLoaderTest<AcousticInstrument, AcousticInstrumentLoader> {
-
- public AcousticInstrumentLoaderTest() {
- super(AcousticInstrumentLoader.class, 0, 20);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.AreaOfOperation;
+import org.junit.Test;
+
+/**
+ * To test the {@link AreaOfOperationLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class AreaOfOperationLoaderIT extends AbstractLoaderIT<AreaOfOperation, AreaOfOperationLoader> {
+
+ public AreaOfOperationLoaderIT() {
+ super(AreaOfOperationLoader.class, 0, 5);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/AreaOfOperationLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.AreaOfOperation;
-import org.junit.Test;
-
-/**
- * To test the {@link AreaOfOperationLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class AreaOfOperationLoaderTest extends AbstractLoaderTest<AreaOfOperation, AreaOfOperationLoader> {
-
- public AreaOfOperationLoaderTest() {
- super(AreaOfOperationLoader.class, 0, 5);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.BiometryScale;
+import org.junit.Test;
+
+/**
+ * To test the {@link BiometryScaleLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class BiometryScaleLoaderIT extends AbstractLoaderIT<BiometryScale, BiometryScaleLoader> {
+
+ public BiometryScaleLoaderIT() {
+ super(BiometryScaleLoader.class, 44, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/BiometryScaleLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.BiometryScale;
-import org.junit.Test;
-
-/**
- * To test the {@link BiometryScaleLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class BiometryScaleLoaderTest extends AbstractLoaderTest<BiometryScale, BiometryScaleLoader> {
-
- public BiometryScaleLoaderTest() {
- super(BiometryScaleLoader.class, 44, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderIT.java (from rev 196, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,233 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
+import com.healthmarketscience.jackcess.Database;
+import fr.ifremer.echobase.EchoBaseIOUtil;
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.data.Cell;
+import fr.ifremer.echobase.entities.data.DataProcessing;
+import fr.ifremer.echobase.entities.meta.AssociationMeta;
+import fr.ifremer.echobase.entities.meta.MetaFilenameAware;
+import fr.ifremer.echobase.entities.meta.TableMeta;
+import fr.ifremer.echobase.services.DbEditorService;
+import fr.ifremer.echobase.tools.FileType;
+import fr.ifremer.echobase.tools.TestHelper;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.AfterClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.nuiton.topia.TopiaException;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * To test {@link CellLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+(a)RunWith(Parameterized.class)
+public class CellLoaderIT extends AbstractLoaderIT<Cell, CellLoader> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(CellLoaderIT.class);
+
+ /** Id of data processing to treat. */
+ private String dataProcessingId;
+
+ @Parameterized.Parameters
+ public static List<Object[]> data() {
+ return Arrays.asList(new Object[][]{
+ {"EIT_00_38", 0},
+ {"EIT_01_38", 0},
+ {"EIT_02_38", 0},
+ {"EIT_03_38", 0},
+ {"EIT_0310_38", 0},
+ {"EIT_04_38", 0},
+ {"EIT_05_38", 0},
+ {"EIT_0510_38", 0}, // with no region
+ {"EIT_06_38", 0},
+ {"EIT_07_38", 0},
+ {"EIT_08_38", 0},
+ {"EIT_09_38", 0},
+ {"EIT_10_38", 0},
+ {"EIT_83A_38", 0}, // with no region
+ {"EIT_83B_38", 0}, // with no region
+ {"EIT_84_38", 0}, // with no region
+ {"EIT_85_38", 0}, // with no region
+ {"EIT_86_38", 0}, // with no region
+ {"EIT_87_38", 0}, // with no region
+ {"EIT_89A_38", 0}, // with no region
+ {"EIT_89B_38", 0}, // with no region
+ {"EIT_90_38", 0}, // with no region
+ {"EIT_91_38", 0}, // with no region
+ {"EIT_92_38", 0}, // with no region
+ {"EIT_93_38", 0}, // with no region
+ {"EIT_94_38", 0}, // with no region
+ {"EIT_97_38", 0}, // with no region
+ {"EIT_98b_38", 0},
+ });
+ }
+
+ static boolean cacheLoaded;
+
+ static List<File> directoriesToMerge = Lists.newLinkedList();
+
+ @Override
+ public void setUp() throws Exception {
+
+ super.setUp();
+
+ if (!cacheLoaded) {
+
+ // load caches once for all
+
+ loader.loadCache(getDb());
+
+ cacheLoaded = true;
+ }
+ }
+
+ static CellLoader lastLoader;
+
+ @Override
+ public void tearDown() throws Exception {
+ lastLoader = loader;
+ super.tearDown();
+
+ if (log.isInfoEnabled()) {
+ log.info("TimeLogs : " + DbEditorService.timeLog.getCallCount());
+ }
+ }
+
+ @AfterClass
+ public static void afterClass() throws Exception {
+
+ // merge all results
+ if (CollectionUtils.isNotEmpty(directoriesToMerge)) {
+
+ // let's merge all result
+ File dir = TestHelper.getTestBasedir(CellLoaderIT.class);
+
+ TableMeta cellMeta = lastLoader.getMeta();
+ TableMeta dataMeta = lastLoader.getTable(EchoBaseEntityEnum.Data);
+ TableMeta dataProcessingMeta = lastLoader.getTable(EchoBaseEntityEnum.DataProcessing);
+ AssociationMeta dataProcessingToCellMetaAssociation = dataProcessingMeta.getAssociations(DataProcessing.PROPERTY_CELL);
+ AssociationMeta cellToCellMetaAssociation = cellMeta.getAssociations(Cell.PROPERTY_CHILDS);
+ AssociationMeta cellToDataMetaAssociation = cellMeta.getAssociations(Cell.PROPERTY_DATA);
+
+ ToFileFromMeta toCellFile = new ToFileFromMeta(lastLoader, cellMeta);
+ ToFileFromMeta toDataFile = new ToFileFromMeta(lastLoader, dataMeta);
+ ToFileFromMeta toDataProcessingToCellFile = new ToFileFromMeta(lastLoader, dataProcessingToCellMetaAssociation);
+ ToFileFromMeta toCellToCellFile = new ToFileFromMeta(lastLoader, cellToCellMetaAssociation);
+ ToFileFromMeta toCellToDataFile = new ToFileFromMeta(lastLoader, cellToDataMetaAssociation);
+
+ if (log.isInfoEnabled()) {
+ log.info("Will merge " + directoriesToMerge.size() + " data processing data into " + dir);
+ }
+
+ mergeFile(dir, toCellFile);
+ mergeFile(dir, toDataFile);
+ mergeFile(dir, toDataProcessingToCellFile);
+ mergeFile(dir, toCellToCellFile);
+ mergeFile(dir, toCellToDataFile);
+ }
+ }
+
+ protected static void mergeFile(File dir, ToFileFromMeta function) throws Exception {
+
+ File mergedFile = function.apply(dir);
+ if (log.isInfoEnabled()) {
+ log.info("Will merge to " + mergedFile.getName());
+ }
+
+ Collection<File> files = Collections2.transform(directoriesToMerge, function);
+
+ EchoBaseIOUtil.copyFile(mergedFile, files);
+ }
+
+ public CellLoaderIT(String dataProcessingId, int exceptedDataCount) {
+ super(CellLoader.class, 0, exceptedDataCount);
+ this.dataProcessingId = dataProcessingId;
+ }
+
+ @Test
+ public void generateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+ @Override
+ protected void launchEntitiesFromBaracouda(CellLoader loader,
+ Database db,
+ File exportdir) throws IOException, TopiaException, ParseException {
+
+ if (log.isInfoEnabled()) {
+ log.info("Export to " + exportdir);
+ }
+ directoriesToMerge.add(exportdir);
+ loader.generateEntitiesFromBaracouda(db, exportdir, dataProcessingId, true);
+ }
+
+ @Override
+ protected void importEntities(File inFile,
+ long nbExpected) throws IOException, TopiaException {
+ // do not use it
+ }
+
+ private static class ToFileFromMeta implements Function<File, File> {
+
+ private MetaFilenameAware meta;
+ private FileType fileType;
+ private CellLoader loader;
+
+ public ToFileFromMeta(CellLoader loader, MetaFilenameAware meta) {
+ this.meta = meta;
+ this.loader = loader;
+ fileType = meta instanceof AssociationMeta ? FileType.ASSOCIATION : FileType.BARACOUDA;
+ }
+
+ @Override
+ public File apply(File input) {
+
+ try {
+ return loader.getTableFile(input, meta, fileType);
+ } catch (IOException e) {
+ throw new IllegalStateException("Could not obtain table file", e);
+ }
+ }
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,233 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import com.healthmarketscience.jackcess.Database;
-import fr.ifremer.echobase.EchoBaseIOUtil;
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.data.Cell;
-import fr.ifremer.echobase.entities.data.DataProcessing;
-import fr.ifremer.echobase.entities.meta.AssociationMeta;
-import fr.ifremer.echobase.entities.meta.MetaFilenameAware;
-import fr.ifremer.echobase.entities.meta.TableMeta;
-import fr.ifremer.echobase.services.DbEditorService;
-import fr.ifremer.echobase.tools.FileType;
-import fr.ifremer.echobase.tools.TestHelper;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.AfterClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.nuiton.topia.TopiaException;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * To test {@link CellLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-(a)RunWith(Parameterized.class)
-public class CellLoaderTest extends AbstractLoaderTest<Cell, CellLoader> {
-
- /** Logger. */
- private static final Log log =
- LogFactory.getLog(CellLoaderTest.class);
-
- /** Id of data processing to treat. */
- private String dataProcessingId;
-
- @Parameterized.Parameters
- public static List<Object[]> data() {
- return Arrays.asList(new Object[][]{
- {"EIT_00_38", 0},
- {"EIT_01_38", 0},
- {"EIT_02_38", 0},
- {"EIT_03_38", 0},
- {"EIT_0310_38", 0},
- {"EIT_04_38", 0},
- {"EIT_05_38", 0},
- {"EIT_0510_38", 0}, // with no region
- {"EIT_06_38", 0},
- {"EIT_07_38", 0},
- {"EIT_08_38", 0},
- {"EIT_09_38", 0},
- {"EIT_10_38", 0},
- {"EIT_83A_38", 0}, // with no region
- {"EIT_83B_38", 0}, // with no region
- {"EIT_84_38", 0}, // with no region
- {"EIT_85_38", 0}, // with no region
- {"EIT_86_38", 0}, // with no region
- {"EIT_87_38", 0}, // with no region
- {"EIT_89A_38", 0}, // with no region
- {"EIT_89B_38", 0}, // with no region
- {"EIT_90_38", 0}, // with no region
- {"EIT_91_38", 0}, // with no region
- {"EIT_92_38", 0}, // with no region
- {"EIT_93_38", 0}, // with no region
- {"EIT_94_38", 0}, // with no region
- {"EIT_97_38", 0}, // with no region
- {"EIT_98b_38", 0},
- });
- }
-
- static boolean cacheLoaded;
-
- static List<File> directoriesToMerge = Lists.newLinkedList();
-
- @Override
- public void setUp() throws Exception {
-
- super.setUp();
-
- if (!cacheLoaded) {
-
- // load caches once for all
-
- loader.loadCache(getDb());
-
- cacheLoaded = true;
- }
- }
-
- static CellLoader lastLoader;
-
- @Override
- public void tearDown() throws Exception {
- lastLoader = loader;
- super.tearDown();
-
- if (log.isInfoEnabled()) {
- log.info("TimeLogs : " + DbEditorService.timeLog.getCallCount());
- }
- }
-
- @AfterClass
- public static void afterClass() throws Exception {
-
- // merge all results
- if (CollectionUtils.isNotEmpty(directoriesToMerge)) {
-
- // let's merge all result
- File dir = TestHelper.getTestBasedir(CellLoaderTest.class);
-
- TableMeta cellMeta = lastLoader.getMeta();
- TableMeta dataMeta = lastLoader.getTable(EchoBaseEntityEnum.Data);
- TableMeta dataProcessingMeta = lastLoader.getTable(EchoBaseEntityEnum.DataProcessing);
- AssociationMeta dataProcessingToCellMetaAssociation = dataProcessingMeta.getAssociations(DataProcessing.PROPERTY_CELL);
- AssociationMeta cellToCellMetaAssociation = cellMeta.getAssociations(Cell.PROPERTY_CHILDS);
- AssociationMeta cellToDataMetaAssociation = cellMeta.getAssociations(Cell.PROPERTY_DATA);
-
- ToFileFromMeta toCellFile = new ToFileFromMeta(lastLoader, cellMeta);
- ToFileFromMeta toDataFile = new ToFileFromMeta(lastLoader, dataMeta);
- ToFileFromMeta toDataProcessingToCellFile = new ToFileFromMeta(lastLoader, dataProcessingToCellMetaAssociation);
- ToFileFromMeta toCellToCellFile = new ToFileFromMeta(lastLoader, cellToCellMetaAssociation);
- ToFileFromMeta toCellToDataFile = new ToFileFromMeta(lastLoader, cellToDataMetaAssociation);
-
- if (log.isInfoEnabled()) {
- log.info("Will merge " + directoriesToMerge.size() + " data processing data into " + dir);
- }
-
- mergeFile(dir, toCellFile);
- mergeFile(dir, toDataFile);
- mergeFile(dir, toDataProcessingToCellFile);
- mergeFile(dir, toCellToCellFile);
- mergeFile(dir, toCellToDataFile);
- }
- }
-
- protected static void mergeFile(File dir, ToFileFromMeta function) throws Exception {
-
- File mergedFile = function.apply(dir);
- if (log.isInfoEnabled()) {
- log.info("Will merge to " + mergedFile.getName());
- }
-
- Collection<File> files = Collections2.transform(directoriesToMerge, function);
-
- EchoBaseIOUtil.copyFile(mergedFile, files);
- }
-
- public CellLoaderTest(String dataProcessingId, int exceptedDataCount) {
- super(CellLoader.class, 0, exceptedDataCount);
- this.dataProcessingId = dataProcessingId;
- }
-
- @Test
- public void generateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
- @Override
- protected void launchEntitiesFromBaracouda(CellLoader loader,
- Database db,
- File exportdir) throws IOException, TopiaException, ParseException {
-
- if (log.isInfoEnabled()) {
- log.info("Export to " + exportdir);
- }
- directoriesToMerge.add(exportdir);
- loader.generateEntitiesFromBaracouda(db, exportdir, dataProcessingId, true);
- }
-
- @Override
- protected void importEntities(File inFile,
- long nbExpected) throws IOException, TopiaException {
- // do not use it
- }
-
- private static class ToFileFromMeta implements Function<File, File> {
-
- private MetaFilenameAware meta;
- private FileType fileType;
- private CellLoader loader;
-
- public ToFileFromMeta(CellLoader loader, MetaFilenameAware meta) {
- this.meta = meta;
- this.loader = loader;
- fileType = meta instanceof AssociationMeta ? FileType.ASSOCIATION : FileType.BARACOUDA;
- }
-
- @Override
- public File apply(File input) {
-
- try {
- return loader.getTableFile(input, meta, fileType);
- } catch (IOException e) {
- throw new IllegalStateException("Could not obtain table file", e);
- }
- }
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.CellMethod;
+import org.junit.Test;
+
+/**
+ * To test the {@link CellMethodLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class CellMethodLoaderIT extends AbstractLoaderIT<CellMethod, CellMethodLoader> {
+
+ public CellMethodLoaderIT() {
+ super(CellMethodLoader.class, 6, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellMethodLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.CellMethod;
-import org.junit.Test;
-
-/**
- * To test the {@link CellMethodLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class CellMethodLoaderTest extends AbstractLoaderTest<CellMethod, CellMethodLoader> {
-
- public CellMethodLoaderTest() {
- super(CellMethodLoader.class, 6, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.CellType;
+import org.junit.Test;
+
+/**
+ * To test the {@link CellTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class CellTypeLoaderIT extends AbstractLoaderIT<CellType, CellTypeLoader> {
+
+ public CellTypeLoaderIT() {
+ super(CellTypeLoader.class, 6, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellTypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.CellType;
-import org.junit.Test;
-
-/**
- * To test the {@link CellTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class CellTypeLoaderTest extends AbstractLoaderTest<CellType, CellTypeLoader> {
-
- public CellTypeLoaderTest() {
- super(CellTypeLoader.class, 6, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.data.DataAcquisition;
+import org.junit.Test;
+
+/**
+ * To test {@link DataAcquisitionLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class DataAcquisitionLoaderIT extends AbstractLoaderIT<DataAcquisition, DataAcquisitionLoader> {
+
+ public DataAcquisitionLoaderIT() {
+ super(DataAcquisitionLoader.class, 0, 28);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataAcquisitionLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.data.DataAcquisition;
-import org.junit.Test;
-
-/**
- * To test {@link DataAcquisitionLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class DataAcquisitionLoaderTest extends AbstractLoaderTest<DataAcquisition, DataAcquisitionLoader> {
-
- public DataAcquisitionLoaderTest() {
- super(DataAcquisitionLoader.class, 0, 28);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,51 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.DataMetadata;
+import org.junit.Test;
+
+/**
+ * To test the {@link ReferenceDatumTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class DataMetadataLoaderIT extends AbstractLoaderIT<DataMetadata, DataMetadataLoader> {
+
+ public DataMetadataLoaderIT() {
+ super(DataMetadataLoader.class, 34, 28);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataMetadataLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,51 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.DataMetadata;
-import org.junit.Test;
-
-/**
- * To test the {@link ReferenceDatumTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class DataMetadataLoaderTest extends AbstractLoaderTest<DataMetadata, DataMetadataLoader> {
-
- public DataMetadataLoaderTest() {
- super(DataMetadataLoader.class, 34, 28);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.data.DataProcessing;
+import org.junit.Test;
+
+/**
+ * To test {@link DataProcessingLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class DataProcessingLoaderIT extends AbstractLoaderIT<DataProcessing, DataProcessingLoader> {
+
+ public DataProcessingLoaderIT() {
+ super(DataProcessingLoader.class, 0, 28);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataProcessingLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.data.DataProcessing;
-import org.junit.Test;
-
-/**
- * To test {@link DataProcessingLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class DataProcessingLoaderTest extends AbstractLoaderTest<DataProcessing, DataProcessingLoader> {
-
- public DataProcessingLoaderTest() {
- super(DataProcessingLoader.class, 0, 28);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.DataQuality;
+import org.junit.Test;
+
+/**
+ * To test the {@link DataQualityLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class DataQualityLoaderIT extends AbstractLoaderIT<DataQuality, DataQualityLoader> {
+
+ public DataQualityLoaderIT() {
+ super(DataQualityLoader.class, 8, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataQualityLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.DataQuality;
-import org.junit.Test;
-
-/**
- * To test the {@link DataQualityLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class DataQualityLoaderTest extends AbstractLoaderTest<DataQuality, DataQualityLoader> {
-
- public DataQualityLoaderTest() {
- super(DataQualityLoader.class, 8, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.DataType;
+import org.junit.Test;
+
+/**
+ * To test the {@link DataTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class DataTypeLoaderIT extends AbstractLoaderIT<DataType, DataTypeLoader> {
+
+ public DataTypeLoaderIT() {
+ super(DataTypeLoader.class, 15, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DataTypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.DataType;
-import org.junit.Test;
-
-/**
- * To test the {@link DataTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class DataTypeLoaderTest extends AbstractLoaderTest<DataType, DataTypeLoader> {
-
- public DataTypeLoaderTest() {
- super(DataTypeLoader.class, 15, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.DepthStratum;
+import org.junit.Test;
+
+/**
+ * To test the {@link DepthStratumLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class DepthStratumLoaderIT extends AbstractLoaderIT<DepthStratum, DepthStratumLoader> {
+
+ public DepthStratumLoaderIT() {
+ super(DepthStratumLoader.class, 0, 5);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/DepthStratumLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.DepthStratum;
-import org.junit.Test;
-
-/**
- * To test the {@link DepthStratumLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class DepthStratumLoaderTest extends AbstractLoaderTest<DepthStratum, DepthStratumLoader> {
-
- public DepthStratumLoaderTest() {
- super(DepthStratumLoader.class, 0, 5);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.EchotypeCategory;
+import org.junit.Test;
+
+/**
+ * To test the {@link EchotypeCategoryLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class EchotypeCategoryLoaderIT extends AbstractLoaderIT<EchotypeCategory, EchotypeCategoryLoader> {
+
+ public EchotypeCategoryLoaderIT() {
+ super(EchotypeCategoryLoader.class, 0, 3);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeCategoryLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.EchotypeCategory;
-import org.junit.Test;
-
-/**
- * To test the {@link EchotypeCategoryLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class EchotypeCategoryLoaderTest extends AbstractLoaderTest<EchotypeCategory, EchotypeCategoryLoader> {
-
- public EchotypeCategoryLoaderTest() {
- super(EchotypeCategoryLoader.class, 0, 3);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.Echotype;
+import org.junit.Test;
+
+/**
+ * To test the {@link EchotypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class EchotypeLoaderIT extends AbstractLoaderIT<Echotype, EchotypeLoader> {
+
+ public EchotypeLoaderIT() {
+ super(EchotypeLoader.class, 183, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/EchotypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.Echotype;
-import org.junit.Test;
-
-/**
- * To test the {@link EchotypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class EchotypeLoaderTest extends AbstractLoaderTest<Echotype, EchotypeLoader> {
-
- public EchotypeLoaderTest() {
- super(EchotypeLoader.class, 183, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Added: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearLoaderIT.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.Gear;
+import org.junit.Test;
+
+/**
+ * To test the {@link GearLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class GearLoaderIT extends AbstractLoaderIT<Gear, GearLoader> {
+
+ public GearLoaderIT() {
+ super(GearLoader.class, 112, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.GearMetadata;
+import org.junit.Test;
+
+/**
+ * To test the {@link GearMetadataLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class GearMetadataLoaderIT extends AbstractLoaderIT<GearMetadata, GearMetadataLoader> {
+
+ public GearMetadataLoaderIT() {
+ super(GearMetadataLoader.class, 3, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/GearMetadataLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.GearMetadata;
-import org.junit.Test;
-
-/**
- * To test the {@link GearMetadataLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class GearMetadataLoaderTest extends AbstractLoaderTest<GearMetadata, GearMetadataLoader> {
-
- public GearMetadataLoaderTest() {
- super(GearMetadataLoader.class, 3, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.Mission;
+import org.junit.Test;
+
+/**
+ * To test the {@link MissionLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class MissionLoaderIT extends AbstractLoaderIT<Mission, MissionLoader> {
+
+ public MissionLoaderIT() {
+ super(MissionLoader.class, 0, 14);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/MissionLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.Mission;
-import org.junit.Test;
-
-/**
- * To test the {@link MissionLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class MissionLoaderTest extends AbstractLoaderTest<Mission, MissionLoader> {
-
- public MissionLoaderTest() {
- super(MissionLoader.class, 0, 15);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.OperationEvent;
+import org.junit.Test;
+
+/**
+ * To test the {@link OperationEventLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class OperationEventLoaderIT extends AbstractLoaderIT<OperationEvent, OperationEventLoader> {
+
+ public OperationEventLoaderIT() {
+ super(OperationEventLoader.class, 7, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationEventLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.OperationEvent;
-import org.junit.Test;
-
-/**
- * To test the {@link OperationEventLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class OperationEventLoaderTest extends AbstractLoaderTest<OperationEvent, OperationEventLoader> {
-
- public OperationEventLoaderTest() {
- super(OperationEventLoader.class, 7, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.OperationMetadata;
+import org.junit.Test;
+
+/**
+ * To test the {@link SexCategoryLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class OperationMetadataLoaderIT extends AbstractLoaderIT<OperationMetadata, OperationMetadataLoader> {
+
+ public OperationMetadataLoaderIT() {
+ super(OperationMetadataLoader.class, 4, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/OperationMetadataLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.OperationMetadata;
-import org.junit.Test;
-
-/**
- * To test the {@link SexCategoryLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class OperationMetadataLoaderTest extends AbstractLoaderTest<OperationMetadata, OperationMetadataLoader> {
-
- public OperationMetadataLoaderTest() {
- super(OperationMetadataLoader.class, 4, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,51 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.ReferenceDatum;
+import org.junit.Test;
+
+/**
+ * To test the {@link ReferenceDatumTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class ReferenceDatumLoaderIT extends AbstractLoaderIT<ReferenceDatum, ReferenceDatumLoader> {
+
+ public ReferenceDatumLoaderIT() {
+ super(ReferenceDatumLoader.class, 4, 3);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,51 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.ReferenceDatum;
-import org.junit.Test;
-
-/**
- * To test the {@link ReferenceDatumTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class ReferenceDatumLoaderTest extends AbstractLoaderTest<ReferenceDatum, ReferenceDatumLoader> {
-
- public ReferenceDatumLoaderTest() {
- super(ReferenceDatumLoader.class, 4, 3);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.ReferenceDatumType;
+import org.junit.Test;
+
+/**
+ * To test the {@link ReferenceDatumTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class ReferenceDatumTypeLoaderIT extends AbstractLoaderIT<ReferenceDatumType, ReferenceDatumTypeLoader> {
+
+ public ReferenceDatumTypeLoaderIT() {
+ super(ReferenceDatumTypeLoader.class, 3, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/ReferenceDatumTypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.ReferenceDatumType;
-import org.junit.Test;
-
-/**
- * To test the {@link ReferenceDatumTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class ReferenceDatumTypeLoaderTest extends AbstractLoaderTest<ReferenceDatumType, ReferenceDatumTypeLoader> {
-
- public ReferenceDatumTypeLoaderTest() {
- super(ReferenceDatumTypeLoader.class, 3, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.SampleDataType;
+import org.junit.Test;
+
+/**
+ * To test the {@link SampleDataTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SampleDataTypeLoaderIT extends AbstractLoaderIT<SampleDataType, SampleDataTypeLoader> {
+
+ public SampleDataTypeLoaderIT() {
+ super(SampleDataTypeLoader.class, 134, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleDataTypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.SampleDataType;
-import org.junit.Test;
-
-/**
- * To test the {@link SampleDataTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SampleDataTypeLoaderTest extends AbstractLoaderTest<SampleDataType, SampleDataTypeLoader> {
-
- public SampleDataTypeLoaderTest() {
- super(SampleDataTypeLoader.class, 134, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.SampleType;
+import org.junit.Test;
+
+/**
+ * To test the {@link SampleTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SampleTypeLoaderIT extends AbstractLoaderIT<SampleType, SampleTypeLoader> {
+
+ public SampleTypeLoaderIT() {
+ super(SampleTypeLoader.class, 5, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SampleTypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.SampleType;
-import org.junit.Test;
-
-/**
- * To test the {@link SampleTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SampleTypeLoaderTest extends AbstractLoaderTest<SampleType, SampleTypeLoader> {
-
- public SampleTypeLoaderTest() {
- super(SampleTypeLoader.class, 5, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.SexCategory;
+import org.junit.Test;
+
+/**
+ * To test the {@link SexCategoryLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SexCategoryLoaderIT extends AbstractLoaderIT<SexCategory, SexCategoryLoader> {
+
+ public SexCategoryLoaderIT() {
+ super(SexCategoryLoader.class, 4, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SexCategoryLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.SexCategory;
-import org.junit.Test;
-
-/**
- * To test the {@link SexCategoryLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SexCategoryLoaderTest extends AbstractLoaderTest<SexCategory, SexCategoryLoader> {
-
- public SexCategoryLoaderTest() {
- super(SexCategoryLoader.class, 4, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderIT.java (from rev 195, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,45 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import org.junit.Test;
+
+/**
+ * To test the {@link SizeCategoryLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SizeCategoryLoaderIT extends AbstractLoaderIT<SizeCategory, SizeCategoryLoader> {
+
+ public SizeCategoryLoaderIT() {
+ super(SizeCategoryLoader.class, 4, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SizeCategoryLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,45 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.SizeCategory;
-import org.junit.Test;
-
-/**
- * To test the {@link SizeCategoryLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SizeCategoryLoaderTest extends AbstractLoaderTest<SizeCategory, SizeCategoryLoader> {
-
- public SizeCategoryLoaderTest() {
- super(SizeCategoryLoader.class, 4, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.Species;
+import org.junit.Test;
+
+/**
+ * To test the {@link SpeciesLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class SpeciesLoaderIT extends AbstractLoaderIT<Species, SpeciesLoader> {
+
+ public SpeciesLoaderIT() {
+ super(SpeciesLoader.class, 217, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/SpeciesLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.Species;
-import org.junit.Test;
-
-/**
- * To test the {@link SpeciesLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class SpeciesLoaderTest extends AbstractLoaderTest<Species, SpeciesLoader> {
-
- public SpeciesLoaderTest() {
- super(SpeciesLoader.class, 217, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.Strata;
+import org.junit.Test;
+
+/**
+ * To test the {@link StrataLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class StrataLoaderIT extends AbstractLoaderIT<Strata, StrataLoader> {
+
+ public StrataLoaderIT() {
+ super(StrataLoader.class, 0, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/StrataLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.Strata;
-import org.junit.Test;
-
-/**
- * To test the {@link StrataLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class StrataLoaderTest extends AbstractLoaderTest<Strata, StrataLoader> {
-
- public StrataLoaderTest() {
- super(StrataLoader.class, 0, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.TSParameters;
+import org.junit.Test;
+
+/**
+ * To test the {@link TSParametersLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TSParametersLoaderIT extends AbstractLoaderIT<TSParameters, TSParametersLoader> {
+
+ public TSParametersLoaderIT() {
+ super(TSParametersLoader.class, 0, 422);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TSParametersLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.TSParameters;
-import org.junit.Test;
-
-/**
- * To test the {@link TSParametersLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class TSParametersLoaderTest extends AbstractLoaderTest<TSParameters, TSParametersLoader> {
-
- public TSParametersLoaderTest() {
- super(TSParametersLoader.class, 0, 422);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.data.Transect;
+import org.junit.Test;
+
+/**
+ * To test the {@link TransectLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TransectLoaderIT extends AbstractLoaderIT<Transect, TransectLoader> {
+
+ public TransectLoaderIT() {
+ super(TransectLoader.class, 0, 42);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransectLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.data.Transect;
-import org.junit.Test;
-
-/**
- * To test the {@link TransectLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class TransectLoaderTest extends AbstractLoaderTest<Transect, TransectLoader> {
-
- public TransectLoaderTest() {
- super(TransectLoader.class, 0, 42);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.data.Transit;
+import org.junit.Test;
+
+/**
+ * To test the {@link TransitLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class TransitLoaderIT extends AbstractLoaderIT<Transit, TransitLoader> {
+
+ public TransitLoaderIT() {
+ super(TransitLoader.class, 0, 42);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/TransitLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.data.Transit;
-import org.junit.Test;
-
-/**
- * To test the {@link TransitLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class TransitLoaderTest extends AbstractLoaderTest<Transit, TransitLoader> {
-
- public TransitLoaderTest() {
- super(TransitLoader.class, 0, 42);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.Vessel;
+import org.junit.Test;
+
+/**
+ * To test the {@link VesselLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class VesselLoaderIT extends AbstractLoaderIT<Vessel, VesselLoader> {
+
+ public VesselLoaderIT() {
+ super(VesselLoader.class, 0, 6);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.Vessel;
-import org.junit.Test;
-
-/**
- * To test the {@link VesselLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class VesselLoaderTest extends AbstractLoaderTest<Vessel, VesselLoader> {
-
- public VesselLoaderTest() {
- super(VesselLoader.class, 0, 6);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.references.VesselType;
+import org.junit.Test;
+
+/**
+ * To test the {@link VesselTypeLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class VesselTypeLoaderIT extends AbstractLoaderIT<VesselType, VesselTypeLoader> {
+
+ public VesselTypeLoaderIT() {
+ super(VesselTypeLoader.class, 0, 0);
+ }
+
+ @Test
+ public void testGenerateNewEntities() throws Exception {
+ generateNewEntities();
+ }
+
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VesselTypeLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,46 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.references.VesselType;
-import org.junit.Test;
-
-/**
- * To test the {@link VesselTypeLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class VesselTypeLoaderTest extends AbstractLoaderTest<VesselType, VesselTypeLoader> {
-
- public VesselTypeLoaderTest() {
- super(VesselTypeLoader.class, 0, 0);
- }
-
- @Test
- public void testGenerateNewEntities() throws Exception {
- generateNewEntities();
- }
-
-}
Copied: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderIT.java (from rev 194, trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderTest.java)
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderIT.java (rev 0)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderIT.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,92 @@
+/*
+ * #%L
+ * EchoBase :: Tools
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Ifremer, Codelutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero 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 Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+package fr.ifremer.echobase.tools.loaders;
+
+import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.meta.AssociationMeta;
+import fr.ifremer.echobase.entities.meta.MetaFilenameAware;
+import fr.ifremer.echobase.tools.FileType;
+import org.junit.Assert;
+import org.junit.Test;
+import org.nuiton.topia.TopiaException;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Set;
+
+/**
+ * To test the {@link VoyageLoader}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.2
+ */
+public class VoyageLoaderIT extends AbstractLoaderIT<Voyage, VoyageLoader> {
+
+ public VoyageLoaderIT() {
+ super(VoyageLoader.class, 0, 42);
+ }
+
+ @Test
+ public void testGenerateEntitiesFromBaracouda() throws Exception {
+ generateBaracoudaEntities();
+ }
+
+ Set<MetaFilenameAware> dones;
+
+ @Override
+ protected void loadDependencies(Set<MetaFilenameAware> dones) throws IOException, TopiaException {
+ super.loadDependencies(dones);
+ this.dones = dones;
+ }
+
+ @Test
+ public void testGenerateEchotypeAssociation() throws Exception {
+
+ loadDependencies(EchoBaseEntityEnum.Voyage, dones);
+
+ AssociationMeta associationMeta =
+ loader.getMeta().getAssociations(Voyage.PROPERTY_ECHOTYPE);
+
+ File inFile = new File(testdir, "input-" + associationMeta.getFilename());
+
+ File outFile = loader.getTableFile(exportdir, associationMeta, FileType.ASSOCIATION);
+
+ Assert.assertFalse(inFile.exists());
+ Assert.assertFalse(outFile.exists());
+
+ loader.copyStreamToFile(inFile, FileType.NEW);
+
+ Assert.assertTrue(inFile.exists());
+
+
+ loader.generateEchotypeAssociation(
+ inFile,
+ outFile,
+ true
+ );
+
+ Assert.assertTrue(outFile.exists());
+ }
+}
Property changes on: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderIT.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/VoyageLoaderTest.java 2011-12-15 21:53:41 UTC (rev 197)
@@ -1,92 +0,0 @@
-/*
- * #%L
- * EchoBase :: Tools
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 Ifremer, Codelutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero 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 Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-package fr.ifremer.echobase.tools.loaders;
-
-import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.meta.AssociationMeta;
-import fr.ifremer.echobase.entities.meta.MetaFilenameAware;
-import fr.ifremer.echobase.tools.FileType;
-import org.junit.Assert;
-import org.junit.Test;
-import org.nuiton.topia.TopiaException;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Set;
-
-/**
- * To test the {@link VoyageLoader}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public class VoyageLoaderTest extends AbstractLoaderTest<Voyage, VoyageLoader> {
-
- public VoyageLoaderTest() {
- super(VoyageLoader.class, 0, 42);
- }
-
- @Test
- public void testGenerateEntitiesFromBaracouda() throws Exception {
- generateBaracoudaEntities();
- }
-
- Set<MetaFilenameAware> dones;
-
- @Override
- protected void loadDependencies(Set<MetaFilenameAware> dones) throws IOException, TopiaException {
- super.loadDependencies(dones);
- this.dones = dones;
- }
-
- @Test
- public void testGenerateEchotypeAssociation() throws Exception {
-
- loadDependencies(EchoBaseEntityEnum.Voyage, dones);
-
- AssociationMeta associationMeta =
- loader.getMeta().getAssociations(Voyage.PROPERTY_ECHOTYPE);
-
- File inFile = new File(testdir, "input-" + associationMeta.getFilename());
-
- File outFile = loader.getTableFile(exportdir, associationMeta, FileType.ASSOCIATION);
-
- Assert.assertFalse(inFile.exists());
- Assert.assertFalse(outFile.exists());
-
- loader.copyStreamToFile(inFile, FileType.NEW);
-
- Assert.assertTrue(inFile.exists());
-
-
- loader.generateEchotypeAssociation(
- inFile,
- outFile,
- true
- );
-
- Assert.assertTrue(outFile.exists());
- }
-}
Added: trunk/echobase-tools/src/test/resources/csv/new/input-Gear.csv
===================================================================
--- trunk/echobase-tools/src/test/resources/csv/new/input-Gear.csv (rev 0)
+++ trunk/echobase-tools/src/test/resources/csv/new/input-Gear.csv 2011-12-15 21:53:41 UTC (rev 197)
@@ -0,0 +1,192 @@
+CasinoGearName;ValidSince;InvalidSince;IsFishingGear;gearLabel;GearName;Description;UpdateDate;GearClassification;ParentGear;Status;IsActive;IsTowed
+119x102;01/01/00;;1;119x102;Chalut pélagique 119/102;;;5;;;1;1
+36x47;01/01/00;;1;GV3647;Chalut de fond GOV 36/47;;;5;;;1;1
+57x52;01/01/00;;1;57x52;Chalut pélagique 57/52;;;5;;;1;1
+57x52-F LAR;01/01/00;;1;57x52;Chalut pélagique 57/52;;;5;;;1;1
+57x52-FFIL;01/01/00;;1;57x52;Chalut pélagique 57/52;;;5;;;1;1
+725OBS;01/01/00;;1;PS;Filets tournants avec coulisse (sennes coulissantes);"Nom anglais : Surrounding nets with purse lines (purse seines)
+code ISSCFG : 01.1.0";07/12/2011 16:31:24.407001;1;;1;1;0
+76x70;01/01/00;;1;76x70;Chalut pélagique 76/70;;;5;;;1;1
+76x70-F LAR;01/01/00;;1;76x70;Chalut pélagique 76/70;;;5;;;1;1
+76x70-FFIL;01/01/00;;1;76x70;Chalut pélagique 76/70;;;5;;;1;1
+942OBS;01/01/00;;1;942OBS;Chalut pélagique (2 navires);;;5;;;1;1
+Bolinche;01/01/00;;1;PS;Filets tournants avec coulisse (sennes coulissantes);"Nom anglais : Surrounding nets with purse lines (purse seines)
+code ISSCFG : 01.1.0";07/12/2011 16:31:24.407001;1;;1;1;0
+FC - NEUSTON;01/01/00;;0;NEUSTON;Chalut épi-pélagique « de surface » 1250mu;;;5;;;1;1
+FC ? NEUSTON;01/01/00;;0;NEUSTON;Chalut épi-pélagique « de surface » 1250mu;;;5;;;1;1
+FILET CARRE;01/01/00;;0;CARRE;FILET CARRE 500mu;;;5;;;1;1
+MEPEL;01/01/00;;0;MEPEL;Chalut meso-pel 50 m²;;;5;;;1;1
+MEPEL-DEBPEC;01/01/00;;0;MEPEL;Chalut meso-pel 50 m²;;;5;;;1;1
+NEUSTON;01/01/00;;0;NEUSTON;Chalut épi-pélagique « de surface » 1250mu;;;5;;;1;1
+Pélagique en boeufs;01/01/00;;1;PTM;Chaluts boeufs pélagiques;"Nom anglais : Pair trawls Midwater
+code ISSCFG : 03.2.2";07/12/2011 16:31:24.446356;1;20;1;1;1
+RP-F LAR;01/01/00;;1;70x72;Chalut pélagique 70/72 (pelacus 2007);;;5;;;1;1
+;01/01/00;;0;PTGM;Chalut Pélagique (PELMED);;;;;;;
+;;;1;BTF;Engins à appâts vivants;Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO);07/12/2011 16:31:24.758362;1;;0;;
+;;;1;CTB;Chalut de fond pour crustacés;"Nom anglais : Crustacean Trawl Bottom
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.533508;1;16;0;1;1
+;;;1;DCL;DCP Lignes et palangres (non spécifiées);code ISSCFG : 09.9.0;07/12/2011 16:31:24.733670;1;;0;0;0
+;;;1;DCP;DCP Sennes tournantes coulissantes;code ISSCFG : 01.1.0;07/12/2011 16:31:24.734591;1;;0;1;0
+;;;1;DHB;Dragues à main manoeuvrées à partir du bateau;"Nom anglais : hand dredge operated from the boat
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.535290;1;;1;1;1
+;;;1;DHS;Dragues à main manoeuvrées à partir du rivage;"Nom anglais : hand dredge operated from the shore
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.536861;1;;1;1;1
+;;;1;DR;Dragues (non spécifiées);Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO);07/12/2011 16:31:24.538555;1;;0;1;1
+;;;1;DRB;Dragues remorquées par bateau;"Nom anglais : Boat dredges
+code ISSCFG : 04.1.0";07/12/2011 16:31:24.773612;1;66;1;1;1
+;;;1;DRH;Dragues à main;"Nom anglais : Hand dredges
+code ISSCFG : 04.2.0";07/12/2011 16:31:24.746489;1;66;0;1;1
+;;;1;FAG;Balais, Fagots ;"Nom anglais : prawn faggot
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.540198;1;;1;0;0
+;;;1;FAR;Pièges aériens;"Nom anglais : Aerial traps
+code ISSCFG : 08.6.0";07/12/2011 16:31:24.750971;1;;1;0;0
+;;;1;FCN;Eperviers;"Nom anglais : Cast nets
+code ISSCFG : 06.1.0";07/12/2011 16:31:24.729465;1;;1;1;0
+;;;1;FDV;Apnée ;"Nom anglais : Free-diving
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.541773;1;;1;1;0
+;;;1;FG;Autres engins retombants (non spécifiés);"Nom anglais : Falling gear (not specified)
+code ISSCFG : 06.9.0";07/12/2011 16:31:24.478923;1;;0;1;0
+;;;1;FIX;Pièges (non spécifiés);"Nom anglais : Traps (not specified)
+code ISSCFG : 08.9.0";07/12/2011 16:31:24.751964;1;;1;0;0
+;;;1;FOO;Pêche à pied ;"Nom anglais : shellfish-gathering / foot-fishing
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.543235;1;;1;1;0
+;;;1;FPN;Filets pièges fixes non couverts;"Nom anglais : Stationary uncovered pound nets
+code ISSCFG : 08.1.0";07/12/2011 16:31:24.749940;1;;1;0;0
+;;;1;FPO;Nasses (casiers non spécifiés);"Nom anglais : Pots
+code ISSCFG : 08.2.0";07/12/2011 16:31:24.495699;1;;1;0;0
+;;;1;FSN;Filets à l'étalage (diables);"Nom anglais : Stow nets
+code ISSCFG : 08.4.0";07/12/2011 16:31:24.498878;1;;1;0;0
+;;;1;FWR;Barrages, parcs, bordigues,etc.;"Nom anglais : Barriers, fences, weirs,etc.
+code ISSCFG : 08.5.0";07/12/2011 16:31:24.500430;1;;1;0;0
+;;;1;FY_;Capéchades, Trabaques;code ISSCFG : 08.3.0;07/12/2011 16:31:24.820709;1;;1;0;0
+;;;1;FYK;Verveux;"Nom anglais : Fyke nets
+code ISSCFG : 08.3.0";07/12/2011 16:31:24.497265;1;;1;0;0
+;;;1;GEN;Filets maillants et filets emmêlants (non spécifiés);"Nom anglais : Gillnets and entangling nets (not specified)
+code ISSCFG : 07.9.0";07/12/2011 16:31:24.490610;1;;1;0;0
+;;;1;GES;Tamis ;"Nom anglais : Glass eel sieve
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.544976;1;;1;1;1
+;;;1;GN;Filets maillants (non spécifiés);"Nom anglais : Gillnets (not specified)
+code ISSCFG : 07.9.1";07/12/2011 16:31:24.492356;1;;1;0;0
+;;;1;GNC;Filets maillants encerclants;"Nom anglais : Encircling gillnets
+code ISSCFG : 07.3.0";07/12/2011 16:31:24.810175;1;;1;1;0
+;;;1;GND;Filets maillants dérivants (filets dérivants);"Nom anglais : Driftnets
+code ISSCFG : 07.2.0";07/12/2011 16:31:24.482325;1;;1;0;0
+;;;1;GNE;Filets flottants (maillants calés);code ISSCFG : 07.1.0;07/12/2011 16:31:24.730379;1;;1;0;0
+;;;1;GNF;Filets maillants fixes (sur perches);"Nom anglais : Fixed gillnets (on stakes)
+code ISSCFG : 07.4.0";07/12/2011 16:31:24.748969;1;;1;0;0
+;;;1;GNS;Filets maillants calés (ancrés, filets maillants de fond à une nappe);"Nom anglais : Set gillnets (anchored)
+code ISSCFG : 07.1.0";07/12/2011 16:31:24.480637;1;;1;0;0
+;;;1;GTN;Trémails et filets maillants combinés;"Nom anglais : Combined gillnets-trammel nets
+code ISSCFG : 07.6.0";07/12/2011 16:31:24.809215;1;;1;0;0
+;;;1;GTR;Trémails;"Nom anglais : Trammel nets
+code ISSCFG : 07.5.0";07/12/2011 16:31:24.789066;1;;1;0;0
+;;;1;HAR;Harpons;"Nom anglais : Harpoons
+code ISSCFG : 10.1.0";07/12/2011 16:31:24.752945;1;;1;1;0
+;;;1;HES;Haveneaux, Épuisettes, Salabardes;code ISSCFG : 20.2.0;07/12/2011 16:31:24.802239;1;;1;1;0
+;;;1;HMD;Dragues mécanisées;"Nom anglais : Mechanized dredges
+code ISSCFG : 11.2.0";07/12/2011 16:31:24.754922;1;;1;1;1
+;;;1;HMP;Pompes;"Nom anglais : Pumps
+code ISSCFG : 11.1.0";07/12/2011 16:31:24.753922;1;;1;1;0
+;;;1;HMS;Scoubidou ;"Nom anglais : kelp (seaweed) harvest gear
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.546704;1;;1;1;0
+;;;1;HMX;Engins de récolte (non spécifiés);"Nom anglais : Harvesting machines (not specified)
+code ISSCFG : 11.9.0";07/12/2011 16:31:24.755957;1;;0;1;0
+;;;1;LA;Filets tournants sans coulisse (filet lamparo);"Nom anglais : Surrounding nets without purse lines (lampara)
+code ISSCFG : 01.2.0";07/12/2011 16:31:24.415929;1;;1;1;0
+;;;1;LH;Lignes à main;"Nom anglais : Handlines
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.548391;1;;1;0;0
+;;;1;LHM;Lignes à main et lignes avec cannes (mécanisées);"Nom anglais : Handlines and pole-lines (mechanized)
+code ISSCFG : 09.2.0";07/12/2011 16:31:24.509083;1;;1;0;0
+;;;1;LHP;Lignes à main et lignes avec cannes (manoeuvrées à la main);"Nom anglais : Handlines and pole-lines (hand operated)
+code ISSCFG : 09.1.0";07/12/2011 16:31:24.507360;1;;1;0;0
+;;;1;LL;Palangres (non spécifiées);"Nom anglais : Longlines (not specified)
+code ISSCFG : 09.5.0";07/12/2011 16:31:24.514432;1;;1;0;0
+;;;1;LLD;Palangres dérivantes;"Nom anglais : Drifting longlines
+code ISSCFG : 09.4.0";07/12/2011 16:31:24.769478;1;;1;0;0
+;;;1;LLF;Palangres calées flottantes;code ISSCFG : 09.3.0;07/12/2011 16:31:24.712660;1;;1;0;0
+;;;1;LLS;Palangres calées (fixes);"Nom anglais : Set longlines
+code ISSCFG : 09.3.0";07/12/2011 16:31:24.510704;1;;1;0;0
+;;;1;LN;Filets soulevés (non spécifiés);"Nom anglais : Lift nets (not specified)
+code ISSCFG : 05.9.0";07/12/2011 16:31:24.475497;1;;1;1;0
+;;;1;LNB;Filets soulevés manoeuvrés du bateau;"Nom anglais : Boat- operated lift nets
+code ISSCFG : 05.2.0";13/12/2011 09:54:34.515543;1;30;1;1;0
+;;;1;LNP;Filets soulevés portatifs;"Nom anglais : Portable lift nets
+code ISSCFG : 05.1.0";07/12/2011 16:31:24.470231;1;30;1;1;0
+;;;1;LNS;Filets soulevés fixes manoeuvrés du rivage;"Nom anglais : Shore-operated stationary lift nets
+code ISSCFG : 05.3.0";13/12/2011 09:54:49.063566;1;30;1;1;0
+;;;1;LSP;Lignes calées (avec ou sans canne);code ISSCFG : 09.3.0;07/12/2011 16:31:24.717796;1;;1;0;0
+;;;1;LTF;Lignes traînantes de fond;code ISSCFG : 09.6.0;07/12/2011 16:31:24.732639;1;;1;0;1
+;;;1;LTL;Lignes de traîne;"Nom anglais : Trolling lines
+code ISSCFG : 09.6.0";07/12/2011 16:31:24.713889;1;;1;0;1
+;;;1;LTP;Lignes de traîne profondes;code ISSCFG : 09.6.0;07/12/2011 16:31:24.728425;1;;1;0;1
+;;;1;LTS;Lignes de traîne de surface;code ISSCFG : 09.6.0;07/12/2011 16:31:24.727415;1;;1;0;1
+;;;1;LVD;Palangres verticales dérivantes;"Nom anglais : vertical drifting longline
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.771250;1;;1;0;0
+;;;1;LVS;Palangres verticales de fond;"Nom anglais : vertical bottom set longline
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.770400;1;;1;0;0
+;;;1;LX;Hameçons et lignes (non spécifiés);"Nom anglais : Hooks and lines (not specified)
+code ISSCFG : 09.9.0";07/12/2011 16:31:24.517992;1;;1;0;0
+;;;1;MIG;Miquelon Filets maillants dérivants;code ISSCFG : 07.2.0;07/12/2011 16:31:24.736450;1;;0;0;0
+;;;1;MIL;Miquelon Lignes et palangres (non spécifiées);code ISSCFG : 09.9.0;07/12/2011 16:31:24.735541;1;;0;0;0
+;;;1;MIS;Divers engins de pêche;"Nom anglais : Miscellaneous Gear
+code ISSCFG : 20.0.0";07/12/2011 16:31:24.526691;1;61;0;;
+;;;1;NK;Engins de pêche inconnus ou non spécifiés;"Nom anglais : Gear not know or not specified
+code ISSCFG : 99.0.0";07/12/2011 16:31:24.530050;1;;0;;
+;;;1;NO;Pas d'engin;Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO);07/12/2011 16:31:24.553262;1;;1;0;0
+;;;1;OFG;Autres engins fixes et autres (autres arts dormants);"Nom anglais : Other fixed gears and others not specified
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.555477;1;;0;0;0
+;;;1;OT;Chaluts à panneaux (non spécifiés);"Nom anglais : Otter trawls (not specified)
+code ISSCFG : 03.4.9";07/12/2011 16:31:24.453184;1;;0;1;1
+;;;1;OTB;Chaluts de fond à panneaux;"Nom anglais : 0tter trawls Bottom
+code ISSCFG : 03.1.2";07/12/2011 16:31:24.433364;1;16;1;1;1
+;;;1;OTG;Autres engins remorqués (autres arts traînants);"Nom anglais : Other Gears
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.557177;1;;0;1;1
+;;;1;OTM;Chaluts pélagiques à panneaux;"Nom anglais : Otter trawls Midwater
+code ISSCFG : 03.2.1";07/12/2011 16:31:24.444477;1;20;1;1;1
+;;;1;OTT;Chaluts jumeaux à panneaux;"Nom anglais : Otter twin trawl
+code ISSCFG : 03.3.0";07/12/2011 16:31:24.451529;1;;1;1;1
+;;;1;PRE;Charter de pêche récréative (lignes et palangres);code ISSCFG : 09.9.0;07/12/2011 16:31:24.738888;1;;1;0;0
+;;;1;PS;Filets tournants avec coulisse (sennes coulissantes);"Nom anglais : Surrounding nets with purse lines (purse seines)
+code ISSCFG : 01.1.0";07/12/2011 16:31:24.407001;1;;1;1;0
+;;;1;PS1;Sennes (à poche) manoeuvrées par un bateau;"Nom anglais : One boat operated purse seines
+code ISSCFG : 01.1.1";07/12/2011 16:31:24.410906;1;1;1;1;0
+;;;1;PS2;Sennes (à poche) manoeuvrées par deux bateaux;"Nom anglais : Two boats operated purse seines
+code ISSCFG : 01.1.2";07/12/2011 16:31:24.413219;1;1;1;1;0
+;;;1;PT;Chaluts boeufs (non spécifiés);"Nom anglais : Pair trawls (not specified)
+code ISSCFG : 03.5.9";07/12/2011 16:31:24.455721;1;;0;1;1
+;;;1;PTB;Chaluts boeufs de fond;"Nom anglais : Pair trawls Bottom
+code ISSCFG : 03.1.3";07/12/2011 16:31:24.435597;1;16;1;1;1
+;;;1;PTM;Chaluts boeufs pélagiques;"Nom anglais : Pair trawls Midwater
+code ISSCFG : 03.2.2";07/12/2011 16:31:24.446356;1;20;1;1;1
+;;;1;RG;Engins de pêche récréative;"Nom anglais : Recreational Fishing Gear
+code ISSCFG : 25.0.0";07/12/2011 16:31:24.528467;1;;0;;
+;;;1;SB;Sennes de plage;"Nom anglais : Beach seines
+code ISSCFG : 02.1.0";07/12/2011 16:31:24.418054;1;10;1;1;0
+;;;1;SDN;Sennes danoises (mouillées);"Nom anglais : Danish seines
+code ISSCFG : 02.2.1";07/12/2011 16:31:24.422422;1;10;1;1;0
+;;;1;SDV;Plongée sous-marine ;"Nom anglais : scuba-diving
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.559088;1;;1;1;0
+;;;1;SPR;Sennes manoeuvrées par deux bateaux;"Nom anglais : Pair seines
+code ISSCFG : 02.2.3";07/12/2011 16:31:24.426787;1;10;1;1;0
+;;;1;SSC;Sennes écossaises (volantes);"Nom anglais : Scottish seines
+code ISSCFG : 02.2.2";07/12/2011 16:31:24.739896;1;10;1;1;0
+;;;1;SV;Sennes halées à bord;"Nom anglais : Boat or vessel seines
+code ISSCFG : 02.2.0";07/12/2011 16:31:24.420161;1;10;1;1;0
+;;;1;SX;Sennes (non spécifiées);"Nom anglais : Seine nets (not specified)
+code ISSCFG : 02.9.0";07/12/2011 16:31:24.429020;1;;1;1;0
+;;;1;TB;Chaluts de fond (non spécifié);"Nom anglais : Bottom trawls (not specified)
+code ISSCFG : 03.1.9";07/12/2011 16:31:24.442257;1;;1;1;1
+;;;1;TBB;Chaluts à perche;"Nom anglais : Beam Bottom trawls
+code ISSCFG : 03.1.1";07/12/2011 16:31:24.791360;1;16;1;1;1
+;;;1;TBN;Chaluts à langoustines;"Nom anglais : Nephrops Bottom trawls
+code ISSCFG : 03.1.4";07/12/2011 16:31:24.437667;1;16;1;1;1
+;;;1;TBS;Chaluts à crevettes (Fond);"Nom anglais : Shrimp Bottom trawls
+code ISSCFG : 03.1.5";07/12/2011 16:31:24.440049;1;16;1;1;1
+;;;1;TM;Chaluts pélagiques (non spécifiés);"Nom anglais : Midwater trawls (not specified)
+code ISSCFG : 03.2.9";07/12/2011 16:31:24.449861;1;;1;1;1
+;;;1;TMB;Gangui ;"Nom anglais : Mediterranean beam-trawl
+Pas de code ISSCFG officiel (=extension Ifremer du référentiel FAO)";07/12/2011 16:31:24.560687;1;;1;1;1
+;;;1;TMS;Chaluts à crevettes (Mi-profondeur);"Nom anglais : Shrimp trawls Midwater
+code ISSCFG : 03.2.3";07/12/2011 16:31:24.744006;1;20;1;1;1
+;;;1;TX;Autres chaluts (non spécifiés);"Nom anglais : Other trawls (not specified)
+code ISSCFG : 03.9.0";07/12/2011 16:31:24.457337;1;;0;1;1
\ No newline at end of file
Property changes on: trunk/echobase-tools/src/test/resources/csv/new/input-Gear.csv
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/src/doc/reunions/reunion-2011-12-14.txt
===================================================================
--- trunk/src/doc/reunions/reunion-2011-12-14.txt 2011-12-15 20:47:32 UTC (rev 196)
+++ trunk/src/doc/reunions/reunion-2011-12-14.txt 2011-12-15 21:53:41 UTC (rev 197)
@@ -47,6 +47,7 @@
- Remplissage du référentiel SizeCategory
- Remplissage du référentiel OperationMetadata
- Remplissage du référentiel GearMetadata
+- Remplissage du référentiel Gear
Action
------
1
0
r196 - trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders
by tchemit@users.forge.codelutin.com 15 Dec '11
by tchemit@users.forge.codelutin.com 15 Dec '11
15 Dec '11
Author: tchemit
Date: 2011-12-15 21:47:32 +0100 (Thu, 15 Dec 2011)
New Revision: 196
Url: http://forge.codelutin.com/repositories/revision/echobase/196
Log:
reput all cell loading
Modified:
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java 2011-12-15 20:46:14 UTC (rev 195)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/loaders/CellLoaderTest.java 2011-12-15 20:47:32 UTC (rev 196)
@@ -73,33 +73,33 @@
public static List<Object[]> data() {
return Arrays.asList(new Object[][]{
{"EIT_00_38", 0},
-// {"EIT_01_38", 0},
-// {"EIT_02_38", 0},
-// {"EIT_03_38", 0},
-// {"EIT_0310_38", 0},
-// {"EIT_04_38", 0},
-// {"EIT_05_38", 0},
-// {"EIT_0510_38", 0}, // with no region
-// {"EIT_06_38", 0},
-// {"EIT_07_38", 0},
-// {"EIT_08_38", 0},
-// {"EIT_09_38", 0},
-// {"EIT_10_38", 0},
-// {"EIT_83A_38", 0}, // with no region
-// {"EIT_83B_38", 0}, // with no region
-// {"EIT_84_38", 0}, // with no region
-// {"EIT_85_38", 0}, // with no region
-// {"EIT_86_38", 0}, // with no region
-// {"EIT_87_38", 0}, // with no region
-// {"EIT_89A_38", 0}, // with no region
-// {"EIT_89B_38", 0}, // with no region
-// {"EIT_90_38", 0}, // with no region
-// {"EIT_91_38", 0}, // with no region
-// {"EIT_92_38", 0}, // with no region
-// {"EIT_93_38", 0}, // with no region
-// {"EIT_94_38", 0}, // with no region
-// {"EIT_97_38", 0}, // with no region
-// {"EIT_98b_38", 0},
+ {"EIT_01_38", 0},
+ {"EIT_02_38", 0},
+ {"EIT_03_38", 0},
+ {"EIT_0310_38", 0},
+ {"EIT_04_38", 0},
+ {"EIT_05_38", 0},
+ {"EIT_0510_38", 0}, // with no region
+ {"EIT_06_38", 0},
+ {"EIT_07_38", 0},
+ {"EIT_08_38", 0},
+ {"EIT_09_38", 0},
+ {"EIT_10_38", 0},
+ {"EIT_83A_38", 0}, // with no region
+ {"EIT_83B_38", 0}, // with no region
+ {"EIT_84_38", 0}, // with no region
+ {"EIT_85_38", 0}, // with no region
+ {"EIT_86_38", 0}, // with no region
+ {"EIT_87_38", 0}, // with no region
+ {"EIT_89A_38", 0}, // with no region
+ {"EIT_89B_38", 0}, // with no region
+ {"EIT_90_38", 0}, // with no region
+ {"EIT_91_38", 0}, // with no region
+ {"EIT_92_38", 0}, // with no region
+ {"EIT_93_38", 0}, // with no region
+ {"EIT_94_38", 0}, // with no region
+ {"EIT_97_38", 0}, // with no region
+ {"EIT_98b_38", 0},
});
}
1
0