diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/asn1/Rocket.asn b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/Rocket.asn new file mode 100644 index 0000000000000000000000000000000000000000..63f300f4725cdef906ea136b7a10691c8b7b23b1 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/Rocket.asn @@ -0,0 +1,17 @@ +--<ASN1.HugeInteger World-Schema.Rocket.range>-- +World-Schema DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + Rocket ::= SEQUENCE + { + range INTEGER, -- huge (see a special directive above) + name UTF8String (SIZE(1..16)), + message UTF8String DEFAULT "Hello World" , + fuel ENUMERATED {solid, liquid, gas}, + speed CHOICE + { + mph INTEGER, + kmph INTEGER + } OPTIONAL, + payload SEQUENCE OF UTF8String + } +END diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/asn1/Rocket.asn-generated.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/Rocket.asn-generated.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..0be46c91653e77407a4d361bd82ba15af2c070a9 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/Rocket.asn-generated.tdltx @@ -0,0 +1,28 @@ +Package generated_from_Rocket_asn { + Type String + Type TODO_RESOLVE_REFERENCED + Use "\"Rocket.asn\"" as SOURCE_MAPPING + Structure Rocket ( + Integer range, + UTF8String ^name, + UTF8String message, + Rocket___fuel fuel, + optional Rocket___speed speed, + Rocket___payload payload + ) + Type Integer + Type UTF8String + Structure AsnEnum ( ) + Structure Rocket___speed { union } ( + Integer mph, + Integer kmph + ) + Constraint union + Collection Rocket___payload of UTF8String + Enumerated Rocket___fuel { + Rocket___fuel solid, + Rocket___fuel liquid, + Rocket___fuel gas + } + Map Rocket to "\"Rocket\"" in SOURCE_MAPPING as Rocket_MAPPING + Package generated_from_World_Schema } \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-library.asn b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-library.asn new file mode 100644 index 0000000000000000000000000000000000000000..d559807721035e8b7bd2c6eb8bb4083ad2d28af7 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-library.asn @@ -0,0 +1,21 @@ +LibraryASN1module DEFINITIONS ::= +BEGIN + Library ::= SEQUENCE { + address UTF8String DEFAULT "Sophia-Antipolis, France", + documents SEQUENCE OF Document + } + + Document ::= SEQUENCE { + title UTF8String (SIZE(1..128)), + status ENUMERATED {draft, published, historical}, + authors SEQUENCE OF UTF8String, + number CHOICE { + es INTEGER, + eg INTEGER, + tr INTEGER + } OPTIONAL, + updated DATE + } + + +END \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-library.asn-generated.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-library.asn-generated.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..845944becfb64c063dbef3f9b09b55f228f09967 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-library.asn-generated.tdltx @@ -0,0 +1,35 @@ +Package generated_from_example_1_library_asn { + Type String + Type TODO_RESOLVE_REFERENCED + Use "\"example-1-library.asn\"" as SOURCE_MAPPING + Structure Library ( + UTF8String address, + Library___documents documents + ) + Structure Document ( + UTF8String title, + Document___status status, + Document___authors authors, + optional Document___number number, + Date updated + ) + Type UTF8String + Collection Library___documents of Document + Structure AsnEnum ( ) + Collection Document___authors of UTF8String + Structure Document___number { union } ( + Integer es, + Integer eg, + Integer tr + ) + Constraint union + Type Integer + Type Date + Enumerated Document___status { + Document___status draft, + Document___status published, + Document___status historical + } + Map Library to "\"Library\"" in SOURCE_MAPPING as Library_MAPPING + Map Document to "\"Document\"" in SOURCE_MAPPING as Document_MAPPING + Package generated_from_LibraryASN1module } \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-ssp.asn b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-ssp.asn new file mode 100644 index 0000000000000000000000000000000000000000..b5c1fd30b759129cf900e5fa2ab551084ef12913 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-ssp.asn @@ -0,0 +1,37 @@ +SSPASN1module DEFINITIONS ::= +BEGIN + NodeDescriptor ::= SEQUENCE + { + aNodeName NodeName, -- Node name + aShortName UUID, -- Short node name + aNode CHOICE + { + aLink SEQUENCE + { + aLinkedFileIdentity NodeIdentity, -- Identity of the linked SSP file + aLinkedFileSize FileSize -- Size of the linked SSP file + }, + aFile SEQUENCE + { + aFileSize FileSize -- Size of the SSP file + }, + aDirectory SEQUENCE + { + } + }, + aMetaData SEQUENCE OF MetaDatum OPTIONAL, -- Optional meta data + aACL SET OF AccessControl OPTIONAL -- Access Control List attribute + } + + /* Node identity */ + NodeName ::= UTF8String (SIZE(1..16)) -- node name encoded in UTF-8 + NodeReference ::= SEQUENCE (SIZE(1..6)) OF NodeName -- pathname and node name + + NodeIdentity ::= CHOICE + { + aShortName UUID, -- UUID of file reference using absolute pathname + aNodeReference NodeReference -- Node reference + } + + +END \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-ssp.asn-generated.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-ssp.asn-generated.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..f0d004d18d3ce961f88ae2619b21e516cbc3c1f2 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/asn1/example-1-ssp.asn-generated.tdltx @@ -0,0 +1,43 @@ +Package generated_from_example_1_ssp_asn { + Type String + Type TODO_RESOLVE_REFERENCED + Use "\"example-1-ssp.asn\"" as SOURCE_MAPPING + Type NodeName { UTF8String } + Constraint UTF8String + Collection NodeReference of NodeName + Structure NodeDescriptor ( + NodeName aNodeName, + UUID aShortName, + NodeDescriptor___aNode aNode, + optional NodeDescriptor___aMetaData aMetaData, + optional NodeDescriptor___aACL aACL + ) + Structure NodeIdentity { union } ( + UUID aShortName, + NodeReference aNodeReference + ) + Structure UUID ( ) + Structure NodeDescriptor___aNode { union } ( + NodeDescriptor___aNode___aLink aLink, + NodeDescriptor___aNode___aFile aFile, + NodeDescriptor___aNode___aDirectory aDirectory + ) + Constraint union + Structure NodeDescriptor___aNode___aLink ( + NodeIdentity aLinkedFileIdentity, + FileSize aLinkedFileSize + ) + Structure FileSize ( ) + Structure NodeDescriptor___aNode___aFile ( + FileSize aFileSize + ) + Structure NodeDescriptor___aNode___aDirectory ( ) + Collection NodeDescriptor___aMetaData of MetaDatum + Structure MetaDatum ( ) + Collection NodeDescriptor___aACL of AccessControl + Structure AccessControl ( ) + Map NodeName to "\"NodeName\"" in SOURCE_MAPPING as NodeName_MAPPING + Map NodeReference to "\"NodeReference\"" in SOURCE_MAPPING as NodeReference_MAPPING + Map NodeDescriptor to "\"NodeDescriptor\"" in SOURCE_MAPPING as NodeDescriptor_MAPPING + Map NodeIdentity to "\"NodeIdentity\"" in SOURCE_MAPPING as NodeIdentity_MAPPING + Package generated_from_SSPASN1module } \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdlan2 b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdlan2 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..952a87974e1a3827b4a06958c2de0b1c29853e90 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx @@ -0,0 +1,11 @@ +Package ImportSample { + Import all from Sample + //example test description + Test exampleImported uses base { + terminate + tester::interface sends "hello" {string} to sut::interface + //example constraint violation + tester::interface sends r to sut::interface + //tester::interface sends f to sut::interface + } +} diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdl b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdl new file mode 100644 index 0000000000000000000000000000000000000000..debfe9f72473c8a29d08e49d43919b2be09020e7 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdl @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ASCII"?> +<tdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tdl="http://www.etsi.org/spec/TDL/1.4.1" name="ImportSample"> + <packagedElement xsi:type="tdl:TestDescription" name="exampleImported" isLocallyOrdered="true"> + <testConfiguration href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9"/> + <behaviourDescription> + <behaviour xsi:type="tdl:CompoundBehaviour"> + <block> + <behaviour xsi:type="tdl:Stop"/> + <behaviour xsi:type="tdl:Message"> + <sourceGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.1"/> + <target> + <targetGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.0"/> + </target> + <argument xsi:type="tdl:LiteralValueUse" value="hello"> + <dataType xsi:type="tdl:SimpleDataType" href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.1"/> + </argument> + </behaviour> + <behaviour xsi:type="tdl:Message"> + <sourceGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.1"/> + <target> + <targetGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.0"/> + </target> + <argument xsi:type="tdl:DataElementUse"> + <dataElement xsi:type="tdl:SimpleDataInstance" href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.5"/> + </argument> + </behaviour> + </block> + </behaviour> + </behaviourDescription> + </packagedElement> + <import> + <importedPackage href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#/"/> + </import> +</tdl:Package> diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdlan2 b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdlan2 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..b296f82bed20cf2cbc31ca104195f238507efff3 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdltx @@ -0,0 +1,8 @@ +Package ImportSample { + Import all from Sample + Test exampleImported uses base { + terminate + tester::interface sends "hello" { string } to sut::interface + tester::interface sends r to sut::interface + } +} \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdltx.tdl b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdltx.tdl new file mode 100644 index 0000000000000000000000000000000000000000..debfe9f72473c8a29d08e49d43919b2be09020e7 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/ImportSample.tdltx.tdltx.tdl @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ASCII"?> +<tdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tdl="http://www.etsi.org/spec/TDL/1.4.1" name="ImportSample"> + <packagedElement xsi:type="tdl:TestDescription" name="exampleImported" isLocallyOrdered="true"> + <testConfiguration href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9"/> + <behaviourDescription> + <behaviour xsi:type="tdl:CompoundBehaviour"> + <block> + <behaviour xsi:type="tdl:Stop"/> + <behaviour xsi:type="tdl:Message"> + <sourceGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.1"/> + <target> + <targetGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.0"/> + </target> + <argument xsi:type="tdl:LiteralValueUse" value="hello"> + <dataType xsi:type="tdl:SimpleDataType" href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.1"/> + </argument> + </behaviour> + <behaviour xsi:type="tdl:Message"> + <sourceGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.1"/> + <target> + <targetGate href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.9/@connection.0/@endPoint.0"/> + </target> + <argument xsi:type="tdl:DataElementUse"> + <dataElement xsi:type="tdl:SimpleDataInstance" href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#//@packagedElement.5"/> + </argument> + </behaviour> + </block> + </behaviour> + </behaviourDescription> + </packagedElement> + <import> + <importedPackage href="/Users/philip-iii/Dev/git/etsi-labs/ide/plugins/org.etsi.mts.tdl.standalone/examples/Sample.tdltx#/"/> + </import> +</tdl:Package> diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdlan2 b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdlan2 new file mode 100644 index 0000000000000000000000000000000000000000..0b278ffadcc30489ae84751d3340aef3727a1d2d --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdlan2 @@ -0,0 +1,22 @@ +Package Sample { + Type integer; + Type string; + Type float; + Time sec; + sec i; + float r; + string s; + Gate Type http accepts string, integer; + Component Type node having { + gate interface of type http; + } + Test Configuration base { + create SUT sut of type node ; + create Tester tester of type node ; + connect sut.interface to tester.interface ; + } + Test Description Implementation example + uses configuration base { + terminate; + } +} \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..95d4c4210c7ef968078fa96abb4a52b65a7a2fa4 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx @@ -0,0 +1,35 @@ +Package Sample { + //standard annotations for STO + //Annotation Initial conditions + //Annotation Expected behaviour + //Annotation Final conditions + //Annotation Test Purpose Description + //Annotation when + //Annotation then + //example types + Type integer + Type string + Type float + Time sec + sec i + float r + string s + //example configuration + Message Gate http accepts string, integer + Component node { + gate http interface + } + Configuration base { + node sut as SUT, + node tester as Tester, + connect sut::interface to tester::interface + } + //example test description + Test example uses base { + terminate + //wait for i on tester + //tester::interface sends "hello" {string} to sut::interface + //example constraint violation + //tester::interface sends s to sut::interface + } +} diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdl b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdl new file mode 100644 index 0000000000000000000000000000000000000000..aeb6c1e80801ececdb413d7b6269b0b3fb655442 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdl @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="ASCII"?> +<tdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tdl="http://www.etsi.org/spec/TDL/1.4.1" name="Sample"> + <packagedElement xsi:type="tdl:SimpleDataType" name="integer"/> + <packagedElement xsi:type="tdl:SimpleDataType" name="string"/> + <packagedElement xsi:type="tdl:SimpleDataType" name="float"/> + <packagedElement xsi:type="tdl:Time" name="sec"/> + <packagedElement xsi:type="tdl:SimpleDataInstance" name="i" dataType="//@packagedElement.3"/> + <packagedElement xsi:type="tdl:SimpleDataInstance" name="r" dataType="//@packagedElement.2"/> + <packagedElement xsi:type="tdl:SimpleDataInstance" name="s" dataType="//@packagedElement.1"/> + <packagedElement xsi:type="tdl:GateType" name="http" dataType="//@packagedElement.1 //@packagedElement.0"/> + <packagedElement xsi:type="tdl:ComponentType" name="node"> + <gateInstance name="interface" type="//@packagedElement.7"/> + </packagedElement> + <packagedElement xsi:type="tdl:TestConfiguration" name="base"> + <componentInstance name="sut" type="//@packagedElement.8"/> + <componentInstance name="tester" type="//@packagedElement.8" role="Tester"/> + <connection> + <endPoint component="//@packagedElement.9/@componentInstance.0" gate="//@packagedElement.8/@gateInstance.0"/> + <endPoint component="//@packagedElement.9/@componentInstance.1" gate="//@packagedElement.8/@gateInstance.0"/> + </connection> + </packagedElement> + <packagedElement xsi:type="tdl:TestDescription" name="example" testConfiguration="//@packagedElement.9" isLocallyOrdered="true"> + <behaviourDescription> + <behaviour xsi:type="tdl:CompoundBehaviour"> + <block> + <behaviour xsi:type="tdl:Stop"/> + </block> + </behaviour> + </behaviourDescription> + </packagedElement> +</tdl:Package> diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdlan2 b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdlan2 new file mode 100644 index 0000000000000000000000000000000000000000..0b278ffadcc30489ae84751d3340aef3727a1d2d --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdlan2 @@ -0,0 +1,22 @@ +Package Sample { + Type integer; + Type string; + Type float; + Time sec; + sec i; + float r; + string s; + Gate Type http accepts string, integer; + Component Type node having { + gate interface of type http; + } + Test Configuration base { + create SUT sut of type node ; + create Tester tester of type node ; + connect sut.interface to tester.interface ; + } + Test Description Implementation example + uses configuration base { + terminate; + } +} \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..f130cad428fade316a9f71cba52d02f4537c4da8 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdltx @@ -0,0 +1,21 @@ +Package Sample { + Type integer + Type string + Type float + Time sec + sec i + float r + string s + Message Gate http accepts string,integer + Component node { + gate http interface + } + Configuration base { + node sut as SUT, + node tester as Tester, + connect sut::interface to tester::interface + } + Test example uses base { + terminate + } +} \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdltx.tdl b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdltx.tdl new file mode 100644 index 0000000000000000000000000000000000000000..aeb6c1e80801ececdb413d7b6269b0b3fb655442 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/basics/Sample.tdltx.tdltx.tdl @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="ASCII"?> +<tdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tdl="http://www.etsi.org/spec/TDL/1.4.1" name="Sample"> + <packagedElement xsi:type="tdl:SimpleDataType" name="integer"/> + <packagedElement xsi:type="tdl:SimpleDataType" name="string"/> + <packagedElement xsi:type="tdl:SimpleDataType" name="float"/> + <packagedElement xsi:type="tdl:Time" name="sec"/> + <packagedElement xsi:type="tdl:SimpleDataInstance" name="i" dataType="//@packagedElement.3"/> + <packagedElement xsi:type="tdl:SimpleDataInstance" name="r" dataType="//@packagedElement.2"/> + <packagedElement xsi:type="tdl:SimpleDataInstance" name="s" dataType="//@packagedElement.1"/> + <packagedElement xsi:type="tdl:GateType" name="http" dataType="//@packagedElement.1 //@packagedElement.0"/> + <packagedElement xsi:type="tdl:ComponentType" name="node"> + <gateInstance name="interface" type="//@packagedElement.7"/> + </packagedElement> + <packagedElement xsi:type="tdl:TestConfiguration" name="base"> + <componentInstance name="sut" type="//@packagedElement.8"/> + <componentInstance name="tester" type="//@packagedElement.8" role="Tester"/> + <connection> + <endPoint component="//@packagedElement.9/@componentInstance.0" gate="//@packagedElement.8/@gateInstance.0"/> + <endPoint component="//@packagedElement.9/@componentInstance.1" gate="//@packagedElement.8/@gateInstance.0"/> + </connection> + </packagedElement> + <packagedElement xsi:type="tdl:TestDescription" name="example" testConfiguration="//@packagedElement.9" isLocallyOrdered="true"> + <behaviourDescription> + <behaviour xsi:type="tdl:CompoundBehaviour"> + <block> + <behaviour xsi:type="tdl:Stop"/> + </block> + </behaviour> + </behaviourDescription> + </packagedElement> +</tdl:Package> diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/openapi/ExampleAPI.yaml b/plugins/org.etsi.mts.tdl.standalone/examples/openapi/ExampleAPI.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fc63b19f731889e0295bb9dc2d12fe6fa65cc777 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/openapi/ExampleAPI.yaml @@ -0,0 +1,313 @@ +openapi: 3.0.3 +info: + title: 'Examples for RESTful API guide' + version: '1.0.0' +externalDocs: + # Reference to the base document + description: 'ETSI ES 203 647 ...' + url: 'https://rest.etsi.org' +paths: + # Resource path relative to server, parameters in curly braces + /resource/{id}: + # Method + get: + # Unique case-sensitive identifier + operationId: getResource + # Grouping + tags: + - Resource management + summary: 'Read a resource' + description: 'Read full contents of a resource with specific ID' + parameters: + # Parameter name used as the key in associative array of parameters + - name: 'id' + # The location of parameter: path, query, header or cookie + in: path + required: true + description: 'Resource ID' + schema: + # Primitive type + type: string + responses: + # Response code + 200: + description: The requested resource + # Custom headers + headers: + ETag: + # Reference to (reusable) header definition + $ref: '#/components/headers/ETag' + # Response body + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceData' + 401: + # Reference to (reusable) response definition + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + /resource: + # POST JSON object + post: + # Info excluded + operationId: postResource + summary: Create new resource + parameters: + # Reference to (reusable) parameter definition + - $ref: '#/components/parameters/resourceId' + # Reference to (reusable) header definition + - $ref: '#/components/parameters/Version' + requestBody: + description: 'Data for new resource' + required: true + content: + # Content media type (Content-Type header value) + application/json: + schema: + # Reference to data type + $ref: '#/components/schemas/ResourceData' + responses: + 204: + # Reference to data type + $ref: '#/components/responses/204' + '/resource/{id}/file': + # Upload a resource file + put: + # Info excluded + operationId: uploadResourceFile + summary: Upload a file for a resource + parameters: + - $ref: '#/components/parameters/resourceId' + requestBody: + description: 'An image file to be attached to the resource' + content: + multipart/form-data: + schema: + type: object + properties: + # Property name (also the name applied to content disposition) + file: + type: string + # Sets content type to application/octet-stream + format: binary + encoding: + # Applies custom encoding to "file" property + file: + # Override default content type + contentType: image/png + responses: + 204: + $ref: '#/components/responses/204' + # Example search path /search?text=rest&max=5 + '/search': + get: + summary: 'Search resource' + # Description excluded + operationId: searchResource + parameters: + - name: 'text' + in: query + required: true + description: 'Text to search for' + schema: + type: string + - name: 'max' + in: query + # Optional parameter + required: false + description: 'Maximum number of results expected' + schema: + type: number + - name: 'page' + in: query + required: false + description: '' + schema: + type: number + responses: + 200: + # TBD + description: 'The requested resource' + # Custom headers + headers: + ETag: + # Reference to (reusable) header definition + $ref: '#/components/headers/ETag' + # Response body + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResults' + '/subscription': + post: + summary: 'Subscribe to authenticated notifications' + # Description excluded + operationId: subscribeNotifications + requestBody: + content: + application/json: + schema: + # Subscription containing callbackUrl property + $ref: '#/components/schemas/Subscription' + responses: + # Subscription was created + 201: + $ref: '#/components/responses/201' + # Out-of-band notifications from server + callbacks: + # Named callback object (inline or reference) + auth: + # Local path used by server for callback(s) + '{$request.body#/callbackUrl}/incoming': + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticatedNotification' + responses: + 204: + $ref: '#/components/responses/204' + 401: + $ref: '#/components/responses/401' + + /service: + get: + # Info excluded + operationId: getService + # Support for GET request is mandatory for API provider + x-etsi-provision: mandatory + parameters: + - name: 'circuitswitching' + in: query + required: false + schema: + type: string + x-etsi-capabilities: + # Parameter only applies to "3G" capability + - 3G + responses: + 200: + description: 'The requested service' + content: + application/json: + schema: + type: object + properties: + speed: + type: string + enum: + - fast + - superfast + x-etsi-enum: + # Enum value "superfast" is optional and + # only applies to "4G" and "5G" capabilities + superfast: + required: false + x-etsi-capabilities: + - 4G + - 5G +# Optional definitions +security: [] +components: + schemas: + # Name of data type + SearchResults: + # Array type + type: array + items: + # Type of array members, reference to ResourceData + $ref: '#/components/schemas/ResourceData' + # No more than 10 results + maxItems: 10 + ResourceData: + # Structured type + type: object + properties: + # Property name + id: + # Property type + type: string + size: + type: string + enum: + # Set of allowed values + - big + - bigger + - biggerer + # Default value for non-required property + default: big + created: + # Date-time value encoded as string + type: string + format: date-time + required: + # Set of required properties + - id + Subscription: + type: object + properties: + credentials: + $ref: '#/components/schemas/Credentials' + AuthenticatedNotification: + type: object + Credentials: + type: object + properties: + user: + type: string + responses: + # Common responses with response code as identifier + 201: + description: 'Created' + 204: + description: 'No content' + 401: + description: 'Unauthenticated' + 404: + description: 'Not found' + headers: + Version: + description: 'API version' + required: true + schema: + type: string + # Definition of ETag header + ETag: + description: 'Identifier for a specific version of a resource' + schema: + type: string + parameters: + Version: + name: 'Version' + description: 'API version' + in: header + required: true + schema: + type: string + resourceId: + name: 'id' + in: path + required: true + description: 'Resource ID' + schema: + type: string + securitySchemes: {} + callbacks: {} +servers: + # Recommended structure for API paths + - url: '{apiRoot}/{apiName}/{apiMajorVersion}/' + variables: + apiRoot: + default: https://example.com + apiName: + description: Interface name from the base document + default: rest-api-guide + apiMajorVersion: + description: Major version of the API from the base document + default: v1 +tags: + # Optional descriptions of tags + - name: Resource management + description: Operations for managing resources \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.standalone/examples/openapi/ExampleAPI.yaml-generated.tdltx b/plugins/org.etsi.mts.tdl.standalone/examples/openapi/ExampleAPI.yaml-generated.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..824a3cd689a23df9f18f151717464ce88d94eb60 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.standalone/examples/openapi/ExampleAPI.yaml-generated.tdltx @@ -0,0 +1,35 @@ +Package generated_from_ExampleAPI_yaml { + Type String + Type TODO_RESOLVE_REFERENCED + Use "\"ExampleAPI.yaml\"" as SOURCE_MAPPING + Use "\"generated/java\"" as TARGET_MAPPING + Collection SearchResults of SearchResults___item + Structure SearchResults___item ( + string id, + string ^size, + string created + ) + Type string + Map SearchResults to "\"#/components/schemas/SearchResults\"" in SOURCE_MAPPING as SearchResults_SOURCE_MAPPING + Map SearchResults to "\"SearchResults\"" in TARGET_MAPPING as SearchResults_TARGET_MAPPING + Structure ResourceData ( + string id, + string ^size, + string created + ) + Map ResourceData to "\"#/components/schemas/ResourceData\"" in SOURCE_MAPPING as ResourceData_SOURCE_MAPPING + Map ResourceData to "\"ResourceData\"" in TARGET_MAPPING as ResourceData_TARGET_MAPPING + Structure Subscription ( + Credentials credentials + ) + Structure Credentials ( + string user + ) + Map Subscription to "\"#/components/schemas/Subscription\"" in SOURCE_MAPPING as Subscription_SOURCE_MAPPING + Map Subscription to "\"Subscription\"" in TARGET_MAPPING as Subscription_TARGET_MAPPING + Structure AuthenticatedNotification ( ) + Map AuthenticatedNotification to "\"#/components/schemas/AuthenticatedNotification\"" in SOURCE_MAPPING as AuthenticatedNotification_SOURCE_MAPPING + Map AuthenticatedNotification to "\"AuthenticatedNotification\"" in TARGET_MAPPING as AuthenticatedNotification_TARGET_MAPPING + Map Credentials to "\"#/components/schemas/Credentials\"" in SOURCE_MAPPING as Credentials_SOURCE_MAPPING + Map Credentials to "\"Credentials\"" in TARGET_MAPPING as Credentials_TARGET_MAPPING +} \ No newline at end of file