diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 8cd6fb3..c982b2e 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -2,10 +2,10 @@ name: Build and Deploy
on:
push:
branches:
- - 1.x
+ - upgrade-netex-2.0_for_1.x
pull_request:
branches:
- - 1.x
+ - upgrade-netex-2.0_for_1.x
jobs:
maven-verify:
runs-on: ubuntu-24.04
@@ -52,7 +52,7 @@ jobs:
publish-snapshot:
name: Publish snapshot to Maven Central
- if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/1.x'
+ if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/upgrade-netex-2.0_for_1.x'
needs: maven-verify
uses: ./.github/workflows/maven-jreleaser-release.yml
with:
diff --git a/bindings.xjb b/bindings.xjb
index 93024ab..33bcf90 100644
--- a/bindings.xjb
+++ b/bindings.xjb
@@ -15,14 +15,14 @@
-
+
+ schemaLocation="./src/main/resources/xsd/2.0/netex_framework/netex_genericFramework/netex_organisation_version.xsd">
@@ -31,35 +31,28 @@
+ schemaLocation="./src/main/resources/xsd/2.0/netex_part_3/part3_fares/netex_salesOfferPackage_version.xsd">
-
-
-
-
-
-
+ schemaLocation="./src/main/resources/xsd/2.0/netex_part_3/part3_salesTransactions/netex_salesContract_version.xsd">
+ schemaLocation="./src/main/resources/xsd/2.0/netex_part_3/part3_salesTransactions/netex_retailConsortium_version.xsd">
+ schemaLocation="./src/main/resources/xsd/2.0/netex_framework/netex_responsibility/netex_version_support.xsd">
@@ -69,14 +62,43 @@
-
+ schemaLocation="./src/main/resources/xsd/2.0/netex_framework/netex_genericFramework/netex_zone_version.xsd">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index b523541..c1471a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
4.0.0
org.entur
netex-java-model
- 1.0.16-SNAPSHOT
+ 1.1.0-SNAPSHOT
netex-java-model
Generates Java model from NeTEx xsds using jaxb.
@@ -67,9 +67,10 @@
1.8
NeTEx
- master
- https://github.com/entur/${netexRepoName}
- 1.16
+ v2.0
+ https://github.com/NeTEx-CEN/${netexRepoName}
+ https://github.com/entur/${netexRepoName}
+ 2.0
2.3.3
@@ -272,9 +273,9 @@
- ${netexGithubUrl}/archive/${netexBranch}.zip
+ ${cenNetexGithubUrl}/archive/${netexBranch}.zip
src/main/resources/xsd/${netexVersion}
- NeTEx-${netexBranch}/xsd/*
+ NeTEx-${netexVersion}/xsd/*
./bin/netex-download-extract.sh
@@ -303,7 +304,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.15.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.15.zip
src/main/resources/xsd/1.15
NeTEx-tags-v1.0.15/xsd/*
@@ -319,7 +320,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.14.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.14.zip
src/main/resources/xsd/1.14
NeTEx-tags-v1.0.14/xsd/*
@@ -335,7 +336,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.13.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.13.zip
src/main/resources/xsd/1.13
NeTEx-tags-v1.0.13/xsd/*
@@ -351,7 +352,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.12.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.12.zip
src/main/resources/xsd/1.12
NeTEx-tags-v1.0.12/xsd/*
@@ -367,7 +368,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.11.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.11.zip
src/main/resources/xsd/1.11
NeTEx-tags-v1.0.11/xsd/*
@@ -383,7 +384,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.10-entur.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.10-entur.zip
src/main/resources/xsd/1.10
NeTEx-tags-v1.0.10-entur/xsd/*
@@ -399,7 +400,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.9.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.9.zip
src/main/resources/xsd/1.09
NeTEx-tags-v1.0.9/xsd/*
@@ -415,7 +416,7 @@
- ${netexGithubUrl}/archive/tags/v1.0.8.zip
+ ${enturNetexGithubUrl}/archive/tags/v1.0.8.zip
src/main/resources/xsd/1.08
NeTEx-tags-v1.0.8/xsd/*
diff --git a/src/main/java/org/rutebanken/netex/validation/NeTExValidator.java b/src/main/java/org/rutebanken/netex/validation/NeTExValidator.java
index 4b3f4a8..b95d052 100644
--- a/src/main/java/org/rutebanken/netex/validation/NeTExValidator.java
+++ b/src/main/java/org/rutebanken/netex/validation/NeTExValidator.java
@@ -44,7 +44,8 @@ public enum NetexVersion {
v1_13 ("1.13"),
v1_14 ("1.14"),
v1_15 ("1.15"),
- v1_16 ("1.16");
+ v1_16 ("1.16"),
+ v2_0 ("2.0");
private final String folderName;
@@ -59,7 +60,7 @@ public String toString() {
}
private final Schema neTExSchema;
- public static final NetexVersion LATEST = NetexVersion.v1_16;
+ public static final NetexVersion LATEST = NetexVersion.v2_0;
private static final Map VALIDATORS_PER_VERSION = new EnumMap<>(NetexVersion.class);
diff --git a/src/test/java/org/rutebanken/netex/model/AbstractUnmarshalFrameTest.java b/src/test/java/org/rutebanken/netex/model/AbstractUnmarshalFrameTest.java
index e3fddbc..e7bb2ee 100644
--- a/src/test/java/org/rutebanken/netex/model/AbstractUnmarshalFrameTest.java
+++ b/src/test/java/org/rutebanken/netex/model/AbstractUnmarshalFrameTest.java
@@ -32,6 +32,19 @@ public static void initContext() throws JAXBException {
}
-
+ /**
+ * Helper method to extract string value from MultilingualString.
+ * In NeTEx 2.0, MultilingualString uses mixed content instead of a simple value.
+ */
+ protected static String getStringValue(MultilingualString multilingualString) {
+ if (multilingualString == null || multilingualString.getContent() == null) {
+ return null;
+ }
+ return multilingualString.getContent().stream()
+ .filter(String.class::isInstance)
+ .map(String.class::cast)
+ .findFirst()
+ .orElse(null);
+ }
}
diff --git a/src/test/java/org/rutebanken/netex/model/MarshalUnmarshalTest.java b/src/test/java/org/rutebanken/netex/model/MarshalUnmarshalTest.java
index 78b8b7b..05492a6 100644
--- a/src/test/java/org/rutebanken/netex/model/MarshalUnmarshalTest.java
+++ b/src/test/java/org/rutebanken/netex/model/MarshalUnmarshalTest.java
@@ -25,13 +25,15 @@
import javax.xml.bind.Unmarshaller;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamWriter;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.LocalDateTime;
import java.time.LocalTime;
-import java.time.temporal.ChronoField;
import java.util.Arrays;
import java.util.List;
@@ -55,7 +57,7 @@ void publicationDeliveryWithOffsetDateTime() throws JAXBException {
Marshaller marshaller = jaxbContext.createMarshaller();
PublicationDeliveryStructure publicationDelivery = new PublicationDeliveryStructure()
- .withDescription(new MultilingualString().withValue("value").withLang("no").withTextIdType("")).withPublicationTimestamp(LocalDateTime.now().withNano(0))
+ .withDescription(new MultilingualString().withContent("value").withLang("no").withTextIdType("")).withPublicationTimestamp(LocalDateTime.now().withNano(0))
.withParticipantRef("participantRef");
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
@@ -75,7 +77,7 @@ void publicationDeliveryWithOffsetDateTime() throws JAXBException {
System.out.println(actual.getPublicationTimestamp());
assertThat(actual.getPublicationTimestamp()).isEqualTo(publicationDelivery.getPublicationTimestamp());
assertThat(actual.getDescription()).isNotNull();
- assertThat(actual.getDescription().getValue()).isEqualTo(publicationDelivery.getDescription().getValue());
+ assertThat(actual.getDescription().getContent()).isEqualTo(publicationDelivery.getDescription().getContent());
assertThat(actual.getParticipantRef()).isEqualTo(publicationDelivery.getParticipantRef());
}
@@ -134,7 +136,7 @@ void timetableWithVehicleModes() throws JAXBException {
Marshaller marshaller = jaxbContext.createMarshaller();
TimetableFrame timetableFrame = factory.createTimetableFrame().withVersion("any").withId("TimetableFrame")
- .withName(factory.createMultilingualString().withValue("TimetableFrame")).withVehicleModes(VehicleModeEnumeration.AIR);
+ .withName(factory.createMultilingualString().withContent("TimetableFrame")).withVehicleModes(AllPublicTransportModesEnumeration.AIR);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
@@ -151,9 +153,9 @@ void timetableWithVehicleModes() throws JAXBException {
assertThat(actual.getVersion()).isNotNull().isNotEmpty().isEqualTo(timetableFrame.getVersion());
assertThat(actual.getId()).isNotNull().isNotEmpty().isEqualTo(timetableFrame.getId());
- assertThat(actual.getName().getValue()).isNotNull().isNotEmpty().isEqualTo(timetableFrame.getName().getValue());
+ assertThat(actual.getName().getContent()).isNotNull().isNotEmpty().isEqualTo(timetableFrame.getName().getContent());
assertThat(actual.getVehicleModes()).isNotNull().isNotEmpty().hasSize(1);
- assertThat(actual.getVehicleModes().get(0)).isNotNull().isEqualTo(VehicleModeEnumeration.AIR);
+ assertThat(actual.getVehicleModes().get(0)).isNotNull().isEqualTo(AllPublicTransportModesEnumeration.AIR);
}
@Test
@@ -162,11 +164,11 @@ void dayTypeWithPropertiesOfDay() throws JAXBException {
List daysOfWeek = Arrays.asList(DayOfWeekEnumeration.MONDAY, DayOfWeekEnumeration.TUESDAY, DayOfWeekEnumeration.WEDNESDAY,
DayOfWeekEnumeration.THURSDAY, DayOfWeekEnumeration.FRIDAY);
- PropertyOfDay propertyOfDay = factory.createPropertyOfDay().withDescription(factory.createMultilingualString().withValue("PropertyOfDay"))
- .withName(factory.createMultilingualString().withValue("PropertyOfDay")).withDaysOfWeek(daysOfWeek);
+ PropertyOfDay propertyOfDay = factory.createPropertyOfDay().withDescription(factory.createMultilingualString().withContent("PropertyOfDay"))
+ .withName(factory.createMultilingualString().withContent("PropertyOfDay")).withDaysOfWeek(daysOfWeek);
PropertiesOfDay_RelStructure propertiesOfDay = factory.createPropertiesOfDay_RelStructure().withPropertyOfDay(propertyOfDay);
DayType dayType = factory.createDayType().withVersion("any").withId(String.format("%s:dt:weekday", "SK4488"))
- .withName(factory.createMultilingualString().withValue("Ukedager (mandag til fredag)")).withProperties(propertiesOfDay);
+ .withName(factory.createMultilingualString().withContent("Ukedager (mandag til fredag)")).withProperties(propertiesOfDay);
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
@@ -183,73 +185,80 @@ void dayTypeWithPropertiesOfDay() throws JAXBException {
assertThat(actual.getVersion()).isNotNull().isNotEmpty().isEqualTo(dayType.getVersion());
assertThat(actual.getId()).isNotNull().isNotEmpty().isEqualTo(dayType.getId());
- assertThat(actual.getName().getValue()).isNotNull().isNotEmpty().isEqualTo(dayType.getName().getValue());
+ assertThat(actual.getName().getContent()).isNotNull().isNotEmpty().isEqualTo(dayType.getName().getContent());
assertThat(actual.getProperties().getPropertyOfDay().get(0).getDaysOfWeek()).isNotNull().isNotEmpty().hasSize(5)
.hasOnlyElementsOfType(DayOfWeekEnumeration.class).hasSameElementsAs(daysOfWeek);
}
@Test
- void datedCallWithLocalDate() throws JAXBException {
+ void marshalledNamespacePrefixes() throws JAXBException {
Marshaller marshaller = jaxbContext.createMarshaller();
- DatedCall datedCall = new DatedCall().withArrivalDate(LocalDateTime.now().with(ChronoField.MILLI_OF_DAY, 0));
+ PublicationDeliveryStructure publicationDeliveryStructure = new PublicationDeliveryStructure();
+
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- marshaller.marshal(factory.createDatedCall(datedCall), byteArrayOutputStream);
+ marshaller.marshal(factory.createPublicationDelivery(publicationDeliveryStructure), byteArrayOutputStream);
String xml = byteArrayOutputStream.toString();
System.out.println(xml);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
-
- JAXBElement actual = (JAXBElement) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));
-
- assertThat(actual.getValue().getArrivalDate()).isEqualTo(datedCall.getArrivalDate());
-
+ assertThat(xml)
+ .as("Namespace declaration without prefix for netex").contains("xmlns=\"http://www.netex.org.uk/netex\"")
+ .as(" actual = (JAXBElement) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));
+
+ assertThat(actual.getValue().getFromDate().getHour()).isEqualTo(condition.getFromDate().getHour());
+ assertThat(actual.getValue().getFromDate()).isEqualToIgnoringNanos(condition.getFromDate());
}
@Test
- void datedCallWithLocalDateTime() throws JAXBException {
+ void availabilityConditionWithCreatedLocalDateTime() throws JAXBException {
Marshaller marshaller = jaxbContext.createMarshaller();
- DatedCall datedCall = new DatedCall().withChanged(LocalDateTime.now());
+ AvailabilityCondition condition = new AvailabilityCondition()
+ .withCreated(LocalDateTime.now())
+ .withId("test:condition:2")
+ .withVersion("1");
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- marshaller.marshal(factory.createDatedCall(datedCall), byteArrayOutputStream);
+ marshaller.marshal(factory.createAvailabilityCondition(condition), byteArrayOutputStream);
String xml = byteArrayOutputStream.toString();
System.out.println(xml);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- JAXBElement actual = (JAXBElement) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));
+ @SuppressWarnings("unchecked")
+ JAXBElement actual = (JAXBElement) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));
- assertThat(actual.getValue().getChanged().getHour()).isEqualTo(datedCall.getChanged().getHour());
- assertThat(actual.getValue().getChanged()).isEqualToIgnoringNanos(datedCall.getChanged());
+ assertThat(actual.getValue().getCreated().getHour()).isEqualTo(condition.getCreated().getHour());
+ assertThat(actual.getValue().getCreated()).isEqualToIgnoringNanos(condition.getCreated());
}
@Test
@@ -264,12 +273,12 @@ void unmarshalPublicationDeliveryAndVerifyValidBetween() throws JAXBException, I
CompositeFrame compositeFrame = (CompositeFrame) actual.dataObjects.compositeFrameOrCommonFrame
.get(0).getValue();
ValidityConditions_RelStructure validityConditions = compositeFrame.getValidityConditions();
- ValidBetween validBetweenWithTimezone = (ValidBetween) validityConditions.getValidityConditionRefOrValidBetweenOrValidityCondition_().get(0);
+ ValidBetween validBetweenWithTimezone = (ValidBetween) validityConditions.getValidityConditionRefOrValidBetweenOrValidityCondition_Dummy().get(0);
assertThat(validBetweenWithTimezone.getFromDate()).isNotNull();
assertThat(validBetweenWithTimezone.getToDate()).isNotNull();
assertThat(validBetweenWithTimezone.getToDate()).hasToString("2017-01-01T11:00");
- ValidBetween validBetweenWithoutTimezone = (ValidBetween) validityConditions.getValidityConditionRefOrValidBetweenOrValidityCondition_().get(1);
+ ValidBetween validBetweenWithoutTimezone = (ValidBetween) validityConditions.getValidityConditionRefOrValidBetweenOrValidityCondition_Dummy().get(1);
assertThat(validBetweenWithoutTimezone.getFromDate()).isNotNull();
assertThat(validBetweenWithoutTimezone.getToDate()).isNotNull();
diff --git a/src/test/java/org/rutebanken/netex/model/ToStringTest.java b/src/test/java/org/rutebanken/netex/model/ToStringTest.java
index 895f567..a2e253d 100644
--- a/src/test/java/org/rutebanken/netex/model/ToStringTest.java
+++ b/src/test/java/org/rutebanken/netex/model/ToStringTest.java
@@ -23,8 +23,8 @@ class ToStringTest {
@Test
void toStringMethod() {
StopPlace stopPlace = new StopPlace()
- .withName(new MultilingualString().withValue("berger"))
- .withDescription(new MultilingualString().withValue("description"));
+ .withName(new MultilingualString().withContent("berger"))
+ .withDescription(new MultilingualString().withContent("description"));
System.out.println(stopPlace.toString());
assertThat(stopPlace.toString()).contains("berger");
assertThat(stopPlace.toString()).contains("description");
diff --git a/src/test/java/org/rutebanken/netex/model/UnmarshalResourceFrameTest.java b/src/test/java/org/rutebanken/netex/model/UnmarshalResourceFrameTest.java
index 67e2324..7a1595d 100644
--- a/src/test/java/org/rutebanken/netex/model/UnmarshalResourceFrameTest.java
+++ b/src/test/java/org/rutebanken/netex/model/UnmarshalResourceFrameTest.java
@@ -110,8 +110,8 @@ void unmarshalResourceFrame() throws JAXBException {
CompositeFrame compositeFrame = (CompositeFrame) publicationDeliveryStructure.getDataObjects().getCompositeFrameOrCommonFrame().get(0).getValue();
ResourceFrame resourceFrame = (ResourceFrame) compositeFrame.getFrames().getCommonFrame().get(0).getValue();
- Authority authority = (Authority) resourceFrame.getOrganisations().getOrganisation_().get(0).getValue();
- assertEquals("Vy", authority.getName().getValue());
+ Authority authority = (Authority) resourceFrame.getOrganisations().getOrganisation_Dummy().get(0).getValue();
+ assertEquals("Vy", getStringValue(authority.getName()));
diff --git a/src/test/java/org/rutebanken/netex/model/UnmarshalServiceCalendarFrameTest.java b/src/test/java/org/rutebanken/netex/model/UnmarshalServiceCalendarFrameTest.java
index b469cff..06535fa 100644
--- a/src/test/java/org/rutebanken/netex/model/UnmarshalServiceCalendarFrameTest.java
+++ b/src/test/java/org/rutebanken/netex/model/UnmarshalServiceCalendarFrameTest.java
@@ -128,7 +128,7 @@ void unmarshalServiceCalendarFrame() throws JAXBException {
ServiceCalendarFrame serviceCalendarFrame = (ServiceCalendarFrame) compositeFrame.getFrames().getCommonFrame().get(0).getValue();
- DayType dayType = (DayType) serviceCalendarFrame.getDayTypes().getDayType_().get(0).getValue();
+ DayType dayType = (DayType) serviceCalendarFrame.getDayTypes().getDayType_Dummy().get(0).getValue();
assertEquals(DayOfWeekEnumeration.TUESDAY, dayType.getProperties().getPropertyOfDay().get(0).getDaysOfWeek().get(0));
OperatingDay operatingDay = serviceCalendarFrame.getOperatingDays().getOperatingDay().get(0);
diff --git a/src/test/java/org/rutebanken/netex/model/UnmarshalServiceFrameTest.java b/src/test/java/org/rutebanken/netex/model/UnmarshalServiceFrameTest.java
index 26c385e..dc5d662 100644
--- a/src/test/java/org/rutebanken/netex/model/UnmarshalServiceFrameTest.java
+++ b/src/test/java/org/rutebanken/netex/model/UnmarshalServiceFrameTest.java
@@ -146,21 +146,21 @@ void unmarshalServiceFrame() throws JAXBException {
CompositeFrame compositeFrame = (CompositeFrame) publicationDeliveryStructure.getDataObjects().getCompositeFrameOrCommonFrame().get(0).getValue();
ServiceFrame serviceFrame = (ServiceFrame) compositeFrame.getFrames().getCommonFrame().get(0).getValue();
- Line line = (Line) serviceFrame.getLines().getLine_().get(0).getValue();
- assertEquals("Narvik-Riksgränsen (Sverige)", line.getName().getValue());
- assertEquals("F8", line.getPublicCode());
+ Line line = (Line) serviceFrame.getLines().getLine_Dummy().get(0).getValue();
+ assertEquals("Narvik-Riksgränsen (Sverige)", getStringValue(line.getName()));
+ assertEquals("F8", line.getPublicCode().getValue());
assertEquals("F8", line.getPrivateCode().getValue());
assertEquals("rail", line.getTransportMode().value());
- Route route = (Route) serviceFrame.getRoutes().getRoute_().get(0).getValue();
- assertEquals("Riksgränsen-Narvik Ofotbanen", route.getName().getValue());
- assertEquals("KJ-NK", route.getShortName().getValue());
+ Route route = (Route) serviceFrame.getRoutes().getRoute_Dummy().get(0).getValue();
+ assertEquals("Riksgränsen-Narvik Ofotbanen", getStringValue(route.getName()));
+ assertEquals("KJ-NK", getStringValue(route.getShortName()));
PointOnRoute pointOnRoute = route.getPointsInSequence().getPointOnRoute().get(0);
assertEquals("VYG:RoutePoint:KJ", pointOnRoute.getPointRef().getValue().getRef());
- JourneyPattern journeyPattern = (JourneyPattern) serviceFrame.getJourneyPatterns().getJourneyPattern_OrJourneyPatternView().get(0).getValue();
- assertEquals("KMB-NK", journeyPattern.getName().getValue());
+ JourneyPattern journeyPattern = (JourneyPattern) serviceFrame.getJourneyPatterns().getJourneyPattern_Dummy().get(0).getValue();
+ assertEquals("KMB-NK", getStringValue(journeyPattern.getName()));
assertEquals("VYG:Route:F8-R", journeyPattern.getRouteRef().getRef());
StopPointInJourneyPattern stopPointInJourneyPattern = (StopPointInJourneyPattern) journeyPattern.getPointsInSequence().getPointInJourneyPatternOrStopPointInJourneyPatternOrTimingPointInJourneyPattern().get(0);
diff --git a/src/test/java/org/rutebanken/netex/model/UnmarshalSiteFrameTest.java b/src/test/java/org/rutebanken/netex/model/UnmarshalSiteFrameTest.java
index 125f0f9..2d8c151 100644
--- a/src/test/java/org/rutebanken/netex/model/UnmarshalSiteFrameTest.java
+++ b/src/test/java/org/rutebanken/netex/model/UnmarshalSiteFrameTest.java
@@ -157,19 +157,19 @@ void unmarshalSiteFrame() throws JAXBException {
PublicationDeliveryStructure publicationDeliveryStructure = jaxbElement.getValue();
SiteFrame siteFrame = (SiteFrame) publicationDeliveryStructure.getDataObjects().getCompositeFrameOrCommonFrame().get(0).getValue();
- StopPlace stopPlace = (StopPlace) siteFrame.getStopPlaces().getStopPlace_().get(0).getValue();
- assertEquals("Krokstien", stopPlace.getName().getValue());
- assertEquals(AllVehicleModesOfTransportEnumeration.BUS, stopPlace.getTransportMode());
+ StopPlace stopPlace = (StopPlace) siteFrame.getStopPlaces().getStopPlace().get(0);
+ assertEquals("Krokstien", getStringValue(stopPlace.getName()));
+ assertEquals(AllPublicTransportModesEnumeration.BUS, stopPlace.getTransportMode());
assertEquals(StopTypeEnumeration.ONSTREET_BUS, stopPlace.getStopPlaceType());
- assertEquals("BRA:TariffZone:311", stopPlace.getTariffZones().getTariffZoneRef_().get(0).getValue().getRef());
+ assertEquals("BRA:TariffZone:311", stopPlace.getTariffZones().getTariffZoneRef_Dummy().get(0).getValue().getRef());
Quay quay = (Quay) stopPlace.getQuays().getQuayRefOrQuay().get(0).getValue();
assertEquals(BigDecimal.valueOf(59.910579), quay.getCentroid().getLocation().getLatitude());
TariffZone tariffZone = (TariffZone) siteFrame.getTariffZones().getTariffZone().get(0).getValue();
- assertEquals("1", tariffZone.getName().getValue());
+ assertEquals("1", getStringValue(tariffZone.getName()));
GroupOfStopPlaces groupOfStopPlaces = siteFrame.getGroupsOfStopPlaces().getGroupOfStopPlaces().get(0);
- assertEquals("Lillehammer", groupOfStopPlaces.getName().getValue());
+ assertEquals("Lillehammer", getStringValue(groupOfStopPlaces.getName()));
assertEquals("NSR:StopPlace:420", groupOfStopPlaces.getMembers().getStopPlaceRef().get(0).getValue().getRef());
}
@@ -211,7 +211,7 @@ void unmarshalTopographicPlaceWithPolygon() throws JAXBException {
SiteFrame siteFrame = (SiteFrame) publicationDeliveryStructure.getDataObjects().getCompositeFrameOrCommonFrame().get(0).getValue();
TopographicPlace topographicPlace = siteFrame.getTopographicPlaces().getTopographicPlace().get(0);
- assertEquals("Oslo", topographicPlace.getDescriptor().getName().getValue());
+ assertEquals("Oslo", getStringValue(topographicPlace.getDescriptor().getName()));
assertEquals(TopographicPlaceTypeEnumeration.MUNICIPALITY, topographicPlace.getTopographicPlaceType());
assertNotNull(topographicPlace.getPolygon());
}
diff --git a/src/test/java/org/rutebanken/netex/model/UnmarshalTimetableFrameTest.java b/src/test/java/org/rutebanken/netex/model/UnmarshalTimetableFrameTest.java
index 163fd7a..4bf92ac 100644
--- a/src/test/java/org/rutebanken/netex/model/UnmarshalTimetableFrameTest.java
+++ b/src/test/java/org/rutebanken/netex/model/UnmarshalTimetableFrameTest.java
@@ -120,7 +120,7 @@ void unmarshalTimetableFrame() throws JAXBException {
TimetableFrame timetableFrame = (TimetableFrame) compositeFrame.getFrames().getCommonFrame().get(0).getValue();
ServiceJourney serviceJourney = (ServiceJourney) timetableFrame.getVehicleJourneys().getVehicleJourneyOrDatedVehicleJourneyOrNormalDatedVehicleJourney().get(0);
- assertEquals("96", serviceJourney.getName().getValue());
+ assertEquals("96", getStringValue(serviceJourney.getName()));
assertEquals("96", serviceJourney.getPrivateCode().getValue());
assertEquals("rail", serviceJourney.getTransportMode().value());