Skip to content

Commit

Permalink
Activate mismatched transport mode validator (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpaturet authored Dec 16, 2024
1 parent df90fec commit 0654e9e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 138 deletions.
123 changes: 17 additions & 106 deletions src/main/java/no/entur/antu/config/TimetableDataValidatorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import no.entur.antu.validation.validator.servicejourney.servicealteration.InvalidServiceAlterationValidator;
import no.entur.antu.validation.validator.servicejourney.servicealteration.MissingReplacementValidator;
import no.entur.antu.validation.validator.servicejourney.speed.UnexpectedSpeedValidator;
import no.entur.antu.validation.validator.servicejourney.transportmode.MismatchedTransportModeSubModeValidator;
import no.entur.antu.validation.validator.servicelink.distance.UnexpectedDistanceInServiceLinkValidator;
import no.entur.antu.validation.validator.servicelink.stoppoints.MismatchedStopPointsValidator;
import no.entur.antu.validation.validator.xpath.EnturTimetableDataValidationTreeFactory;
Expand Down Expand Up @@ -79,81 +80,6 @@ public XPathRuleValidator timetableDataXPathValidator(
return new XPathRuleValidator(validationTreeFactory);
}

@Bean
public UnexpectedDistanceBetweenStopPointsValidator unexpectedDistanceBetweenStopPointsValidator() {
return new UnexpectedDistanceBetweenStopPointsValidator();
}

@Bean
public IdenticalStopPointsValidator identicalStopPointsValidator() {
return new IdenticalStopPointsValidator();
}

@Bean
public SameQuayRefValidator sameQuayRefValidator() {
return new SameQuayRefValidator();
}

@Bean
public SameStopPointsValidator sameStopPointsValidator() {
return new SameStopPointsValidator();
}

@Bean
public StopPointsCountValidator stopPointsCountValidator() {
return new StopPointsCountValidator();
}

@Bean
public MissingPassengerStopAssignmentValidator missingPassengerStopAssignmentValidator() {
return new MissingPassengerStopAssignmentValidator();
}

@Bean
public NonIncreasingPassingTimeValidator nonIncreasingPassingTimeValidator() {
return new NonIncreasingPassingTimeValidator();
}

@Bean
public UnexpectedSpeedValidator unexpectedSpeedValidator() {
return new UnexpectedSpeedValidator();
}

@Bean
public UnexpectedDistanceInServiceLinkValidator unexpectedDistanceInServiceLinkValidator() {
return new UnexpectedDistanceInServiceLinkValidator();
}

@Bean
public MismatchedStopPointsValidator mismatchedStopPointsValidator() {
return new MismatchedStopPointsValidator();
}

@Bean
public MandatoryFieldsValidator mandatoryFieldsValidator() {
return new MandatoryFieldsValidator();
}

@Bean
public DuplicateInterchangesValidator duplicateInterchangesValidator() {
return new DuplicateInterchangesValidator();
}

@Bean
public InvalidServiceAlterationValidator missingServiceAlterationValidator() {
return new InvalidServiceAlterationValidator();
}

@Bean
public MissingReplacementValidator missingReplacementValidator() {
return new MissingReplacementValidator();
}

@Bean
public UnexpectedInterchangeDistanceValidator unexpectedInterchangeDistanceValidator() {
return new UnexpectedInterchangeDistanceValidator();
}

@Bean
public StopPointsInVehicleJourneyValidator stopPointsInVehicleJourneyValidator(
@Qualifier(
Expand Down Expand Up @@ -197,23 +123,8 @@ public NetexValidatorsRunner timetableDataValidatorsRunner(
@Qualifier(
"netexIdUniquenessValidator"
) NetexIdUniquenessValidator netexIdUniquenessValidator,
UnexpectedDistanceBetweenStopPointsValidator unexpectedDistanceBetweenStopPointsValidator,
IdenticalStopPointsValidator identicalStopPointsValidator,
SameQuayRefValidator sameQuayRefValidator,
SameStopPointsValidator sameStopPointsValidator,
StopPointsCountValidator stopPointsCountValidator,
MissingPassengerStopAssignmentValidator missingPassengerStopAssignmentValidator,
NonIncreasingPassingTimeValidator nonIncreasingPassingTimeValidator,
UnexpectedSpeedValidator unexpectedSpeedValidator,
UnexpectedDistanceInServiceLinkValidator unexpectedDistanceInServiceLinkValidator,
MismatchedStopPointsValidator mismatchedStopPointsValidator,
MandatoryFieldsValidator mandatoryFieldsValidator,
DuplicateInterchangesValidator duplicateInterchangesValidator,
InvalidServiceAlterationValidator invalidServiceAlterationValidator,
UnexpectedInterchangeDistanceValidator unexpectedInterchangeDistanceValidator,
StopPointsInVehicleJourneyValidator stopPointsInVehicleJourneyValidator,
DuplicateLineNameValidator duplicateLineNameValidator,
MissingReplacementValidator missingReplacementValidator,
LineInfoCollector lineInfoCollector,
ServiceJourneyStopsCollector serviceJourneyStopsCollector,
ServiceJourneyInterchangeInfoCollector serviceJourneyInterchangeInfoCollector,
Expand All @@ -234,22 +145,22 @@ public NetexValidatorsRunner timetableDataValidatorsRunner(
);

List<JAXBValidator> jaxbValidators = List.of(
unexpectedDistanceBetweenStopPointsValidator,
identicalStopPointsValidator,
sameQuayRefValidator,
sameStopPointsValidator,
stopPointsCountValidator,
missingPassengerStopAssignmentValidator,
nonIncreasingPassingTimeValidator,
unexpectedSpeedValidator,
unexpectedDistanceInServiceLinkValidator,
mismatchedStopPointsValidator,
mandatoryFieldsValidator,
duplicateInterchangesValidator,
invalidServiceAlterationValidator,
missingReplacementValidator,
duplicateInterchangesValidator,
unexpectedInterchangeDistanceValidator
new MismatchedTransportModeSubModeValidator(),
new UnexpectedDistanceBetweenStopPointsValidator(),
new IdenticalStopPointsValidator(),
new SameQuayRefValidator(),
new SameStopPointsValidator(),
new StopPointsCountValidator(),
new MissingPassengerStopAssignmentValidator(),
new NonIncreasingPassingTimeValidator(),
new UnexpectedSpeedValidator(),
new UnexpectedDistanceInServiceLinkValidator(),
new MismatchedStopPointsValidator(),
new MandatoryFieldsValidator(),
new DuplicateInterchangesValidator(),
new InvalidServiceAlterationValidator(),
new MissingReplacementValidator(),
new UnexpectedInterchangeDistanceValidator()
);

List<DatasetValidator> netexTimetableDatasetValidators = List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import no.entur.antu.validation.validator.servicejourney.servicealteration.InvalidServiceAlterationValidator;
import no.entur.antu.validation.validator.servicejourney.servicealteration.MissingReplacementValidator;
import no.entur.antu.validation.validator.servicejourney.speed.UnexpectedSpeedValidator;
import no.entur.antu.validation.validator.servicejourney.transportmode.MismatchedTransportModeSubModeValidator;
import no.entur.antu.validation.validator.servicelink.distance.UnexpectedDistanceInServiceLinkValidator;
import no.entur.antu.validation.validator.servicelink.stoppoints.MismatchedStopPointsValidator;
import org.entur.netex.validation.validator.DatasetValidator;
Expand Down Expand Up @@ -100,23 +101,8 @@ public NetexValidatorsRunner finlandTimetableDataValidatorsRunner(
@Qualifier(
"netexIdUniquenessValidator"
) NetexIdUniquenessValidator netexIdUniquenessValidator,
UnexpectedDistanceBetweenStopPointsValidator unexpectedDistanceBetweenStopPointsValidator,
IdenticalStopPointsValidator identicalStopPointsValidator,
SameQuayRefValidator sameQuayRefValidator,
SameStopPointsValidator sameStopPointsValidator,
StopPointsCountValidator stopPointsCountValidator,
MissingPassengerStopAssignmentValidator missingPassengerStopAssignmentValidator,
NonIncreasingPassingTimeValidator nonIncreasingPassingTimeValidator,
UnexpectedSpeedValidator unexpectedSpeedValidator,
UnexpectedDistanceInServiceLinkValidator unexpectedDistanceInServiceLinkValidator,
MismatchedStopPointsValidator mismatchedStopPointsValidator,
MandatoryFieldsValidator mandatoryFieldsValidator,
DuplicateInterchangesValidator duplicateInterchangesValidator,
InvalidServiceAlterationValidator invalidServiceAlterationValidator,
UnexpectedInterchangeDistanceValidator unexpectedInterchangeDistanceValidator,
StopPointsInVehicleJourneyValidator stopPointsInVehicleJourneyValidator,
DuplicateLineNameValidator duplicateLineNameValidator,
MissingReplacementValidator missingReplacementValidator,
LineInfoCollector lineInfoCollector,
ServiceJourneyStopsCollector serviceJourneyStopsCollector,
ServiceJourneyInterchangeInfoCollector serviceJourneyInterchangeInfoCollector,
Expand All @@ -137,22 +123,22 @@ public NetexValidatorsRunner finlandTimetableDataValidatorsRunner(
);

List<JAXBValidator> jaxbValidators = List.of(
unexpectedDistanceBetweenStopPointsValidator,
identicalStopPointsValidator,
sameQuayRefValidator,
sameStopPointsValidator,
stopPointsCountValidator,
missingPassengerStopAssignmentValidator,
nonIncreasingPassingTimeValidator,
unexpectedSpeedValidator,
unexpectedDistanceInServiceLinkValidator,
mismatchedStopPointsValidator,
mandatoryFieldsValidator,
duplicateInterchangesValidator,
invalidServiceAlterationValidator,
missingReplacementValidator,
duplicateInterchangesValidator,
unexpectedInterchangeDistanceValidator
new MismatchedTransportModeSubModeValidator(),
new UnexpectedDistanceBetweenStopPointsValidator(),
new IdenticalStopPointsValidator(),
new SameQuayRefValidator(),
new SameStopPointsValidator(),
new StopPointsCountValidator(),
new MissingPassengerStopAssignmentValidator(),
new NonIncreasingPassingTimeValidator(),
new UnexpectedSpeedValidator(),
new UnexpectedDistanceInServiceLinkValidator(),
new MismatchedStopPointsValidator(),
new MandatoryFieldsValidator(),
new DuplicateInterchangesValidator(),
new InvalidServiceAlterationValidator(),
new MissingReplacementValidator(),
new UnexpectedInterchangeDistanceValidator()
);

List<DatasetValidator> netexTimetableDatasetValidators = List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class SameStopPointsValidator implements JAXBValidator {
static final ValidationRule RULE = new ValidationRule(
"SAME_STOP_POINT_IN_JOURNEY_PATTERNS",
"JourneyPatterns have same StopPoints",
"JourneyPatterns have same StopPoints: [%s]",
"JourneyPatterns have same StopPoints: [%s]",
Severity.WARNING
);

Expand Down

0 comments on commit 0654e9e

Please sign in to comment.