diff options
46 files changed, 301 insertions, 219 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/NotSupportedFormatTypeException.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/NotSupportedFormatTypeException.java new file mode 100644 index 0000000..3e3214d --- /dev/null +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/NotSupportedFormatTypeException.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2020 Nokia. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.dcaegen2.services.pmmapper.exceptions; + +public class NotSupportedFormatTypeException extends Exception { + + public NotSupportedFormatTypeException(String message) { + super(message); + } + +} diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/measurement/nr/MeasDataFile.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/measurement/nr/MeasDataFile.java index 1ef1a8b..0f87465 100644 --- a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/measurement/nr/MeasDataFile.java +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/measurement/nr/MeasDataFile.java @@ -20,10 +20,11 @@ package org.onap.dcaegen2.services.pmmapper.model.measurement.nr; -import java.util.ArrayList; -import java.util.List; +import lombok.Data; +import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementData; +import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementFile; +import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementInfo; -import java.util.Optional; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -32,10 +33,9 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; -import lombok.Data; -import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementData; -import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementFile; -import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementInfo; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { @@ -43,7 +43,7 @@ import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementI "measData", "fileFooter" }) -@XmlRootElement(name = "MeasDataFile") +@XmlRootElement(name = "measDataFile") @Data public class MeasDataFile implements MeasurementFile { @@ -68,7 +68,7 @@ public class MeasDataFile implements MeasurementFile { measData.clear(); measurementData.forEach(measurementDatum -> { MeasData measDatum = new MeasData(); - measDatum.setMeasuredEntity((MeasData.MeasuredEntity) measurementDatum.getManagedEntity()); + measDatum.setMeasEntity((MeasData.MeasEntity) measurementDatum.getManagedEntity()); measDatum.setMeasInfo(measurementDatum.getMeasurementInfo()); this.measData.add(measDatum); }); @@ -81,7 +81,7 @@ public class MeasDataFile implements MeasurementFile { @Data public static class FileFooter { - @XmlElement(name = "MeasData", required = true) + @XmlElement(name = "measData", required = true) protected MeasDataFile.FileFooter.MeasData measData; @XmlAccessorType(XmlAccessType.FIELD) @@ -104,7 +104,7 @@ public class MeasDataFile implements MeasurementFile { public static class FileHeader { @XmlElement(required = true) protected MeasDataFile.FileHeader.FileSender fileSender; - @XmlElement(name = "MeasData", required = true) + @XmlElement(name = "measData", required = true) protected MeasDataFile.FileHeader.MeasData measData; @XmlAttribute(name = "fileFormatVersion", required = true) protected String fileFormatVersion; @@ -137,14 +137,13 @@ public class MeasDataFile implements MeasurementFile { @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "measuredEntity", + @XmlType(name = "", propOrder = {"measEntity", "measInfo" }) @Data public static class MeasData implements MeasurementData { @XmlElement(required = true) - protected MeasDataFile.MeasData.MeasuredEntity measuredEntity; + protected MeasEntity measEntity; @XmlElement() protected List<MeasurementInfo> measInfo; @@ -160,13 +159,13 @@ public class MeasDataFile implements MeasurementFile { @Override public Object getManagedEntity() { - return this.measuredEntity; + return this.measEntity; } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @Data - public static class MeasuredEntity { + public static class MeasEntity { @XmlAttribute(name = "localDn") protected String localDn; @XmlAttribute(name = "userLabel") diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java index 70ad8ab..dbe58ab 100644 --- a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java @@ -49,8 +49,8 @@ public class MeasConverter { private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(MeasConverter.class));
public static final String LTE_FILE_TYPE = "org.3GPP.32.435#measCollec";
- public static final String NR_FILE_TYPE = "org.3GPP.28.550#measData";
-
+ public static final String NR_FILE_TYPE = "org.3GPP.28.532#measData";
+ public static final String NOT_SUPPORTED_TYPE = "notSupportedType";
/**
* Converts 3GPP Measurement xml string to MeasCollecFile.
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java index c6fa3fa..0d14e1c 100644 --- a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidator.java @@ -23,11 +23,14 @@ package org.onap.dcaegen2.services.pmmapper.utils; import java.nio.file.Files; import java.util.HashMap; import java.util.stream.Stream; + import lombok.NonNull; +import org.onap.dcaegen2.services.pmmapper.exceptions.NotSupportedFormatTypeException; import org.onap.dcaegen2.services.pmmapper.model.Event; import org.onap.logging.ref.slf4j.ONAPLogAdapter; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; + import javax.xml.XMLConstants; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; @@ -41,6 +44,7 @@ public class XMLValidator { private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(XMLValidator.class)); private HashMap<String, Schema> schemas; private SchemaFactory schemaFactory; + public XMLValidator(Path schemaDirectory) { logger.unwrap().trace("Constructing schema from {}", schemaDirectory); schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); @@ -57,14 +61,15 @@ public class XMLValidator { logger.unwrap().debug("Loading schema from {}", schema.toString()); try { schemas.put(schema.getFileName().toString(), schemaFactory.newSchema(schema.toFile())); - } catch(SAXException exception) { + } catch (SAXException exception) { logger.unwrap().error("Failed to discover a valid schema at {}", schema, exception); throw new IllegalArgumentException("Failed to discover a valid schema from given path", exception); } } + public boolean validate(@NonNull Event event) { try { - Validator validator = schemas.get(event.getMetadata().getFileFormatType()).newValidator(); + Validator validator = getValidatorForAccordingFileFormat(event.getMetadata().getFileFormatType()); validator.validate(new StreamSource(new StringReader(event.getBody()))); logger.unwrap().info("XML validation successful"); logger.unwrap().debug(String.valueOf(event)); @@ -72,6 +77,17 @@ public class XMLValidator { } catch (SAXException | IOException exception) { logger.unwrap().error("XML validation failed {}", event, exception); return false; + } catch (NotSupportedFormatTypeException exception) { + logger.unwrap().error("XML validation failed - given file format type is not supported. {}", event, exception); + return false; + } + } + + private Validator getValidatorForAccordingFileFormat(String fileFormatType) throws NotSupportedFormatTypeException { + Schema schema = schemas.get(fileFormatType); + if (schema == null) { + throw new NotSupportedFormatTypeException(fileFormatType); } + return schema.newValidator(); } }
\ No newline at end of file diff --git a/src/main/resources/schemas/org.3GPP.28.550#measData b/src/main/resources/schemas/org.3GPP.28.532#measData index d3a9fef..0b4a8aa 100644 --- a/src/main/resources/schemas/org.3GPP.28.550#measData +++ b/src/main/resources/schemas/org.3GPP.28.532#measData @@ -1,12 +1,12 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8" ?> <!-- - 3GPP TS 28.550 Measurements data XML file format definition + 3GPP TS 28.532 Measurements data XML file format definition data file XML schema measData.xsd --> -<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:md="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData" targetNamespace="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData" elementFormDefault="qualified"> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:md="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData" targetNamespace="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData" elementFormDefault="qualified"> <!-- Measurement collection data file root XML element --> - <element name="MeasDataFile"> + <element name="measDataFile"> <complexType> <sequence> <element name="fileHeader"> @@ -14,29 +14,29 @@ <sequence> <element name="fileSender"> <complexType> - <attribute name="senderName" type="string" use="optional"/> - <attribute name="senderType" type="string" use="optional"/> + <attribute name="senderName" type="string" use="optional" /> + <attribute name="senderType" type="string" use="optional" /> </complexType> </element> - <element name="MeasData"> + <element name="measData"> <complexType> - <attribute name="beginTime" type="dateTime" use="required"/> + <attribute name="beginTime" type="dateTime" use="required" /> </complexType> </element> </sequence> - <attribute name="fileFormatVersion" type="string" use="required"/> - <attribute name="vendorName" type="string" use="optional"/> - <attribute name="dnPrefix" type="string" use="optional"/> + <attribute name="fileFormatVersion" type="string" use="required" /> + <attribute name="vendorName" type="string" use="optional" /> + <attribute name="dnPrefix" type="string" use="optional" /> </complexType> </element> <element name="measData" minOccurs="0" maxOccurs="unbounded"> <complexType> <sequence> - <element name="measuredEntity"> + <element name="measEntity"> <complexType> - <attribute name="userLabel" type="string" use="optional"/> - <attribute name="localDn" type="string" use="optional"/> - <attribute name="swVersion" type="string" use="optional"/> + <attribute name="userLabel" type="string" use="optional" /> + <attribute name="localDn" type="string" use="optional" /> + <attribute name="swVersion" type="string" use="optional" /> </complexType> </element> <element name="measInfo" minOccurs="0" maxOccurs="unbounded"> @@ -44,31 +44,31 @@ <sequence> <element name="job" minOccurs="0"> <complexType> - <attribute name="jobId" type="string" use="required"/> + <attribute name="jobId" type="string" use="required" /> </complexType> </element> <element name="granPeriod"> <complexType> - <attribute name="duration" type="duration" use="required"/> - <attribute name="endTime" type="dateTime" use="required"/> + <attribute name="duration" type="duration" use="required" /> + <attribute name="endTime" type="dateTime" use="required" /> </complexType> </element> <element name="repPeriod" minOccurs="0"> <complexType> - <attribute name="duration" type="duration" use="required"/> + <attribute name="duration" type="duration" use="required" /> </complexType> </element> <choice> <element name="measTypes"> <simpleType> - <list itemType="Name"/> + <list itemType="Name" /> </simpleType> </element> <element name="measType" minOccurs="0" maxOccurs="unbounded"> <complexType> <simpleContent> <extension base="Name"> - <attribute name="p" type="positiveInteger" use="required"/> + <attribute name="p" type="positiveInteger" use="required" /> </extension> </simpleContent> </complexType> @@ -80,26 +80,26 @@ <choice> <element name="measResults"> <simpleType> - <list itemType="md:measResultType"/> + <list itemType="md:measResultType" /> </simpleType> </element> <element name="r" minOccurs="0" maxOccurs="unbounded"> <complexType> <simpleContent> <extension base="md:measResultType"> - <attribute name="p" type="positiveInteger" use="required"/> + <attribute name="p" type="positiveInteger" use="required" /> </extension> </simpleContent> </complexType> </element> </choice> - <element name="suspect" type="boolean" minOccurs="0"/> + <element name="suspect" type="boolean" minOccurs="0" /> </sequence> - <attribute name="measObjLdn" type="string" use="required"/> + <attribute name="measObjLdn" type="string" use="required" /> </complexType> </element> </sequence> - <attribute name="measInfoId" type="string" use="optional"/> + <attribute name="measInfoId" type="string" use="optional" /> </complexType> </element> </sequence> @@ -108,9 +108,9 @@ <element name="fileFooter"> <complexType> <sequence> - <element name="MeasData"> + <element name="measData"> <complexType> - <attribute name="endTime" type="dateTime" use="required"/> + <attribute name="endTime" type="dateTime" use="required" /> </complexType> </element> </sequence> @@ -123,7 +123,7 @@ <union memberTypes="integer float string"> <simpleType> <restriction base="string"> - <enumeration value="NULL"/> + <enumeration value="NULL" /> </restriction> </simpleType> </union> diff --git a/src/main/resources/templates/org.3GPP.28.550#measData b/src/main/resources/templates/org.3GPP.28.532#measData index 653077e..a845cc8 100644 --- a/src/main/resources/templates/org.3GPP.28.550#measData +++ b/src/main/resources/templates/org.3GPP.28.532#measData @@ -19,9 +19,9 @@ ============LICENSE_END========================================================= --> <#compress> -<#assign fileHeader = xml.MeasDataFile.fileHeader> -<#assign fileFooter = xml.MeasDataFile.fileFooter> -<#assign measData = xml.MeasDataFile.measData> +<#assign fileHeader = xml.measDataFile.fileHeader> +<#assign fileFooter = xml.measDataFile.fileFooter> +<#assign measData = xml.measDataFile.measData> <#setting datetime_format="iso"> { "event": { @@ -42,8 +42,8 @@ "sourceName": "${metadata.sourceName}", "reportingEntityName": "", "priority": "Normal", - "startEpochMicrosec": ${fileHeader.MeasData.@beginTime?datetime?long?c}, - "lastEpochMicrosec": ${fileFooter.MeasData.@endTime?datetime?long?c}, + "startEpochMicrosec": ${fileHeader.measData.@beginTime?datetime?long?c}, + "lastEpochMicrosec": ${fileFooter.measData.@endTime?datetime?long?c}, "version": "4.0", "vesEventListenerVersion": "7.1", "timeZoneOffset": "${metadata.timeZoneOffset}" @@ -116,9 +116,9 @@ <#macro measDataCollection> { "granularityPeriod": ${measData.measInfo.granPeriod.@endTime[0]!?datetime?long?c}, - "measuredEntityUserName": "${measData.measuredEntity.@userLabel[0]!}", - "measuredEntityDn": "${measData.measuredEntity.@localDn[0]!}", - "measuredEntitySoftwareVersion": "${measData.measuredEntity.@swVersion[0]!}", + "measuredEntityUserName": "${measData.measEntity.@userLabel[0]!}", + "measuredEntityDn": "${measData.measEntity.@localDn[0]!}", + "measuredEntitySoftwareVersion": "${measData.measEntity.@swVersion[0]!}", "measInfoList": <@measInfoList/> } </#macro> @@ -129,4 +129,4 @@ "measDataCollection": <@measDataCollection/> } </#macro> -</#compress>
\ No newline at end of file +</#compress> diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java index 3eea765..b4fce87 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java @@ -49,12 +49,10 @@ import org.onap.dcaegen2.services.pmmapper.model.measurement.common.MeasurementF import org.onap.dcaegen2.services.pmmapper.utils.MeasConverter; import io.undertow.server.HttpServerExchange; -import org.powermock.core.classloader.annotations.PowerMockIgnore; import utils.ArgumentCreator; import utils.EventUtils; @ExtendWith(MockitoExtension.class) -@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.parsers.*", "org.xml.*", "javax.management.*"}) class MeasFilterHandlerTest { private static final Path FILTER_DIRECTORY = Paths.get("src/test/resources/filter_test/"); @@ -211,7 +209,7 @@ class MeasFilterHandlerTest { testEvent.setFilter(generateValidFilter()); return Arguments.of(expectedEvent, testEvent); }; - return EventUtils.generateEventArguments(FILTER_DIRECTORY, "nr", creator); + return EventUtils.generateEventArguments(FILTER_DIRECTORY, creator); } diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MetadataFilterTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MetadataFilterTest.java index bf232ea..7ee13b7 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MetadataFilterTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MetadataFilterTest.java @@ -123,6 +123,6 @@ public class MetadataFilterTest { return Arguments.of(testEvent); }; - return EventUtils.generateEventArguments(DATA_DIRECTORY, "/nr", creator); + return EventUtils.generateEventArguments(DATA_DIRECTORY, creator); } }
\ No newline at end of file diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/mapping/MapperTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/mapping/MapperTest.java index 2356a57..7ddc929 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/mapping/MapperTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/mapping/MapperTest.java @@ -120,9 +120,9 @@ class MapperTest { doThrow(new TemplateException(mock(Environment.class))).when(mappingTemplateMock) .process(any(), any()); HashMap<String, Template> templates = new HashMap<>(); - templates.put("org.3GPP.28.550#measData", mappingTemplateMock); + templates.put("org.3GPP.28.532#measData", mappingTemplateMock); Whitebox.setInternalState(objUnderTest, "templates", templates); - Path testFile = Paths.get(dataDirectory + "/28.550/no_measdata/test.xml"); + Path testFile = Paths.get(dataDirectory + "/28.532/no_measdata/test.xml"); Event testEvent = EventUtils.makeMockEvent(EventUtils.fileContentsToString(testFile), fifthGenerationMetadata); assertThrows(MappingException.class, () -> objUnderTest.map(testEvent)); } @@ -185,7 +185,7 @@ class MapperTest { Event testEvent = EventUtils.makeMockEvent(EventUtils.fileContentsToString(testEventPath), eventMetadata); return Arguments.of(testEvent); }; - return EventUtils.generateEventArguments(dataDirectory, "/28.550", creator); + return EventUtils.generateEventArguments(dataDirectory, creator); } } diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/MeasSplitterTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/MeasSplitterTest.java index 120bea1..5ab0d38 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/MeasSplitterTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/MeasSplitterTest.java @@ -38,6 +38,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
+import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.onap.dcaegen2.services.pmmapper.model.Event;
import org.onap.dcaegen2.services.pmmapper.model.EventMetadata;
@@ -95,6 +96,6 @@ class MeasSplitterTest { Event testEvent = EventUtils.makeMockEvent(EventUtils.fileContentsToString(testEventPath), metadata);
return Arguments.of(numberOfEvents, measInfoIds, testEvent);
};
- return EventUtils.generateEventArguments(Paths.get(baseDir), "nr", splitterCreator);
+ return EventUtils.generateEventArguments(Paths.get(baseDir), splitterCreator);
}
}
diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidatorTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidatorTest.java index 655fc7a..56bd18d 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidatorTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/utils/XMLValidatorTest.java @@ -102,6 +102,6 @@ class XMLValidatorTest { EventUtils.fileContentsToString(testEventPath), metadata, new HashMap<>(), ""); return Arguments.of(valid, testEvent); }; - return EventUtils.generateEventArguments(dataDirectory, "nr", creator); + return EventUtils.generateEventArguments(dataDirectory, creator); } } diff --git a/src/test/java/utils/EventUtils.java b/src/test/java/utils/EventUtils.java index ffa02b0..934c191 100644 --- a/src/test/java/utils/EventUtils.java +++ b/src/test/java/utils/EventUtils.java @@ -26,6 +26,8 @@ import static org.mockito.Mockito.mock; import com.google.gson.Gson; import io.undertow.server.HttpServerExchange; + +import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -43,6 +45,8 @@ import org.onap.dcaegen2.services.pmmapper.utils.MeasConverter; public class EventUtils { + private static final String LTE_QUALIFIER = File.separator + "lte"; + private static final String NR_QUALIFIER = File.separator + "nr"; /** * Reads contents of files inside the eventBodyDirectory, combines contents with metadata to make an Event Object. @@ -59,18 +63,18 @@ public class EventUtils { .map(contents -> EventUtils.makeMockEvent(contents, eventMetadata)) .collect(Collectors.toList()); } + /** * Create a List of Arguments containing an Event (Defaults to LTE events), and an expected outcome. * Fails test in the event of failure to read a file. * @param baseDirectory Directory containing multiple formats of events separated by a directory. - * @param nrQualifier String representing a unique part of the path that will exist only in the NR path. * @param argCreator Callback to method that will generate the appropriate set of arguments for each test. */ - public static List<Arguments> generateEventArguments(Path baseDirectory, String nrQualifier, ArgumentCreator argCreator ) { + public static List<Arguments> generateEventArguments(Path baseDirectory, ArgumentCreator argCreator ) { List<Arguments> events = new ArrayList<>(); try (Stream<Path> paths = Files.list(baseDirectory)) { paths.filter(Files::isDirectory).forEach(path -> { - String fileFormatType = path.toString().contains(nrQualifier) ? MeasConverter.NR_FILE_TYPE : MeasConverter.LTE_FILE_TYPE; + String fileFormatType = readFileFormatFromPath(path.toString()); EventMetadata eventMetadata = new EventMetadata(); eventMetadata.setFileFormatType(fileFormatType); events.addAll(getEventsArgument(path, eventMetadata, argCreator)); @@ -81,6 +85,18 @@ public class EventUtils { return events; } + private static String readFileFormatFromPath(String path) { + if (path.contains(NR_QUALIFIER)) { + return MeasConverter.NR_FILE_TYPE; + } + else if (path.contains(LTE_QUALIFIER)) { + return MeasConverter.LTE_FILE_TYPE; + } + else { + return MeasConverter.NOT_SUPPORTED_TYPE; + } + } + /** * reads contents of file into a string. * fails a tests in the event failure occurs. diff --git a/src/test/resources/filter_test/nr/meas_results/expected.xml b/src/test/resources/filter_test/nr/meas_results/expected.xml index 834b54a..73b371d 100644 --- a/src/test/resources/filter_test/nr/meas_results/expected.xml +++ b/src/test/resources/filter_test/nr/meas_results/expected.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity localDn="Dublin" swVersion="r0.1"/> + <measEntity localDn="Dublin" swVersion="r0.1"/> <measInfo measInfoId="some measInfoId"> <job jobId="jobId"/> <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/> @@ -17,6 +17,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_results/test.xml b/src/test/resources/filter_test/nr/meas_results/test.xml index 0b84ff6..606fab2 100644 --- a/src/test/resources/filter_test/nr/meas_results/test.xml +++ b/src/test/resources/filter_test/nr/meas_results/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" fileFormatVersion="32.435 V10.0"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="jobId"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -19,6 +19,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/filter_test/nr/meas_results_manyinfo/expected.xml b/src/test/resources/filter_test/nr/meas_results_manyinfo/expected.xml index 1f9cfbf..23007d6 100644 --- a/src/test/resources/filter_test/nr/meas_results_manyinfo/expected.xml +++ b/src/test/resources/filter_test/nr/meas_results_manyinfo/expected.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity localDn="Dublin" swVersion="r0.1"/> + <measEntity localDn="Dublin" swVersion="r0.1"/> <measInfo measInfoId="some measInfoId"> <job jobId="jobId"/> <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/> @@ -27,6 +27,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_results_manyinfo/test.xml b/src/test/resources/filter_test/nr/meas_results_manyinfo/test.xml index 217d339..e5efbee 100644 --- a/src/test/resources/filter_test/nr/meas_results_manyinfo/test.xml +++ b/src/test/resources/filter_test/nr/meas_results_manyinfo/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" fileFormatVersion="32.435 V10.0"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="this will be filtered out"> <job jobId="jobId"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -39,6 +39,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/filter_test/nr/meas_type_and_r/expected.xml b/src/test/resources/filter_test/nr/meas_type_and_r/expected.xml index 74090c6..cc3f22d 100644 --- a/src/test/resources/filter_test/nr/meas_type_and_r/expected.xml +++ b/src/test/resources/filter_test/nr/meas_type_and_r/expected.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData">
+<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData">
<fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
<fileSender senderName="Dublin"/>
- <MeasData beginTime="2018-10-02T12:00:00+01:00"/>
+ <measData beginTime="2018-10-02T12:00:00+01:00"/>
</fileHeader>
<measData>
- <measuredEntity localDn="Dublin" swVersion="r0.1"/>
+ <measEntity localDn="Dublin" swVersion="r0.1"/>
<measInfo measInfoId="some measInfoId">
<job jobId="jobId"/>
<granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
@@ -19,6 +19,6 @@ </measInfo>
</measData>
<fileFooter>
- <MeasData endTime="2018-10-02T12:15:00+01:00"/>
+ <measData endTime="2018-10-02T12:15:00+01:00"/>
</fileFooter>
-</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_type_and_r/test.xml b/src/test/resources/filter_test/nr/meas_type_and_r/test.xml index e55d303..4e032e3 100644 --- a/src/test/resources/filter_test/nr/meas_type_and_r/test.xml +++ b/src/test/resources/filter_test/nr/meas_type_and_r/test.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData">
+<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData">
<fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
<fileSender senderName="Dublin"/>
- <MeasData beginTime="2018-10-02T12:00:00+01:00"/>
+ <measData beginTime="2018-10-02T12:00:00+01:00"/>
</fileHeader>
<measData>
- <measuredEntity localDn="Dublin" swVersion="r0.1"/>
+ <measEntity localDn="Dublin" swVersion="r0.1"/>
<measInfo measInfoId="some measInfoId">
<job jobId="jobId"/>
<granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
@@ -21,6 +21,6 @@ </measInfo>
</measData>
<fileFooter>
- <MeasData endTime="2018-10-02T12:15:00+01:00"/>
+ <measData endTime="2018-10-02T12:15:00+01:00"/>
</fileFooter>
-</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/expected.xml b/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/expected.xml index afc8e6f..e844dd0 100644 --- a/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/expected.xml +++ b/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/expected.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData">
+<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData">
<fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
<fileSender senderName="Dublin"/>
- <MeasData beginTime="2018-10-02T12:00:00+01:00"/>
+ <measData beginTime="2018-10-02T12:00:00+01:00"/>
</fileHeader>
<measData>
- <measuredEntity localDn="Dublin" swVersion="r0.1"/>
+ <measEntity localDn="Dublin" swVersion="r0.1"/>
<measInfo measInfoId="some measInfoId">
<job jobId="jobId"/>
<granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
@@ -25,6 +25,6 @@ </measInfo>
</measData>
<fileFooter>
- <MeasData endTime="2018-10-02T12:15:00+01:00"/>
+ <measData endTime="2018-10-02T12:15:00+01:00"/>
</fileFooter>
-</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/test.xml b/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/test.xml index f268ca2..127ed70 100644 --- a/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/test.xml +++ b/src/test/resources/filter_test/nr/meas_type_and_r_many_measvalue/test.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData">
+<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData">
<fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
<fileSender senderName="Dublin"/>
- <MeasData beginTime="2018-10-02T12:00:00+01:00"/>
+ <measData beginTime="2018-10-02T12:00:00+01:00"/>
</fileHeader>
<measData>
- <measuredEntity localDn="Dublin" swVersion="r0.1"/>
+ <measEntity localDn="Dublin" swVersion="r0.1"/>
<measInfo measInfoId="some measInfoId">
<job jobId="jobId"/>
<granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
@@ -31,6 +31,6 @@ </measInfo>
</measData>
<fileFooter>
- <MeasData endTime="2018-10-02T12:15:00+01:00"/>
+ <measData endTime="2018-10-02T12:15:00+01:00"/>
</fileFooter>
-</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/expected.xml b/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/expected.xml index 03c42ab..b5f9982 100644 --- a/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/expected.xml +++ b/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/expected.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData">
+<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData">
<fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
<fileSender senderName="Dublin"/>
- <MeasData beginTime="2018-10-02T12:00:00+01:00"/>
+ <measData beginTime="2018-10-02T12:00:00+01:00"/>
</fileHeader>
<measData>
- <measuredEntity localDn="Dublin" swVersion="r0.1"/>
+ <measEntity localDn="Dublin" swVersion="r0.1"/>
<measInfo measInfoId="some measInfoId">
<job jobId="jobId"/>
<granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
@@ -31,6 +31,6 @@ </measInfo>
</measData>
<fileFooter>
- <MeasData endTime="2018-10-02T12:15:00+01:00"/>
+ <measData endTime="2018-10-02T12:15:00+01:00"/>
</fileFooter>
-</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/test.xml b/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/test.xml index beda93f..2137c65 100644 --- a/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/test.xml +++ b/src/test/resources/filter_test/nr/meas_type_and_r_manyinfo/test.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData">
+<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData">
<fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
<fileSender senderName="Dublin"/>
- <MeasData beginTime="2018-10-02T12:00:00+01:00"/>
+ <measData beginTime="2018-10-02T12:00:00+01:00"/>
</fileHeader>
<measData>
- <measuredEntity localDn="Dublin" swVersion="r0.1"/>
+ <measEntity localDn="Dublin" swVersion="r0.1"/>
<measInfo measInfoId="some measInfoId">
<job jobId="jobId"/>
<granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
@@ -49,6 +49,6 @@ </measInfo>
</measData>
<fileFooter>
- <MeasData endTime="2018-10-02T12:15:00+01:00"/>
+ <measData endTime="2018-10-02T12:15:00+01:00"/>
</fileFooter>
-</MeasDataFile>
\ No newline at end of file +</measDataFile>
\ No newline at end of file diff --git a/src/test/resources/mapper_test/CommonEventFormat_30.1-ONAP.json b/src/test/resources/mapper_test/CommonEventFormat_30.1-ONAP.json index 354fa68..dc39acc 100644 --- a/src/test/resources/mapper_test/CommonEventFormat_30.1-ONAP.json +++ b/src/test/resources/mapper_test/CommonEventFormat_30.1-ONAP.json @@ -1405,7 +1405,7 @@ "type": "object", "properties": { "formatVersion": { - "description": "3gpp PM reporting file format version from pre-standard TS 28.550 v2.0.0", + "description": "3gpp PM reporting file format version from pre-standard TS 28.532 v2.0.0", "type": "string" }, "granularityPeriod": { @@ -1423,15 +1423,15 @@ "items": { "type": "string" } }, "measuredEntityDn": { - "description": "distinguished name per 3GPP TS 28.550", + "description": "distinguished name per 3GPP TS 28.532", "type": "string" }, "measuredEntitySoftwareVersion": { - "description": "software version for the NF providing the PM data as specified in 3GPP TS 28.550", + "description": "software version for the NF providing the PM data as specified in 3GPP TS 28.532", "type": "string" }, "measuredEntityUserName": { - "description": "user definable name for the measured object per 3GPP TS 28.550", + "description": "user definable name for the measured object per 3GPP TS 28.532", "type": "string" } }, @@ -2178,7 +2178,7 @@ "required": [ "otherFieldsVersion" ] }, "perf3gppFields": { - "description": "fields for 3GPP PM format events, based on 3GPP TS 28.550, belonging to the 'perf3gpp' domain of the commonEventHeader domain enumeration", + "description": "fields for 3GPP PM format events, based on 3GPP TS 28.532, belonging to the 'perf3gpp' domain of the commonEventHeader domain enumeration", "type": "object", "properties": { "eventAddlFields": {"$ref": "#/definitions/hashMap"}, diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r/metadata.json b/src/test/resources/mapper_test/mapping_data/28.532/meas_results/metadata.json index 3456b7c..3d163e8 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r/metadata.json +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_results/metadata.json @@ -7,6 +7,6 @@ "timeZoneOffset": "UTC+05.00", "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", + "fileFormatType": "org.3GPP.28.532#measData", "fileFormatVersion": "V9" }
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_results/test.xml b/src/test/resources/mapper_test/mapping_data/28.532/meas_results/test.xml index 29747dc..d78c3ba 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_results/test.xml +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_results/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" - fileFormatVersion="28.550 V1"> + fileFormatVersion="28.532 V1"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="jobId"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -19,6 +19,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r_many_meas_values/metadata.json b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r/metadata.json index 3456b7c..3d163e8 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r_many_meas_values/metadata.json +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r/metadata.json @@ -7,6 +7,6 @@ "timeZoneOffset": "UTC+05.00", "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", + "fileFormatType": "org.3GPP.28.532#measData", "fileFormatVersion": "V9" }
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r/test.xml b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r/test.xml index 1757f4a..42254bc 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r/test.xml +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" - fileFormatVersion="28.550 V1"> + fileFormatVersion="28.532 V1"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="some Job Id"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -23,6 +23,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_results/metadata.json b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r_many_meas_values/metadata.json index 3456b7c..3d163e8 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_results/metadata.json +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r_many_meas_values/metadata.json @@ -7,6 +7,6 @@ "timeZoneOffset": "UTC+05.00", "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", + "fileFormatType": "org.3GPP.28.532#measData", "fileFormatVersion": "V9" }
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r_many_meas_values/test.xml b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r_many_meas_values/test.xml index 3a0c608..893637c 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_type_and_r_many_meas_values/test.xml +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_type_and_r_many_meas_values/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" - fileFormatVersion="28.550 V1"> + fileFormatVersion="28.532 V1"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="some Job Id"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -29,6 +29,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_types_and_meas_results_many_meas_values/metadata.json b/src/test/resources/mapper_test/mapping_data/28.532/meas_types_and_meas_results_many_meas_values/metadata.json index 3456b7c..3d163e8 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_types_and_meas_results_many_meas_values/metadata.json +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_types_and_meas_results_many_meas_values/metadata.json @@ -7,6 +7,6 @@ "timeZoneOffset": "UTC+05.00", "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", + "fileFormatType": "org.3GPP.28.532#measData", "fileFormatVersion": "V9" }
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.550/meas_types_and_meas_results_many_meas_values/test.xml b/src/test/resources/mapper_test/mapping_data/28.532/meas_types_and_meas_results_many_meas_values/test.xml index 23f9429..3610f56 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/meas_types_and_meas_results_many_meas_values/test.xml +++ b/src/test/resources/mapper_test/mapping_data/28.532/meas_types_and_meas_results_many_meas_values/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" - fileFormatVersion="28.550 V1"> + fileFormatVersion="28.532 V1"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="jobId"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -23,6 +23,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.532/no_measdata/metadata.json b/src/test/resources/mapper_test/mapping_data/28.532/no_measdata/metadata.json new file mode 100644 index 0000000..3d163e8 --- /dev/null +++ b/src/test/resources/mapper_test/mapping_data/28.532/no_measdata/metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "NrRadio", + "vendorName": "Ericsson", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.28.532#measData", + "fileFormatVersion": "V9" +}
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.532/no_measdata/test.xml b/src/test/resources/mapper_test/mapping_data/28.532/no_measdata/test.xml new file mode 100644 index 0000000..de1d952 --- /dev/null +++ b/src/test/resources/mapper_test/mapping_data/28.532/no_measdata/test.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> + <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" + fileFormatVersion="28.532 V1"> + <fileSender senderName="Dublin"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> + </fileHeader> + <fileFooter> + <measData endTime="2018-10-02T12:15:00+01:00"/> + </fileFooter> +</measDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.532/no_sw_version/metadata.json b/src/test/resources/mapper_test/mapping_data/28.532/no_sw_version/metadata.json new file mode 100644 index 0000000..3d163e8 --- /dev/null +++ b/src/test/resources/mapper_test/mapping_data/28.532/no_sw_version/metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "NrRadio", + "vendorName": "Ericsson", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.28.532#measData", + "fileFormatVersion": "V9" +}
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.550/no_sw_version/test.xml b/src/test/resources/mapper_test/mapping_data/28.532/no_sw_version/test.xml index 92fd1ff..5ab3796 100644 --- a/src/test/resources/mapper_test/mapping_data/28.550/no_sw_version/test.xml +++ b/src/test/resources/mapper_test/mapping_data/28.532/no_sw_version/test.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" - fileFormatVersion="28.550 V1"> + fileFormatVersion="28.532 V1"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity localDn="Dublin"/> + <measEntity localDn="Dublin"/> <measInfo measInfoId="some measInfoId"> <job jobId="some Job Id"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -23,6 +23,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.550/no_measdata/metadata.json b/src/test/resources/mapper_test/mapping_data/28.550/no_measdata/metadata.json deleted file mode 100644 index 3456b7c..0000000 --- a/src/test/resources/mapper_test/mapping_data/28.550/no_measdata/metadata.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "productName": "NrRadio", - "vendorName": "Ericsson", - "lastEpochMicrosec": "1538478000000", - "sourceName": "oteNB5309", - "startEpochMicrosec": "1538478900000", - "timeZoneOffset": "UTC+05.00", - "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", - "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", - "fileFormatVersion": "V9" -}
\ No newline at end of file diff --git a/src/test/resources/mapper_test/mapping_data/28.550/no_measdata/test.xml b/src/test/resources/mapper_test/mapping_data/28.550/no_measdata/test.xml deleted file mode 100644 index 30bb82b..0000000 --- a/src/test/resources/mapper_test/mapping_data/28.550/no_measdata/test.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> - <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" - fileFormatVersion="28.550 V1"> - <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> - </fileHeader> - <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> - </fileFooter> -</MeasDataFile> diff --git a/src/test/resources/mapper_test/mapping_data/28.550/no_sw_version/metadata.json b/src/test/resources/mapper_test/mapping_data/28.550/no_sw_version/metadata.json deleted file mode 100644 index 3456b7c..0000000 --- a/src/test/resources/mapper_test/mapping_data/28.550/no_sw_version/metadata.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "productName": "NrRadio", - "vendorName": "Ericsson", - "lastEpochMicrosec": "1538478000000", - "sourceName": "oteNB5309", - "startEpochMicrosec": "1538478900000", - "timeZoneOffset": "UTC+05.00", - "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", - "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", - "fileFormatVersion": "V9" -}
\ No newline at end of file diff --git a/src/test/resources/metadata/valid_5g_metadata.json b/src/test/resources/metadata/valid_5g_metadata.json index 3456b7c..3d163e8 100644 --- a/src/test/resources/metadata/valid_5g_metadata.json +++ b/src/test/resources/metadata/valid_5g_metadata.json @@ -7,6 +7,6 @@ "timeZoneOffset": "UTC+05.00", "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", "compression": "gzip", - "fileFormatType": "org.3GPP.28.550#measData", + "fileFormatType": "org.3GPP.28.532#measData", "fileFormatVersion": "V9" }
\ No newline at end of file diff --git a/src/test/resources/split_test/nr/type_a_1_event/test.xml b/src/test/resources/split_test/nr/type_a_1_event/test.xml index f88e0c5..f55c67d 100644 --- a/src/test/resources/split_test/nr/type_a_1_event/test.xml +++ b/src/test/resources/split_test/nr/type_a_1_event/test.xml @@ -1,11 +1,11 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" fileFormatVersion="32.435 V10.0"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="Singular measInfoId"> <job jobId="jobId"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -18,6 +18,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/split_test/nr/type_c_3_events/test.xml b/src/test/resources/split_test/nr/type_c_3_events/test.xml index ccbb09b..e8b9c43 100644 --- a/src/test/resources/split_test/nr/type_c_3_events/test.xml +++ b/src/test/resources/split_test/nr/type_c_3_events/test.xml @@ -1,11 +1,11 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" fileFormatVersion="32.435 V10.0"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin1"/> + <measEntity swVersion="r0.1" localDn="Dublin1"/> <measInfo measInfoId="First measInfoId"> <job jobId="jobId1"/> <granPeriod endTime="2001-10-02T12:15:00Z" duration="PT100S"/> @@ -18,7 +18,7 @@ </measInfo> </measData> <measData> - <measuredEntity swVersion="r0.2" localDn="Dublin2"/> + <measEntity swVersion="r0.2" localDn="Dublin2"/> <measInfo measInfoId="Second measInfoId"> <job jobId="jobId"/> <granPeriod endTime="2002-10-02T12:15:00Z" duration="PT200S"/> @@ -31,7 +31,7 @@ </measInfo> </measData> <measData> - <measuredEntity swVersion="r0.3" localDn="Dublin3"/> + <measEntity swVersion="r0.3" localDn="Dublin3"/> <measInfo measInfoId="Third measInfoId"> <job jobId="jobId"/> <granPeriod endTime="2003-10-02T12:15:00Z" duration="PT300S"/> @@ -44,6 +44,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/xml_validator_test/test_data/not_supported_type/no_file_header/test.xml b/src/test/resources/xml_validator_test/test_data/not_supported_type/no_file_header/test.xml new file mode 100644 index 0000000..b5f85de --- /dev/null +++ b/src/test/resources/xml_validator_test/test_data/not_supported_type/no_file_header/test.xml @@ -0,0 +1,22 @@ +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"> + <measData> + <measEntity swVersion="r0.1" localDn="Dublin"/> + <measInfo measInfoId="some meas info id"> + <job jobId="some jobId"/> + <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> + <repPeriod duration="PT900S"/> + <measType p="1">a</measType> + <measType p="2">b</measType> + <measType p="3">c</measType> + <measValue measObjLdn="some measObjLdn"> + <r p="1">86</r> + <r p="2">67</r> + <r p="3">14</r> + <suspect>false</suspect> + </measValue> + </measInfo> + </measData> + <fileFooter> + <measData endTime="2018-10-02T12:15:00+01:00"/> + </fileFooter> +</measDataFile> diff --git a/src/test/resources/xml_validator_test/test_data/not_supported_type/no_file_header/validity.props b/src/test/resources/xml_validator_test/test_data/not_supported_type/no_file_header/validity.props new file mode 100644 index 0000000..80da24e --- /dev/null +++ b/src/test/resources/xml_validator_test/test_data/not_supported_type/no_file_header/validity.props @@ -0,0 +1 @@ +valid=false
\ No newline at end of file diff --git a/src/test/resources/xml_validator_test/test_data/nr/no_file_header/test.xml b/src/test/resources/xml_validator_test/test_data/nr/no_file_header/test.xml index 3450b98..73ce2b3 100644 --- a/src/test/resources/xml_validator_test/test_data/nr/no_file_header/test.xml +++ b/src/test/resources/xml_validator_test/test_data/nr/no_file_header/test.xml @@ -1,6 +1,6 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <measData> - <measuredEntity swVersion="r0.1" localDn="Dublin"/> + <measEntity swVersion="r0.1" localDn="Dublin"/> <measInfo measInfoId="some meas info id"> <job jobId="some jobId"/> <granPeriod endTime="2018-10-02T12:15:00Z" duration="PT900S"/> @@ -17,6 +17,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/xml_validator_test/test_data/nr/no_measdata/test.xml b/src/test/resources/xml_validator_test/test_data/nr/no_measdata/test.xml index fb141ad..b8a31eb 100644 --- a/src/test/resources/xml_validator_test/test_data/nr/no_measdata/test.xml +++ b/src/test/resources/xml_validator_test/test_data/nr/no_measdata/test.xml @@ -1,10 +1,10 @@ -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" fileFormatVersion="32.435 V10.0"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> diff --git a/src/test/resources/xml_validator_test/test_data/nr/no_measured_entity/test.xml b/src/test/resources/xml_validator_test/test_data/nr/no_measured_entity/test.xml index 0d4216e..aace7dc 100644 --- a/src/test/resources/xml_validator_test/test_data/nr/no_measured_entity/test.xml +++ b/src/test/resources/xml_validator_test/test_data/nr/no_measured_entity/test.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<MeasDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData"> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> <fileHeader dnPrefix="some dnPrefix" vendorName="FooBar Ltd" fileFormatVersion="32.435 V10.0"> <fileSender senderName="Dublin"/> - <MeasData beginTime="2018-10-02T12:00:00+01:00"/> + <measData beginTime="2018-10-02T12:00:00+01:00"/> </fileHeader> <measData> <measInfo measInfoId="some measInfoId"> @@ -22,6 +22,6 @@ </measInfo> </measData> <fileFooter> - <MeasData endTime="2018-10-02T12:15:00+01:00"/> + <measData endTime="2018-10-02T12:15:00+01:00"/> </fileFooter> -</MeasDataFile> +</measDataFile> |