Tony CHEMIT pushed to branch develop-9.0.x at ultreiaio / ird-observe
Commits:
-
3b96ba25
by Tony Chemit at 2023-03-30T17:43:12+02:00
-
537471eb
by Tony Chemit at 2023-04-01T10:40:44+02:00
5 changed files:
- core/persistence/migration/src/main/resources/db/migration/v9/9.0/100-tck_add_referential_for_delete_test-common.sql
- core/persistence/test/src/test/resources/fixtures/persistence/table_count/referential.properties
- core/services/test/src/main/java/fr/ird/observe/services/service/DataSourceServiceFixtures.java
- model/src/main/resources/fixtures/global.properties
- model/src/main/resources/fixtures/variables.properties
Changes:
| ... | ... | @@ -40,3 +40,5 @@ INSERT INTO ps_common.schoolType(topiaId, topiaCreateDate, topiaVersion, lastUpd |
| 40 | 40 | INSERT INTO ps_localmarket.batchComposition(topiaId, topiaCreateDate, topiaVersion, lastUpdateDate, code, uri, homeId, needComment, status, label1, label2, label3, label4, label5, label6, label7, label8) VALUES ('fr.ird.referential.ps.localmarket.BatchComposition#0#0', '2021-09-17 00:00:00.0', 0, '2021-09-17 00:00:00.0', '22', NULL, NULL, false, 1, 'Mono specific (no survey) 2', 'Mono spécifique (pas de sondage) 2', 'Mono specific (no survey) #TODO 2', NULL, NULL, NULL, NULL, NULL);
|
| 41 | 41 | -- BatchWeightType
|
| 42 | 42 | INSERT INTO ps_localmarket.batchWeightType(topiaId, topiaCreateDate, topiaVersion, lastUpdateDate, code, uri, homeId, needComment, status, label1, label2, label3, label4, label5, label6, label7, label8) VALUES ('fr.ird.referential.ps.localmarket.BatchWeightType#0#0', '2021-09-17 00:00:00.0', 0, '2021-09-17 00:00:00.0', '12', NULL, NULL, false, 1, 'Weighing 2', 'Pesée 2', 'Weighing #TODO 2', NULL, NULL, NULL, NULL, NULL);
|
| 43 | +-- Country
|
|
| 44 | +INSERT INTO observe_common.country(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, needcomment, status, label1, label2, label3, label4, label5, label6, label7, label8, iso2code, iso3code) VALUES ('fr.ird.referential.common.Country#0#0', 5, '2011-06-15 00:00:00.043', '2016-11-26 08:35:40.72', '666', NULL, false, 1, 'Tck data', 'Tck data Fr', 'Tck data Es', NULL, NULL, NULL, NULL, NULL, '__', '___'); |
|
| \ No newline at end of file |
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | # <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | # #L%
|
| 21 | 21 | ###
|
| 22 | -common.country=90
|
|
| 22 | +common.country=91
|
|
| 23 | 23 | common.dataQuality=5
|
| 24 | 24 | common.fpaZone=45
|
| 25 | 25 | common.gear=28
|
| ... | ... | @@ -145,32 +145,52 @@ public class DataSourceServiceFixtures extends GeneratedDataSourceServiceFixture |
| 145 | 145 | }
|
| 146 | 146 | |
| 147 | 147 | protected void produceMoveSqlScript(DataSourceService service, boolean pg) {
|
| 148 | - String psObsRouteId = getVariable(getVariableName(fr.ird.observe.dto.data.ps.observation.RouteDto.class));
|
|
| 149 | - String psObsActivityId = getVariable(getVariableName(fr.ird.observe.dto.data.ps.observation.ActivityDto.class));
|
|
| 148 | + String psObsRouteVariable = getVariableName(fr.ird.observe.dto.data.ps.observation.RouteDto.class);
|
|
| 149 | + String psObsRouteId = getVariable(psObsRouteVariable);
|
|
| 150 | + String psObsRouteIdTarget = getVariable(psObsRouteVariable+".move");
|
|
| 151 | + String psObsActivityVariable = getVariableName(fr.ird.observe.dto.data.ps.observation.ActivityDto.class);
|
|
| 152 | + String psObsActivityId = getVariable(psObsActivityVariable);
|
|
| 153 | + String psObsActivityIdTarget = getVariable(psObsActivityVariable+".move");
|
|
| 150 | 154 | String psObsSetId = getVariable(getVariableName(fr.ird.observe.dto.data.ps.observation.SetDto.class));
|
| 151 | - String psLogbookRouteId = getVariable(getVariableName(fr.ird.observe.dto.data.ps.logbook.RouteDto.class));
|
|
| 155 | + |
|
| 156 | + String psLogbookRouteVariable = getVariableName(fr.ird.observe.dto.data.ps.logbook.RouteDto.class);
|
|
| 157 | + String psLogbookRouteId = getVariable(psLogbookRouteVariable);
|
|
| 158 | + String psLogbookRouteIdTarget = getVariable(psLogbookRouteVariable+".move");
|
|
| 152 | 159 | String psLogbookActivityId = getVariable(getVariableName(fr.ird.observe.dto.data.ps.logbook.ActivityDto.class));
|
| 153 | 160 | |
| 154 | - String llObsActivityId = getVariable(getVariableName(fr.ird.observe.dto.data.ll.observation.ActivityDto.class));
|
|
| 161 | + String llObsActivityVariable = getVariableName(fr.ird.observe.dto.data.ll.observation.ActivityDto.class);
|
|
| 162 | + String llObsActivityId = getVariable(llObsActivityVariable);
|
|
| 163 | + String llObsActivityIdTarget = getVariable(llObsActivityVariable+".move");
|
|
| 164 | + |
|
| 155 | 165 | String llObSetId = getVariable(getVariableName(fr.ird.observe.dto.data.ll.observation.SetDto.class));
|
| 156 | 166 | |
| 157 | - String llLogbookActivityId = getVariable(getVariableName(fr.ird.observe.dto.data.ll.logbook.ActivityDto.class));
|
|
| 167 | + String llLogbookActivityVariable = getVariableName(fr.ird.observe.dto.data.ll.logbook.ActivityDto.class);
|
|
| 168 | + String llLogbookActivityId = getVariable(llLogbookActivityVariable);
|
|
| 169 | + String llLogbookActivityIdTarget = getVariable(llLogbookActivityVariable+".move");
|
|
| 170 | + |
|
| 158 | 171 | String llLogbookSetId = getVariable(getVariableName(fr.ird.observe.dto.data.ll.logbook.SetDto.class));
|
| 159 | - String psCommonTripId = getPsCommonTripId();
|
|
| 160 | - String llCommonTripId = getLlCommonTripId();
|
|
| 172 | + String psCommTripVariable = getVariableName(fr.ird.observe.dto.data.ps.common.TripDto.class);
|
|
| 173 | + |
|
| 174 | + String psCommonTripId = getVariable(psCommTripVariable);
|
|
| 175 | + String psCommonTripIdTarget = getVariable(psCommTripVariable +".move");
|
|
| 176 | + |
|
| 177 | + String llCommTripVariable = getVariableName(fr.ird.observe.dto.data.ll.common.TripDto.class);
|
|
| 178 | + String llCommonTripId = getVariable(llCommTripVariable);
|
|
| 179 | + String llCommonTripIdTarget = getVariable(llCommTripVariable +".move");
|
|
| 180 | + |
|
| 181 | + testRequest(service, new ReplicateRequest(pg, psCommonTripId, psCommonTripIdTarget, "fr.ird.observe.entities.data.ps.observation.Route", psObsRouteId));
|
|
| 161 | 182 | |
| 162 | - testRequest(service, new ReplicateRequest(pg, psCommonTripId, psCommonTripId + "00", "fr.ird.observe.entities.data.ps.observation.Route", psObsRouteId));
|
|
| 163 | - testRequest(service, new ReplicateRequest(pg, psObsRouteId, psObsRouteId + "00", "fr.ird.observe.entities.data.ps.observation.Activity", psObsActivityId));
|
|
| 164 | - testRequest(service, new ReplicateRequest(pg, psObsActivityId, psObsActivityId + "00", "fr.ird.observe.entities.data.ps.observation.Set", psObsSetId));
|
|
| 183 | + testRequest(service, new ReplicateRequest(pg, psObsRouteId, psObsRouteIdTarget, "fr.ird.observe.entities.data.ps.observation.Activity", psObsActivityId));
|
|
| 184 | + testRequest(service, new ReplicateRequest(pg, psObsActivityId, psObsActivityIdTarget, "fr.ird.observe.entities.data.ps.observation.Set", psObsSetId));
|
|
| 165 | 185 | |
| 166 | - testRequest(service, new ReplicateRequest(pg, psCommonTripId, psCommonTripId + "00", "fr.ird.observe.entities.data.ps.logbook.Route", psLogbookRouteId));
|
|
| 167 | - testRequest(service, new ReplicateRequest(pg, psLogbookRouteId, psLogbookRouteId + "00", "fr.ird.observe.entities.data.ps.logbook.Activity", psLogbookActivityId));
|
|
| 186 | + testRequest(service, new ReplicateRequest(pg, psCommonTripId, psCommonTripIdTarget, "fr.ird.observe.entities.data.ps.logbook.Route", psLogbookRouteId));
|
|
| 187 | + testRequest(service, new ReplicateRequest(pg, psLogbookRouteId, psLogbookRouteIdTarget, "fr.ird.observe.entities.data.ps.logbook.Activity", psLogbookActivityId));
|
|
| 168 | 188 | |
| 169 | - testRequest(service, new ReplicateRequest(pg, llCommonTripId, llCommonTripId + "00", "fr.ird.observe.entities.data.ll.observation.Activity", llObsActivityId));
|
|
| 170 | - testRequest(service, new ReplicateRequest(pg, llObsActivityId, llObsActivityId + "00", "fr.ird.observe.entities.data.ll.observation.Set", llObSetId));
|
|
| 189 | + testRequest(service, new ReplicateRequest(pg, llCommonTripId, llCommonTripIdTarget, "fr.ird.observe.entities.data.ll.observation.Activity", llObsActivityId));
|
|
| 190 | + testRequest(service, new ReplicateRequest(pg, llObsActivityId, llObsActivityIdTarget, "fr.ird.observe.entities.data.ll.observation.Set", llObSetId));
|
|
| 171 | 191 | |
| 172 | - testRequest(service, new ReplicateRequest(pg, llCommonTripId, llCommonTripId + "00", "fr.ird.observe.entities.data.ll.logbook.Activity", llLogbookActivityId));
|
|
| 173 | - testRequest(service, new ReplicateRequest(pg, llLogbookActivityId, llLogbookActivityId + "00", "fr.ird.observe.entities.data.ll.logbook.Set", llLogbookSetId));
|
|
| 192 | + testRequest(service, new ReplicateRequest(pg, llCommonTripId, llCommonTripIdTarget, "fr.ird.observe.entities.data.ll.logbook.Activity", llLogbookActivityId));
|
|
| 193 | + testRequest(service, new ReplicateRequest(pg, llLogbookActivityId, llLogbookActivityIdTarget, "fr.ird.observe.entities.data.ll.logbook.Set", llLogbookSetId));
|
|
| 174 | 194 | }
|
| 175 | 195 | |
| 176 | 196 | //FIXME Add tests for replicatePartial, delete and deletePartial
|
| ... | ... | @@ -25,4 +25,4 @@ REFERENCE_DATA_COUNT=66 |
| 25 | 25 | ENTITIES_LIMIT_SIZE=100
|
| 26 | 26 | # fr.ird.observe.services.service.referential.ReferentialService
|
| 27 | 27 | # fr.ird.observe.services.local.service.referential.DifferentialModelTest
|
| 28 | -REFERENTIAL_COUNT=4094 |
|
| 28 | +REFERENTIAL_COUNT=4095 |
| ... | ... | @@ -22,9 +22,11 @@ |
| 22 | 22 | data.ll.common.GearUseFeatures.id=fr.ird.data.ll.common.GearUseFeatures#1612699679823#0.5458656018490842
|
| 23 | 23 | data.ll.common.GearUseFeaturesMeasurement.id=fr.ird.data.ll.common.GearUseFeaturesMeasurement#1612699679825#0.11912898889431767
|
| 24 | 24 | data.ll.common.Trip.id=fr.ird.data.ll.common.Trip#1573218053521#0.35390398604784334
|
| 25 | +data.ll.common.Trip.id.move=fr.ird.data.ll.common.Trip#1547805002869#0.37785124313873586
|
|
| 25 | 26 | data.ll.landing.Landing.id=fr.ird.data.ll.landing.Landing#1464000000000#0.00017977
|
| 26 | 27 | data.ll.landing.LandingPart.id=fr.ird.data.ll.landing.LandingPart#1609975393941#0.412674413528293
|
| 27 | 28 | data.ll.logbook.Activity.id=fr.ird.data.ll.logbook.Activity#1464000000000#0.01093484
|
| 29 | +data.ll.logbook.Activity.id.move=fr.ird.data.ll.logbook.Activity#1464000000000#0.02093485
|
|
| 28 | 30 | data.ll.logbook.ActivitySample.id=fr.ird.data.ll.logbook.Sample#1464000000000#0.00036654
|
| 29 | 31 | data.ll.logbook.BaitsComposition.id=fr.ird.data.ll.logbook.BaitsComposition#1619857303896#0.6134138605054349
|
| 30 | 32 | data.ll.logbook.BranchlinesComposition.id=fr.ird.data.ll.logbook.BranchlinesComposition#1619857303908#0.463973082762536
|
| ... | ... | @@ -35,6 +37,7 @@ data.ll.logbook.Sample.id=fr.ird.data.ll.logbook.Sample#1464000000000#0.00036655 |
| 35 | 37 | data.ll.logbook.SamplePart.id=fr.ird.data.ll.logbook.SamplePart#1610199320689#0.0111575757618994
|
| 36 | 38 | data.ll.logbook.Set.id=fr.ird.data.ll.logbook.Set#1464000000000#0.01093484
|
| 37 | 39 | data.ll.observation.Activity.id=fr.ird.data.ll.observation.Activity#1538025383462#0.7048860714573149
|
| 40 | +data.ll.observation.Activity.id.move=fr.ird.data.ll.observation.Activity#1538113373974#0.18854771823362426
|
|
| 38 | 41 | data.ll.observation.BaitsComposition.id=fr.ird.data.ll.observation.BaitsComposition#1538025750031#0.9637636762242816
|
| 39 | 42 | data.ll.observation.Basket.id=fr.ird.data.ll.observation.Basket#1613391727265#0.2552774405657089
|
| 40 | 43 | data.ll.observation.Branchline.id=fr.ird.data.ll.observation.Branchline#1613391727344#0.8268423721739928
|
| ... | ... | @@ -52,6 +55,7 @@ data.ll.observation.WeightMeasure.id=fr.ird.data.ll.observation.WeightMeasure#16 |
| 52 | 55 | data.ps.common.GearUseFeatures.id=fr.ird.data.ps.common.GearUseFeatures#1612698996131#0.6058958440089384
|
| 53 | 56 | data.ps.common.GearUseFeaturesMeasurement.id=fr.ird.data.ps.common.GearUseFeaturesMeasurement#1612698996149#0.4415127885939093
|
| 54 | 57 | data.ps.common.Trip.id=fr.ird.data.ps.common.Trip#1553970328158#0.44863535394269627
|
| 58 | +data.ps.common.Trip.id.move=fr.ird.data.ps.common.Trip#1573473170279#0.39901519164877486
|
|
| 55 | 59 | data.ps.landing.Landing.id=fr.ird.data.ps.landing.Landing#1616955391466#0.9083548924412933
|
| 56 | 60 | data.ps.localmarket.Batch.id=fr.ird.data.ps.localmarket.Batch#1617103690104#0.11538487864349034
|
| 57 | 61 | data.ps.localmarket.Sample.id=fr.ird.data.ps.localmarket.Sample#1616832487726#0.257522479716059
|
| ... | ... | @@ -64,6 +68,7 @@ data.ps.logbook.Catch.id=fr.ird.data.ps.logbook.Catch#1616768024297#0.2863597930 |
| 64 | 68 | data.ps.logbook.FloatingObject.id=fr.ird.data.ps.logbook.FloatingObject#1616955224271#0.8748844202241
|
| 65 | 69 | data.ps.logbook.FloatingObjectPart.id=fr.ird.data.ps.logbook.FloatingObjectPart#1616955312002#0.004817068771328259
|
| 66 | 70 | data.ps.logbook.Route.id=fr.ird.data.ps.logbook.Route#1616767950667#0.2733836567509864
|
| 71 | +data.ps.logbook.Route.id.move=fr.ird.data.ps.logbook.Route#1616767950667#0.2733836567509865
|
|
| 67 | 72 | data.ps.logbook.Sample.id=fr.ird.data.ps.logbook.Sample#1616768092884#0.8805004437915559
|
| 68 | 73 | data.ps.logbook.SampleActivity.id=fr.ird.data.ps.logbook.SampleActivity#1612861310013#0.9926675881926301
|
| 69 | 74 | data.ps.logbook.SampleSpecies.id=fr.ird.data.ps.logbook.SampleSpecies#1617096981782#0.17042072657028862
|
| ... | ... | @@ -71,6 +76,7 @@ data.ps.logbook.SampleSpeciesMeasure.id=fr.ird.data.ps.logbook.SampleSpeciesMeas |
| 71 | 76 | data.ps.logbook.TransmittingBuoy.id=fr.ird.data.ps.logbook.TransmittingBuoy#1616955224272#0.1758599871793043
|
| 72 | 77 | data.ps.logbook.WellPlan.id=fr.ird.data.ps.logbook.WellPlan#1616768075749#0.1331568688022804
|
| 73 | 78 | data.ps.observation.Activity.id=fr.ird.data.ps.observation.Activity#1554113237260#0.6013473195166136
|
| 79 | +data.ps.observation.Activity.id.move=fr.ird.data.ps.observation.Activity#1554113237260#0.6013473195166137
|
|
| 74 | 80 | data.ps.observation.Catch.id=fr.ird.data.ps.observation.Catch#1554119972110#0.2402835209929618
|
| 75 | 81 | data.ps.observation.FloatingObject.id=fr.ird.data.ps.observation.FloatingObject#1612860069119#0.061511249860604966
|
| 76 | 82 | data.ps.observation.FloatingObjectPart.id=fr.ird.data.ps.observation.FloatingObjectPart#1612860082601#0.30983583751473864
|
| ... | ... | @@ -78,13 +84,14 @@ data.ps.observation.NonTargetCatchRelease.id=fr.ird.data.ps.observation.NonTarge |
| 78 | 84 | data.ps.observation.ObjectObservedSpecies.id=fr.ird.data.ps.observation.ObjectObservedSpecies#1612860141918#0.8897715192745859
|
| 79 | 85 | data.ps.observation.ObjectSchoolEstimate.id=fr.ird.data.ps.observation.ObjectSchoolEstimate#1612860112430#0.9202212602076519
|
| 80 | 86 | data.ps.observation.Route.id=fr.ird.data.ps.observation.Route#1554106229992#0.7639861071473422
|
| 87 | +data.ps.observation.Route.id.move=fr.ird.data.ps.observation.Route#1554712844284#0.10553716343500474
|
|
| 81 | 88 | data.ps.observation.Sample.id=fr.ird.data.ps.observation.Sample#1612861249115#0.09925784341428623
|
| 82 | 89 | data.ps.observation.SampleMeasure.id=fr.ird.data.ps.observation.SampleMeasure#1612861249139#0.99644487513718
|
| 83 | 90 | data.ps.observation.SchoolEstimate.id=fr.ird.data.ps.observation.SchoolEstimate#1612860210852#0.6866668025183136
|
| 84 | 91 | data.ps.observation.Set.id=fr.ird.data.ps.observation.Set#1554119935526#0.45507383777180943
|
| 85 | 92 | data.ps.observation.TransmittingBuoy.id=fr.ird.data.ps.observation.TransmittingBuoy#1612860069136#0.39922787297738194
|
| 86 | -referential.common.common.Country.id.delete=fr.ird.referential.common.Country#1464000000000#0.00048
|
|
| 87 | 93 | referential.common.common.Country.id=fr.ird.referential.common.Country#1239832675593#0.24921769452411147
|
| 94 | +referential.common.common.Country.id.delete=fr.ird.referential.common.Country#0#0
|
|
| 88 | 95 | referential.common.common.DataQuality.id=fr.ird.referential.common.DataQuality#0#1
|
| 89 | 96 | referential.common.common.FpaZone.id=fr.ird.referential.common.FpaZone#1239832686122#0.1
|
| 90 | 97 | referential.common.common.GearCharacteristic.id.delete=fr.ird.referential.common.GearCharacteristic#1239832686124#0.12
|