This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 1214c508f3a98dd2194b522db3e61aa57c552d7a Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Feb 15 16:11:07 2015 +0100 normalize export service classes --- ...ontext.java => GenericFormatExportContext.java} | 20 ++++---- ...va => GenericFormatExportOperationContext.java} | 22 ++++---- .../genericformat/GenericFormatExportService.java | 58 +++++++++++----------- .../producer/CsvProducerForAccidentalCatch.java | 8 +-- .../producer/CsvProducerForCatch.java | 12 ++--- .../CsvProducerForIndividualObservation.java | 8 +-- .../producer/CsvProducerForMarineLitter.java | 4 +- .../GenericFormatExportServiceTest.java | 26 +++++----- 8 files changed, 79 insertions(+), 79 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GlobalExportContext.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportContext.java similarity index 93% rename from tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GlobalExportContext.java rename to tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportContext.java index 0d77a89..9954494 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GlobalExportContext.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportContext.java @@ -46,11 +46,11 @@ import java.util.Map; * @author Tony Chemit - chemit@codelutin.com * @since 3.13 */ -public class GlobalExportContext implements Closeable { +public class GenericFormatExportContext implements Closeable { private final SampleCategoryModel sampleCategoryModel; - protected Map<String, OperationExportContext> operationContexts = Maps.newTreeMap(); + protected Map<String, GenericFormatExportOperationContext> operationContexts = Maps.newTreeMap(); private final GenericFormatArchive archive; @@ -96,11 +96,11 @@ public class GlobalExportContext implements Closeable { protected String checkError; - GlobalExportContext(GenericFormatArchive archive, - char csvSeparator, - PersistenceService persistenceService, - WeightComputingService weightComputingService, - SampleCategoryModel sampleCategoryModel) { + GenericFormatExportContext(GenericFormatArchive archive, + char csvSeparator, + PersistenceService persistenceService, + WeightComputingService weightComputingService, + SampleCategoryModel sampleCategoryModel) { this.archive = archive; @@ -135,14 +135,14 @@ public class GlobalExportContext implements Closeable { } - public OperationExportContext getOperationContext(Cruise cruise, FishingOperation operation) { + public GenericFormatExportOperationContext getOperationContext(Cruise cruise, FishingOperation operation) { String operationId = operation.getId(); - OperationExportContext operationExportContext = operationContexts.get(operationId); + GenericFormatExportOperationContext operationExportContext = operationContexts.get(operationId); if (operationExportContext == null) { - operationExportContext = new OperationExportContext(cruise, + operationExportContext = new GenericFormatExportOperationContext(cruise, operation, persistenceService, weightComputingService, diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/OperationExportContext.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportOperationContext.java similarity index 87% rename from tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/OperationExportContext.java rename to tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportOperationContext.java index 1e55f1a..b17f267 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/OperationExportContext.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportOperationContext.java @@ -27,10 +27,10 @@ import java.util.List; * @author Tony Chemit - chemit@codelutin.com * @since 3.13 */ -public class OperationExportContext { +public class GenericFormatExportOperationContext { /** Logger. */ - private static final Log log = LogFactory.getLog(OperationExportContext.class); + private static final Log log = LogFactory.getLog(GenericFormatExportOperationContext.class); private final Cruise cruise; @@ -62,15 +62,15 @@ public class OperationExportContext { private final SampleCategoryModel sampleCategoryModel; - public OperationExportContext(Cruise cruise, - FishingOperation operation, - PersistenceService persistenceService, - WeightComputingService weightComputingService, - SampleCategoryModel sampleCategoryModel, - Caracteristic weightMeasuredCaracteristic, - Caracteristic pmfmIdCaracteristic, - Caracteristic deadOrAliveCaracteristic, - Caracteristic genderCaracteristic) { + public GenericFormatExportOperationContext(Cruise cruise, + FishingOperation operation, + PersistenceService persistenceService, + WeightComputingService weightComputingService, + SampleCategoryModel sampleCategoryModel, + Caracteristic weightMeasuredCaracteristic, + Caracteristic pmfmIdCaracteristic, + Caracteristic deadOrAliveCaracteristic, + Caracteristic genderCaracteristic) { this.cruise = cruise; this.operation = operation; this.sampleCategoryModel = sampleCategoryModel; diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService.java index 31c22b3..5f260d6 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportService.java @@ -179,7 +179,7 @@ public class GenericFormatExportService extends AbstractTuttiService { GenericFormatArchive genericFormatArchive = GenericFormatArchive.forExport(exportFile, context.getConfig().getTmpDirectory()); - try (GlobalExportContext exportContext = createExportContext(genericFormatArchive)) { + try (GenericFormatExportContext exportContext = createExportContext(genericFormatArchive)) { for (Cruise cruise : allCruise) { @@ -237,7 +237,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } GenericFormatArchive genericFormatArchive = GenericFormatArchive.forExport(exportFile, context.getConfig().getTmpDirectory()); - try (GlobalExportContext exportContext = createExportContext(genericFormatArchive)) { + try (GenericFormatExportContext exportContext = createExportContext(genericFormatArchive)) { exportCruise(cruise, exportContext, progressionModel); @@ -288,7 +288,7 @@ public class GenericFormatExportService extends AbstractTuttiService { GenericFormatArchive genericFormatArchive = GenericFormatArchive.forExport(null, context.getConfig().getTmpDirectory()); - try (GlobalExportContext exportContext = createExportContext(genericFormatArchive)) { + try (GenericFormatExportContext exportContext = createExportContext(genericFormatArchive)) { FishingOperation fishingOperation = persistenceService.getFishingOperation(fishingOperationId); @@ -309,9 +309,9 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected GlobalExportContext createExportContext(GenericFormatArchive genericFormatArchive) { + protected GenericFormatExportContext createExportContext(GenericFormatArchive genericFormatArchive) { - return new GlobalExportContext(genericFormatArchive, + return new GenericFormatExportContext(genericFormatArchive, ';', persistenceService, weightComputingService, @@ -402,7 +402,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void terminatesExport(GlobalExportContext exportContext, ProgressionModel progressionModel) { + protected void terminatesExport(GenericFormatExportContext exportContext, ProgressionModel progressionModel) { SampleCategoryModel sampleCategoryModel = exportContext.getSampleCategoryModel(); increments(progressionModel, t("tutti.service.genericExport.exportSampleCategoyModel", sampleCategoryModel.getNbSampling())); @@ -431,7 +431,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportTemporaryGears(GlobalExportContext exportContext, List<Gear> temporaryGears) { + protected void exportTemporaryGears(GenericFormatExportContext exportContext, List<Gear> temporaryGears) { try { @@ -446,7 +446,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportTemporaryPersons(GlobalExportContext exportContext, List<Person> temporaryPersons) { + protected void exportTemporaryPersons(GenericFormatExportContext exportContext, List<Person> temporaryPersons) { try { @@ -461,7 +461,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportTemporarySpeciess(GlobalExportContext exportContext, List<Species> temporarySpeciess) { + protected void exportTemporarySpeciess(GenericFormatExportContext exportContext, List<Species> temporarySpeciess) { try { @@ -476,7 +476,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportTemporaryVessels(GlobalExportContext exportContext, List<Vessel> temporaryVessels) { + protected void exportTemporaryVessels(GenericFormatExportContext exportContext, List<Vessel> temporaryVessels) { try { @@ -491,7 +491,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportSampleCategoryModel(GlobalExportContext exportContext, SampleCategoryModel sampleCategoryModel) { + protected void exportSampleCategoryModel(GenericFormatExportContext exportContext, SampleCategoryModel sampleCategoryModel) { try { @@ -506,7 +506,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportProtocol(GlobalExportContext exportContext, ProgressionModel progressionModel) { + protected void exportProtocol(GenericFormatExportContext exportContext, ProgressionModel progressionModel) { boolean protocolFilled = context.getDataContext().isProtocolFilled(); if (protocolFilled) { @@ -521,14 +521,14 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportCruise(Cruise cruise, GlobalExportContext exportContext, ProgressionModel progressionModel) { + protected void exportCruise(Cruise cruise, GenericFormatExportContext exportContext, ProgressionModel progressionModel) { List<FishingOperation> operations = persistenceService.getAllFishingOperation(cruise.getId()); exportCruise(cruise, operations, exportContext, progressionModel); } - protected void exportCruise(Cruise cruise, List<FishingOperation> operations, GlobalExportContext exportContext, ProgressionModel progressionModel) { + protected void exportCruise(Cruise cruise, List<FishingOperation> operations, GenericFormatExportContext exportContext, ProgressionModel progressionModel) { // load fully operations List<FishingOperation> loadedOperations = Lists.newArrayListWithCapacity(operations.size()); @@ -564,7 +564,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportSurvey(GlobalExportContext exportContext, Cruise cruise) { + protected void exportSurvey(GenericFormatExportContext exportContext, Cruise cruise) { List<TuttiLocation> allCountry = persistenceService.getAllCountry(); String countryId = context.getConfig().getExportCountryId(); @@ -582,7 +582,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportGearCaracteristics(GlobalExportContext exportContext, Cruise cruise) { + protected void exportGearCaracteristics(GenericFormatExportContext exportContext, Cruise cruise) { try { CsvProducerForGearCaracteristics producerForGearCaracteristics = exportContext.getProducerForGearCaracteristics(); @@ -607,7 +607,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportOperations(GlobalExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { + protected void exportOperations(GenericFormatExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { try { @@ -617,7 +617,7 @@ public class GenericFormatExportService extends AbstractTuttiService { for (FishingOperation operation : operations) { - OperationExportContext operationContext = exportContext.getOperationContext(cruise, operation); + GenericFormatExportOperationContext operationContext = exportContext.getOperationContext(cruise, operation); CatchBatch catchBatch = operationContext.getCatchBatch(); OperationRow operationRow = producerForOperation.getDataToExport(cruise, operation, catchBatch); @@ -632,7 +632,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportParameters(GlobalExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { + protected void exportParameters(GenericFormatExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { try { @@ -650,14 +650,14 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportMarineLitters(GlobalExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { + protected void exportMarineLitters(GenericFormatExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { try { CsvProducerForMarineLitter producerForMarineLitter = exportContext.getProducerForMarineLitter(); for (FishingOperation operation : operations) { - OperationExportContext operationContext = exportContext.getOperationContext(cruise, operation); + GenericFormatExportOperationContext operationContext = exportContext.getOperationContext(cruise, operation); boolean withCatchBatch = operationContext.isWithCatchBatch(); if (!withCatchBatch) { @@ -674,7 +674,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportIndividualObservations(GlobalExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { + protected void exportIndividualObservations(GenericFormatExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { try { @@ -682,7 +682,7 @@ public class GenericFormatExportService extends AbstractTuttiService { CsvProducerForSpecies producerForSpecies = exportContext.getProducerForSpecies(); for (FishingOperation operation : operations) { - OperationExportContext operationContext = exportContext.getOperationContext(cruise, operation); + GenericFormatExportOperationContext operationContext = exportContext.getOperationContext(cruise, operation); boolean withCatchBatch = operationContext.isWithCatchBatch(); if (!withCatchBatch) { @@ -698,7 +698,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportAccidentalCatch(GlobalExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { + protected void exportAccidentalCatch(GenericFormatExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { try { CsvProducerForAccidentalCatch producerForAccidentalCatch = exportContext.getProducerForAccidentalCatch(); @@ -706,7 +706,7 @@ public class GenericFormatExportService extends AbstractTuttiService { for (FishingOperation operation : operations) { - OperationExportContext operationContext = exportContext.getOperationContext(cruise, operation); + GenericFormatExportOperationContext operationContext = exportContext.getOperationContext(cruise, operation); List<AccidentalCatchRow> rows = producerForAccidentalCatch.getDataToExport(operationContext); producerForSpecies.prepareAccidentalRows(rows); @@ -718,12 +718,12 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportCatches(GlobalExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { + protected void exportCatches(GenericFormatExportContext exportContext, Cruise cruise, List<FishingOperation> operations) { try { for (FishingOperation operation : operations) { - OperationExportContext operationContext = exportContext.getOperationContext(cruise, operation); + GenericFormatExportOperationContext operationContext = exportContext.getOperationContext(cruise, operation); boolean withCatchBatch = operationContext.isWithCatchBatch(); if (!withCatchBatch) { @@ -739,7 +739,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } } - protected void exportCatch(GlobalExportContext exportContext, OperationExportContext operationContext) throws Exception { + protected void exportCatch(GenericFormatExportContext exportContext, GenericFormatExportOperationContext operationContext) throws Exception { CatchBatch catchBatch = operationContext.getCatchBatch(); @@ -803,7 +803,7 @@ public class GenericFormatExportService extends AbstractTuttiService { } - protected void exportSpecies(GlobalExportContext exportContext) { + protected void exportSpecies(GenericFormatExportContext exportContext) { try { diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForAccidentalCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForAccidentalCatch.java index 09fa013..b1c33e9 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForAccidentalCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForAccidentalCatch.java @@ -4,7 +4,7 @@ import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.data.AccidentalBatch; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.service.csv.CsvProducer; -import fr.ifremer.tutti.service.genericformat.OperationExportContext; +import fr.ifremer.tutti.service.genericformat.GenericFormatExportOperationContext; import fr.ifremer.tutti.service.genericformat.csv.AccidentalCatchModel; import fr.ifremer.tutti.service.genericformat.csv.AccidentalCatchRow; import org.apache.commons.collections4.CollectionUtils; @@ -28,7 +28,7 @@ public class CsvProducerForAccidentalCatch extends CsvProducer<AccidentalCatchRo super(file, model); } - public List<AccidentalCatchRow> getDataToExport(OperationExportContext operationExportContext) { + public List<AccidentalCatchRow> getDataToExport(GenericFormatExportOperationContext operationExportContext) { List<AccidentalCatchRow> rows = new ArrayList<>(); @@ -47,7 +47,7 @@ public class CsvProducerForAccidentalCatch extends CsvProducer<AccidentalCatchRo } - protected void addAccidentalBatch(OperationExportContext operationExportContext, List<AccidentalCatchRow> rows, AccidentalBatch accidentalBatch) { + protected void addAccidentalBatch(GenericFormatExportOperationContext operationExportContext, List<AccidentalCatchRow> rows, AccidentalBatch accidentalBatch) { addCaracteristicRow(operationExportContext, rows, @@ -94,7 +94,7 @@ public class CsvProducerForAccidentalCatch extends CsvProducer<AccidentalCatchRo } - protected void addCaracteristicRow(OperationExportContext operationExportContext, + protected void addCaracteristicRow(GenericFormatExportOperationContext operationExportContext, List<AccidentalCatchRow> rows, AccidentalBatch accidentalBatch, Caracteristic caracteristic, diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java index 3252374..c740135 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForCatch.java @@ -9,7 +9,7 @@ import fr.ifremer.tutti.persistence.entities.data.SpeciesBatch; import fr.ifremer.tutti.persistence.entities.data.SpeciesBatchFrequency; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.service.csv.CsvProducer; -import fr.ifremer.tutti.service.genericformat.OperationExportContext; +import fr.ifremer.tutti.service.genericformat.GenericFormatExportOperationContext; import fr.ifremer.tutti.service.genericformat.csv.CatchModel; import fr.ifremer.tutti.service.genericformat.csv.CatchRow; import fr.ifremer.tutti.service.genericformat.csv.ExportSampleCategory; @@ -35,7 +35,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { super(file, model); } - public List<CatchRow> getDataToExport(OperationExportContext operationExportContext, + public List<CatchRow> getDataToExport(GenericFormatExportOperationContext operationExportContext, Float speciesCatchRaisingFactor, Float benthosCatchRaisingFactor) { @@ -65,7 +65,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } - protected void addBenthosBatches(OperationExportContext operationExportContext, + protected void addBenthosBatches(GenericFormatExportOperationContext operationExportContext, BatchContainer<BenthosBatch> rootBenthosBatch, Float benthosCatchRaisingFactor, String batchWeightUnit, @@ -105,7 +105,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } - protected void addSpeciesBatches(OperationExportContext operationExportContext, + protected void addSpeciesBatches(GenericFormatExportOperationContext operationExportContext, BatchContainer<SpeciesBatch> rootSpeciesBatch, Float speciesCatchRaisingFactor, String batchWeightUnit, @@ -144,7 +144,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } } - protected void addSpeciesBatch(OperationExportContext operationExportContext, + protected void addSpeciesBatch(GenericFormatExportOperationContext operationExportContext, CatchRow currentRow, List<CatchRow> rows, SpeciesBatch speciesBatch, @@ -266,7 +266,7 @@ public class CsvProducerForCatch extends CsvProducer<CatchRow, CatchModel> { } } - protected void addBenthosBatch(OperationExportContext operationExportContext, + protected void addBenthosBatch(GenericFormatExportOperationContext operationExportContext, CatchRow currentRow, List<CatchRow> rows, BenthosBatch benthosBatch, diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForIndividualObservation.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForIndividualObservation.java index eb7faac..0965c68 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForIndividualObservation.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForIndividualObservation.java @@ -4,7 +4,7 @@ import fr.ifremer.tutti.persistence.entities.CaracteristicMap; import fr.ifremer.tutti.persistence.entities.data.IndividualObservationBatch; import fr.ifremer.tutti.persistence.entities.referential.Caracteristic; import fr.ifremer.tutti.service.csv.CsvProducer; -import fr.ifremer.tutti.service.genericformat.OperationExportContext; +import fr.ifremer.tutti.service.genericformat.GenericFormatExportOperationContext; import fr.ifremer.tutti.service.genericformat.csv.IndividualObservationModel; import fr.ifremer.tutti.service.genericformat.csv.IndividualObservationRow; import org.apache.commons.collections4.CollectionUtils; @@ -28,7 +28,7 @@ public class CsvProducerForIndividualObservation extends CsvProducer<IndividualO super(file, model); } - public List<IndividualObservationRow> getDataToExport(OperationExportContext operationExportContext) { + public List<IndividualObservationRow> getDataToExport(GenericFormatExportOperationContext operationExportContext) { List<IndividualObservationRow> rows = new ArrayList<>(); List<IndividualObservationBatch> individualObservations = operationExportContext.getIndividualObservations(); @@ -44,7 +44,7 @@ public class CsvProducerForIndividualObservation extends CsvProducer<IndividualO } - protected void addIndividualObservationBatch(OperationExportContext operationExportContext, + protected void addIndividualObservationBatch(GenericFormatExportOperationContext operationExportContext, List<IndividualObservationRow> rows, IndividualObservationBatch child) { @@ -80,7 +80,7 @@ public class CsvProducerForIndividualObservation extends CsvProducer<IndividualO } } - protected void addCaracteristicRow(OperationExportContext operationExportContext, + protected void addCaracteristicRow(GenericFormatExportOperationContext operationExportContext, List<IndividualObservationRow> rows, IndividualObservationBatch child, Caracteristic caracteristic, diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForMarineLitter.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForMarineLitter.java index 98f9936..9f0b34f 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForMarineLitter.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/genericformat/producer/CsvProducerForMarineLitter.java @@ -3,7 +3,7 @@ package fr.ifremer.tutti.service.genericformat.producer; import fr.ifremer.tutti.persistence.entities.data.BatchContainer; import fr.ifremer.tutti.persistence.entities.data.MarineLitterBatch; import fr.ifremer.tutti.service.csv.CsvProducer; -import fr.ifremer.tutti.service.genericformat.OperationExportContext; +import fr.ifremer.tutti.service.genericformat.GenericFormatExportOperationContext; import fr.ifremer.tutti.service.genericformat.csv.MarineLitterModel; import fr.ifremer.tutti.service.genericformat.csv.MarineLitterRow; import org.apache.commons.collections4.CollectionUtils; @@ -25,7 +25,7 @@ public class CsvProducerForMarineLitter extends CsvProducer<MarineLitterRow, Mar } - public List<MarineLitterRow> getDataToExport(OperationExportContext operationExportContext) { + public List<MarineLitterRow> getDataToExport(GenericFormatExportOperationContext operationExportContext) { List<MarineLitterRow> rows = new ArrayList<>(); diff --git a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java index d2d6381..82875b7 100644 --- a/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java +++ b/tutti-service/src/test/java/fr/ifremer/tutti/service/genericformat/GenericFormatExportServiceTest.java @@ -358,7 +358,7 @@ public class GenericFormatExportServiceTest { @Test public void exportSurvey() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportSurvey(exportContext, dataContext.cruise); } ServiceDbResource.assertFileContent("Survey export:\n", @@ -369,7 +369,7 @@ public class GenericFormatExportServiceTest { @Test public void exportGearCaracteristics() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportGearCaracteristics(exportContext, dataContext.cruise); } ServiceDbResource.assertFileContent("Gear caracteristics export:\n", @@ -380,7 +380,7 @@ public class GenericFormatExportServiceTest { @Test public void exportOperations() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportOperations(exportContext, dataContext.cruise, dataContext.operations); } ServiceDbResource.assertFileContent("Operation export:\n", @@ -396,7 +396,7 @@ public class GenericFormatExportServiceTest { FishingOperation operation = TuttiEntities.findById(dataContext.operations, "100105"); dataContext.operations = Lists.newArrayList(operation); - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportOperations(exportContext, dataContext.cruise, dataContext.operations); } @@ -414,7 +414,7 @@ public class GenericFormatExportServiceTest { operation.setGear(null); dataContext.operations = Lists.newArrayList(operation); - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportOperations(exportContext, dataContext.cruise, dataContext.operations); } @@ -426,7 +426,7 @@ public class GenericFormatExportServiceTest { @Test public void exportParameters() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportParameters(exportContext, dataContext.cruise, dataContext.operations); } @@ -438,7 +438,7 @@ public class GenericFormatExportServiceTest { @Test public void exportCatches() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportCatches(exportContext, dataContext.cruise, dataContext.operations); } ServiceDbResource.assertFileContent("Catch export:\n", @@ -461,7 +461,7 @@ public class GenericFormatExportServiceTest { FishingOperation operation = TuttiEntities.findById(dataContext.operations, "100000"); dataContext.operations = Lists.newArrayList(operation); - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportCatches(exportContext, dataContext.cruise, dataContext.operations); service.exportSpecies(exportContext); } @@ -483,7 +483,7 @@ public class GenericFormatExportServiceTest { dataContext = dbResource.loadContext(PROGRAM_ID, CRUISE_CGFS_ID, NB_EXPECTED_CGFS_OPERATIONS); - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportCatches(exportContext, dataContext.cruise, dataContext.operations); } } @@ -491,7 +491,7 @@ public class GenericFormatExportServiceTest { @Test public void exportMarineLitters() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportMarineLitters(exportContext, dataContext.cruise, dataContext.operations); } ServiceDbResource.assertFileContent("MarineLitter export:\n", @@ -502,7 +502,7 @@ public class GenericFormatExportServiceTest { @Test public void exportIndividualObservations() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportIndividualObservations(exportContext, dataContext.cruise, dataContext.operations); } ServiceDbResource.assertFileContent("individualObservation export:\n", @@ -513,7 +513,7 @@ public class GenericFormatExportServiceTest { @Test public void exportAccidentalCatch() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { service.exportAccidentalCatch(exportContext, dataContext.cruise, dataContext.operations); } ServiceDbResource.assertFileContent("accidentalCatch export:\n", @@ -524,7 +524,7 @@ public class GenericFormatExportServiceTest { @Test public void exportSpecies() throws Exception { - try (GlobalExportContext exportContext = service.createExportContext(archive)) { + try (GenericFormatExportContext exportContext = service.createExportContext(archive)) { List<Species> allReferentSpecies = persistenceService.getAllReferentSpecies(); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.