From 756253fbc99eab8d9c476c1f8c5612b7762c5f2f Mon Sep 17 00:00:00 2001 From: Ege Korkan Date: Fri, 7 Oct 2022 10:54:34 +0200 Subject: [PATCH 1/4] include tmoptional in assertion script --- packages/assertions/assertionTests-tm.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/assertions/assertionTests-tm.js b/packages/assertions/assertionTests-tm.js index f8c5322df..84b12a02f 100644 --- a/packages/assertions/assertionTests-tm.js +++ b/packages/assertions/assertionTests-tm.js @@ -15,10 +15,7 @@ const mergeIdenticalResults = require("./util").mergeIdenticalResults // Imports from playground core -// const checkUniqueness = require('@thing-description-playground/core').propUniqueness -// const checkMultiLangConsistency = require("@thing-description-playground/core").multiLangConsistency -// const checkSecurity = require("@thing-description-playground/core").security -// const checkLinksRelTypeCount = require("@thing-description-playground/core").checkLinksRelTypeCount +const checkTmOptionalPointer = require("@thing-description-playground/core").checkTmOptionalPointer const tmSchema = require("@thing-description-playground/core/tm-schema.json") const tmPlaceholderSchema = require("./assertions-tm/tm-placeholder.json") const tmRefSchema = require("./assertions-tm/tm-tmRef1.json") @@ -93,9 +90,7 @@ module.exports = validateTM } // additional checks - // results.push(...checkSecurity(tmJson)) - // results.push(...checkMultiLangConsistency(tmJson)) - // results.push(...checkLinksRelTypeCount(tmJson)) + results.push(...checkTmOptionalPointer(tmJson)) // Iterating through assertions for (let index = 0; index < assertions.length; index++) { From c304bb6ea539d6cbac17d86e8b28ba53ac72dbb6 Mon Sep 17 00:00:00 2001 From: Ege Korkan Date: Fri, 7 Oct 2022 10:55:04 +0200 Subject: [PATCH 2/4] remove unnecessary log --- packages/cli/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index d64561768..1420ddb33 100644 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -593,9 +593,9 @@ function defaultManipulation() { */ function extractName(pathLike) { // remove path if existing - console.log("Before: "+pathLike) + // console.log("Before: "+pathLike) pathLike = path.basename(pathLike) - console.log("After: "+pathLike) + // console.log("After: "+pathLike) // remove file ending if existing if (pathLike.indexOf(".") !== -1) { pathLike = pathLike.split(".") From 5538176971a4c161b118bd3de5364403f5c5d574 Mon Sep 17 00:00:00 2001 From: Ege Korkan Date: Fri, 7 Oct 2022 10:55:33 +0200 Subject: [PATCH 3/4] remove commented logs --- packages/core/shared.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/core/shared.js b/packages/core/shared.js index ef0f0d430..0763d3f97 100644 --- a/packages/core/shared.js +++ b/packages/core/shared.js @@ -133,7 +133,6 @@ function checkPropUniqueness(tdString) { const tdProperties = td.properties if (tdProperties.hasOwnProperty(interactionName)) { // duplicate was at properties but that fails the td-unique identifiers as well - // console.log("at property"); results.push({ "ID": "td-properties_uniqueness", "Status": "fail", @@ -162,7 +161,6 @@ function checkPropUniqueness(tdString) { const tdActions = td.actions if (tdActions.hasOwnProperty(interactionName)) { // duplicate was at actions but that fails the td-unique identifiers as well - // console.log("at action"); results.push({ "ID": "td-actions_uniqueness", "Status": "fail", @@ -189,7 +187,6 @@ function checkPropUniqueness(tdString) { const tdEvents = td.events if (tdEvents.hasOwnProperty(interactionName)) { // duplicate was at events but that fails the td-unique identifiers as well - // console.log("at event"); results.push({ "ID": "td-events_uniqueness", "Status": "fail", @@ -787,7 +784,7 @@ function checkUriSecurity(td) { if (curPropertyUriVariables.length>0){ // there are urivariables somewhere at least // below is from https://stackoverflow.com/a/1885569/3806426 const filteredArray = curPropertyUriVariables.filter(value => securityUriVariables.includes(value)) - console.log(curPropertyUriVariables,"\n",securityUriVariables,"\n",filteredArray) + // console.log(curPropertyUriVariables,"\n",securityUriVariables,"\n",filteredArray) if(filteredArray.length>0){ uriVariablesDistinctResult = "fail" } else { @@ -828,7 +825,7 @@ function checkUriSecurity(td) { if (curActionUriVariables.length>0){ // there are urivariables somewhere at least // below is from https://stackoverflow.com/a/1885569/3806426 const filteredArray = curActionUriVariables.filter(value => securityUriVariables.includes(value)) - console.log(curActionUriVariables,"\n",securityUriVariables,"\n",filteredArray) + // console.log(curActionUriVariables,"\n",securityUriVariables,"\n",filteredArray) if(filteredArray.length>0){ uriVariablesDistinctResult = "fail" } else { @@ -869,7 +866,7 @@ function checkUriSecurity(td) { if (curEventUriVariables.length>0){ // there are urivariables somewhere at least // below is from https://stackoverflow.com/a/1885569/3806426 const filteredArray = curEventUriVariables.filter(value => securityUriVariables.includes(value)) - console.log(curEventUriVariables,"\n",securityUriVariables,"\n",filteredArray) + // console.log(curEventUriVariables,"\n",securityUriVariables,"\n",filteredArray) if(filteredArray.length>0){ uriVariablesDistinctResult = "fail" } else { From 51f14c0a873876e62fe4a5149841dd50af5ad77f Mon Sep 17 00:00:00 2001 From: Ege Korkan Date: Fri, 7 Oct 2022 10:55:59 +0200 Subject: [PATCH 4/4] remove redundant manual assertion --- packages/assertions/assertions-tm/manual.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/assertions/assertions-tm/manual.csv b/packages/assertions/assertions-tm/manual.csv index 7ab0a730f..712e7a872 100644 --- a/packages/assertions/assertions-tm/manual.csv +++ b/packages/assertions/assertions-tm/manual.csv @@ -11,7 +11,6 @@ "tm-overwrite-types","null","not testable with Assertion Tester","Definitions SHOULD NOT be overwritten in such a way that possible instance values are no longer valid compared to the origin extended definitions." "tm-placeholder-replacement","null","not testable with Assertion Tester","The placeholder labeling MUST be substituted with a concrete value (e.g., as JSON number, JSON string, JSON object, etc) when TD instance is created from the Thing Model." "tm-ref-recursive-extensions","null","not testable with Assertion Tester","Recursive extensions leading to an infinite loop MUST NOT be defined." -"tm-tmOptional-resolver","null","not testable with Assertion Tester","The JSON Pointers of tm:optional MUST resolve to an entire interaction affordance Map definition." "tm-tmRef-overwrite-possibility","null","not testable with Assertion Tester","If the intention is to override an existing JSON name-value pair definition from tm:ref, the same JSON name MUST be used at the same level of the tm:ref declaration that provides a new value." "tm-tmRef-overwrite-process","null","not testable with Assertion Tester","The process to overwrite MUST follow the JSON Merge Patch algorithm as defined in [RFC7396] where the content of the referenced definition is patched with the new provided JSON name-value pairs." "tm-tmRef-overwrite-semantic-meaning","null","not testable with Assertion Tester","Similar to tm:extends and to keep the semantic meaning, definitions SHOULD NOT be overwritten in such a way that possible instance values are no longer valid compared to the origin referenced definition."