From 185e10412791bc481b81574dec98d55f0bfcd261 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 3 Apr 2020 14:36:28 +0200 Subject: [PATCH] Adding StorageHub rules --- .../datamodel/validations/validators/TestRules.java | 2 +- .../rules/StorageHub/StorageHub-getVreFolder.csv | 5 +++++ .../rules/StorageHub/StorageHub-getVreFolder.json | 12 ++++++++++++ .../StorageHub/StorageHub-getVreFolderRecents.csv | 2 ++ .../StorageHub/StorageHub-getVreFolderRecents.json | 12 ++++++++++++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/rules/StorageHub/StorageHub-getVreFolder.csv create mode 100644 src/test/resources/rules/StorageHub/StorageHub-getVreFolder.json create mode 100644 src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.csv create mode 100644 src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.json diff --git a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java index d035f43..0d61b34 100644 --- a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java +++ b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java @@ -220,7 +220,7 @@ public class TestRules extends ContextTest { allRules(); File rulesDirectory = getRulesDirectory(); File rulesDirFile = new File(rulesDirectory, "StorageHub"); - File ruleFile = new File(rulesDirFile, "StorageHub-getVreRootFolder.json"); + File ruleFile = new File(rulesDirFile, "StorageHub-getVreFolderRecents.json"); testRule(ruleFile); } diff --git a/src/test/resources/rules/StorageHub/StorageHub-getVreFolder.csv b/src/test/resources/rules/StorageHub/StorageHub-getVreFolder.csv new file mode 100644 index 0000000..f37f017 --- /dev/null +++ b/src/test/resources/rules/StorageHub/StorageHub-getVreFolder.csv @@ -0,0 +1,5 @@ +DataAccess,StorageHub,/workspace/verefolders +DataAccess,StorageHub,/workspace/vrefodlers +DataAccess,StorageHub,getVreFolders +DataAccess,StorageHub,/workspace/verefolders/ +DataAccess,StorageHub,/workspace/vrefodlers/ \ No newline at end of file diff --git a/src/test/resources/rules/StorageHub/StorageHub-getVreFolder.json b/src/test/resources/rules/StorageHub/StorageHub-getVreFolder.json new file mode 100644 index 0000000..474c53f --- /dev/null +++ b/src/test/resources/rules/StorageHub/StorageHub-getVreFolder.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "DataAccess", + "serviceNameRegex": "StorageHub", + "calledMethodRegex": "\/workspace\/v(re|ere|er)fo(ld|dl)ers(\/){0,1}|getVreFolders" + }, + "replace": { + "serviceClass": "DataAccess", + "serviceName": "StorageHub", + "calledMethod": "getVreFolders" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.csv b/src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.csv new file mode 100644 index 0000000..59eee69 --- /dev/null +++ b/src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.csv @@ -0,0 +1,2 @@ +DataAccess,StorageHub,/workspace/vrefolder/recents +DataAccess,StorageHub,getVreFolderRecents \ No newline at end of file diff --git a/src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.json b/src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.json new file mode 100644 index 0000000..ff1ce29 --- /dev/null +++ b/src/test/resources/rules/StorageHub/StorageHub-getVreFolderRecents.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "DataAccess", + "serviceNameRegex": "StorageHub", + "calledMethodRegex": "\/workspace\/vrefolder\/recents|getVreFolderRecents" + }, + "replace": { + "serviceClass": "DataAccess", + "serviceName": "StorageHub", + "calledMethod": "getVreFolderRecents" + } +} \ No newline at end of file