diff --git a/plugins/org.etsi.mts.tdl.tx.ui/templates/HttpJavaMappings.tdltx b/plugins/org.etsi.mts.tdl.tx.ui/templates/HttpJavaMappings.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..01512a7b66716533df28e675444570846f6cc99d --- /dev/null +++ b/plugins/org.etsi.mts.tdl.tx.ui/templates/HttpJavaMappings.tdltx @@ -0,0 +1,59 @@ +@Version: "1.0.0" +Package HttpJavaMappings { + Import all from TDL + Import all from Java + Import all from HTTP.MessageBased + + @[JavaPackage, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.adapters.http" as HttpAdapter + + @JavaClass + Map Request to "HttpRequestData" in HttpAdapter as Request_Mapping { + uri -> "uri", + method -> "method", + headers -> "headers", + parameters -> "parameters", + body -> "body" + } + @JavaClass + Map Response to "HttpResponseData" in HttpAdapter as Response_Mapping { + status -> "status", + statusMessage -> "statusMessage", + headers -> "headers", + body -> "body" + } + @JavaClass + Map Header to "HttpHeader" in HttpAdapter as Header_Mapping { + ^name -> "name", + ^value -> "value" + } + @JavaClass + Map Parameter to "HttpRequestParameter" in HttpAdapter as Parameter_Mapping { + location -> "location", + ^name -> "name", + ^value -> "value" + } + @JavaClass + Map Location to "HttpParameterLocation" in HttpAdapter as Location_Mapping + + @[JavaClass, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.adapters.http.HttpParameterLocation" as HttpParameterLocation + Map path to "path" in HttpParameterLocation as path_mapping + Map query to "query" in HttpParameterLocation as query_mapping + Map cookie to "cookie" in HttpParameterLocation as cookie_mapping + + + @JavaClass + Map Method to "HttpMethod" in HttpAdapter as Method_Mapping + + @[JavaClass, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.adapters.http.HttpMethod" as HttpMethod + Map GET to "GET" in HttpMethod as GET_mapping + Map POST to "POST" in HttpMethod as POST_mapping + Map PUT to "PUT" in HttpMethod as PUT_mapping + Map PATCH to "PATCH" in HttpMethod as PATCH_mapping + Map DELETE to "DELETE" in HttpMethod as DELETE_mapping +} diff --git a/plugins/org.etsi.mts.tdl.tx.ui/templates/Java.tdltx b/plugins/org.etsi.mts.tdl.tx.ui/templates/Java.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..929f7967484be4d4f53538e3a8b1fc9580c51419 --- /dev/null +++ b/plugins/org.etsi.mts.tdl.tx.ui/templates/Java.tdltx @@ -0,0 +1,59 @@ +@Version: "1.0.0" +Package Java { + Import all from TDL + + /* Applied to a DataResourceMapping to specify a package */ + Annotation JavaPackage + /* Applied to a DataElementMapping to specify an instance method */ + Annotation JavaMethod + /* Applied to a DataElementMapping to specify an class method */ + Annotation JavaStaticMethod + /* Applied to a DataResourceMapping or DataElementMapping to specify a class */ + Annotation JavaClass + /* Applied to a DataElementMapping to specify a field (of a class) */ + Annotation JavaField + /* Applied to a DataElementMapping to specify a static field (of a class) */ + Annotation JavaStaticField + /* Applied to a ParameterMapping to specify an instance method that returns the value of a field */ + Annotation JavaGetter + /* Applied to a ParameterMapping to specify an instance method that sets the field value */ + Annotation JavaSetter + + + @[ + JavaPackage, + MappingName : "Java" + ] + Use "java.lang" as JavaLang + Map Boolean to "Boolean" in JavaLang as Boolean_mapping + Map Integer to "Integer" in JavaLang as Integer_mapping + Map String to "String" in JavaLang as String_mapping + + + + @[JavaPackage, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.tri" as Tri + + @JavaClass + Map Verdict to "Verdict" in Tri as Verdict_Mapping + + @[JavaClass, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.tri.Verdict" as VerdictClass + Map pass to "pass" in VerdictClass as pass_mapping + Map fail to "fail" in VerdictClass as fail_mapping + Map inconclusive to "inconclusive" in VerdictClass as inconclusive_mapping + + + @[JavaPackage, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.rt.core" as RuntimeCore + + @[JavaClass, + MappingName : "Java"] + Use "org.etsi.mts.tdl.execution.java.rt.core.TimeUnit" as TimeUnitClass + Map second to "Second" in TimeUnitClass as second_mapping + + +} \ No newline at end of file diff --git a/plugins/org.etsi.mts.tdl.tx.ui/templates/TdlRuntime.tdltx b/plugins/org.etsi.mts.tdl.tx.ui/templates/TdlRuntime.tdltx new file mode 100644 index 0000000000000000000000000000000000000000..4b0da7db3ac72adab8663191417ef0fdcf7c1fab --- /dev/null +++ b/plugins/org.etsi.mts.tdl.tx.ui/templates/TdlRuntime.tdltx @@ -0,0 +1,5 @@ +@Version: "1.0.0" +Package TdlRuntime { + Import all from TDL + Annotation Language +} \ No newline at end of file