OTX Reference  
OpenTestSystem.Otx.Extensions.DataType.DataTypes.ResourceLocation Class Reference

ResourceLocation is an otx:SimpleType. More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.DataType.DataTypes.ResourceLocation:
Inheritance graph

Public Attributes

ResourceLocationLiteral init
 Cardinality [0..1]
This optional element represents the hard-coded value from which the declared resource shall be created.It includes an Id which uniquely identifies the resource and an optional default path which is used, if no path was mapped and an optional descrption of the resource type. More...
 
StringLiteral mediaType
 Cardinality [0..1]
Classifies the content of a resource using a media type. A media type indicates the nature and format of a document, file, or assortment of bytes. More...
 

Detailed Description

ResourceLocation is an otx:SimpleType.

In some use cases, an OTX sequence needs to address certain resources, e.g. XML files, text documents, pictures etc. If this is the case, each resource have to be addressable by a location. The location itself will not be part of the test logic, because it can be different in different runtime environments. A ResourceLocation represents a string value which addresses a location of a resource associated with an ID.At runtime it can be mapped via an appropriate mapping mechanism to a real address. If the related resource ID cannot be mapped, because a possible mapping table does not contain the ID or the runtime does not support a mapping mechanism, the location is the default location.If no default location is specified, the location is an empty string.

Note
IMPORTANT - The mapping mechanism is not part of this document.
IMPORTANT - ResourceLocation values may occur as operands of comparisons (see ISO 13209-2:2022, 7.15.8). For this case, the result shall be determined by comparing the ID Strings of the ResourceLocations.The mediaType and the defaultLocation shall not influence the comparison result.
IMPORTANT - When applied to a ResourceLocation, the otx:ToString term will return the location of the ResourceLocation.
Checker rules
CheckerRule.DataType_Chk005 - ResourceLocationLiteral media type matches ResourceLocation declaration media type

Literal
The syntax for Literals for complex data types will be used, where the member value is one of the values in the list.

@ResourceLocation("ID_1","file:///D:/file_sample.txt", "text/xml")

Sample

DataType.ResourceLocation ResourceLocation1 = @ResourceLocation("ID_1","file:///D:/file_sample.txt", "text/xml");

Member Data Documentation

◆ init

ResourceLocationLiteral OpenTestSystem.Otx.Extensions.DataType.DataTypes.ResourceLocation.init

Cardinality [0..1]
This optional element represents the hard-coded value from which the declared resource shall be created.It includes an Id which uniquely identifies the resource and an optional default path which is used, if no path was mapped and an optional descrption of the resource type.

Note
IMPORTANT - If the ResourceLocation declaration is not explicitly initialised (omitted <init> element), the default path shall be an empty string.

◆ mediaType

StringLiteral OpenTestSystem.Otx.Extensions.DataType.DataTypes.ResourceLocation.mediaType

Cardinality [0..1]
Classifies the content of a resource using a media type. A media type indicates the nature and format of a document, file, or assortment of bytes.

Note
IMPORTANT — The media type classifies the content of a resource location only. Whether or how the type is used is not part of this document.