From d697e8bbc7990816f050e45e0f08e03e973acb6f Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 15:15:48 +0530 Subject: [PATCH 1/8] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 3d4a592..847fa20 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -41,7 +41,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.4.0" +version = "2.4.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -50,7 +50,7 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.8.1" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -61,7 +61,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.2" +version = "2.9.3" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, From 329772104015ca6e2a9af1cbded48a3a6903f29e Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 15:19:17 +0530 Subject: [PATCH 2/8] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index db69246..443ec67 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -16,5 +16,5 @@ path = "../native/build/libs/azure.functions-native-4.1.0-SNAPSHOT.jar" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "mime-native" -version = "2.8.0" -path = "./lib/mime-native-2.8.0.jar" +version = "2.9.0" +path = "./lib/mime-native-2.9.0.jar" From e6015b2c0c72f5b564afd4ee01767585d768da4d Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 15:19:45 +0530 Subject: [PATCH 3/8] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 847fa20..1be9235 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.8.0-20230726-145300-b2bdf796" +distribution-version = "2201.8.0" [[package]] org = "ballerina" name = "auth" -version = "2.9.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -22,7 +22,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.6.0" +version = "3.7.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -33,7 +33,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.3.0" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -41,7 +41,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.4.1" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -50,7 +50,7 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.8.0" +version = "1.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -61,7 +61,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.3" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -93,7 +93,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.5.0" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -110,7 +110,7 @@ modules = [ [[package]] org = "ballerina" name = "jwt" -version = "2.9.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -201,7 +201,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.8.1" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -215,7 +215,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.8.0" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -225,7 +225,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.9.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -238,7 +238,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.1.0" +version = "1.2.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -246,7 +246,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.7.0" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -258,7 +258,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.4.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -267,7 +267,7 @@ dependencies = [ [[package]] org = "ballerina" name = "time" -version = "2.3.0" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -275,7 +275,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.3.0" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] From 01a0c1b23f645f1698a034d74891192daae62736 Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 15:23:36 +0530 Subject: [PATCH 4/8] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 443ec67..4df2174 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -2,7 +2,7 @@ org = "ballerinax" name = "azure.functions" version = "4.1.0" -distribution = "2201.7.0" +distribution = "2201.8.0" repository = "https://github.com/ballerina-platform/module-ballerinax-azure.functions" license = ["Apache-2.0"] keywords = ["azure", "functions", "serverless", "cloud"] From 2af650808add36393c6213a8e0149d8cd3d9fbdb Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 15:23:59 +0530 Subject: [PATCH 5/8] Bump depedencies for update 8 --- ballerina-tests/tests/test.bal | 8 ++---- build-config/resources/Ballerina.toml | 2 +- build.gradle | 1 - gradle.properties | 39 +++++++++++++-------------- 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/ballerina-tests/tests/test.bal b/ballerina-tests/tests/test.bal index 9c55edc..ac54827 100644 --- a/ballerina-tests/tests/test.bal +++ b/ballerina-tests/tests/test.bal @@ -1045,9 +1045,7 @@ function testHttpBlobInputOptional() returns error? { } -@test:Config { - enable: false -} +@test:Config {} function testMultipartFormData() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/http-multipart-formdata.json"; @@ -1067,9 +1065,7 @@ function testMultipartFormData() returns error? { test:assertEquals(resp, expectedResp); } -@test:Config { - enable: false -} +@test:Config {} function testMultipartMimeFormData() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/http-multipart-formdata-mime.json"; diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index e092f56..4b2e7f3 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -2,7 +2,7 @@ org = "ballerinax" name = "azure.functions" version = "@toml.version@" -distribution = "2201.7.0" +distribution = "2201.8.0" repository = "https://github.com/ballerina-platform/module-ballerinax-azure.functions" license = ["Apache-2.0"] keywords = ["azure", "functions", "serverless", "cloud"] diff --git a/build.gradle b/build.gradle index ab44e52..9a480a4 100644 --- a/build.gradle +++ b/build.gradle @@ -87,7 +87,6 @@ subprojects { ballerinaStdLibs "io.ballerina.stdlib:constraint-ballerina:${stdlibConstraintVersion}" ballerinaStdLibs "io.ballerina.stdlib:io-ballerina:${stdlibIoVersion}" ballerinaStdLibs "io.ballerina.stdlib:log-ballerina:${stdlibLogVersion}" - ballerinaStdLibs "io.ballerina.stdlib:regex-ballerina:${stdlibRegexVersion}" ballerinaStdLibs "io.ballerina.stdlib:mime-ballerina:${stdlibMimeVersion}" ballerinaStdLibs "io.ballerina.stdlib:auth-ballerina:${stdlibAuthVersion}" ballerinaStdLibs "io.ballerina.stdlib:jwt-ballerina:${stdlibJwtVersion}" diff --git a/gradle.properties b/gradle.properties index c929d34..d8450c5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,24 +3,23 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8' group=org.ballerinax.azurefunctions version=4.1.0-SNAPSHOT systemProp.org.gradle.internal.publish.checksums.insecure=true -ballerinaLangVersion=2201.8.0-20230726-145300-b2bdf796 -stdlibConstraintVersion=1.3.0 -stdlibIoVersion=1.5.0 -stdlibLogVersion=2.8.1-20230718-085900-36c385c -stdlibHttpVersion=2.9.0 -stdlibAuthVersion=2.9.0 -stdlibFileVersion=1.8.0 -stdlibRegexVersion=1.4.3 -stdlibCacheVersion=3.6.0 -stdlibCryptoVersion=2.4.0 -stdlibTimeVersion=2.3.0 -stdlibMimeVersion=2.8.0 -stdlibOsVersion=1.7.0 -stdlibTaskVersion=2.4.0 -stdlibJwtVersion=2.9.0 -stdlibOAuth2Version=2.9.0 -stdlibUuidVersion=1.6.0 -stdlibUrlVersion=2.3.0 -observeVersion=1.1.0 -observeInternalVersion=1.1.0 +ballerinaLangVersion=2201.8.0 +stdlibConstraintVersion=1.4.0 +stdlibIoVersion=1.6.0 +stdlibLogVersion=2.9.0 +stdlibHttpVersion=2.10.0 +stdlibAuthVersion=2.10.0 +stdlibFileVersion=1.9.0 +stdlibCacheVersion=3.7.0 +stdlibCryptoVersion=2.5.0 +stdlibTimeVersion=2.4.0 +stdlibMimeVersion=2.9.0 +stdlibOsVersion=1.8.0 +stdlibTaskVersion=2.5.0 +stdlibJwtVersion=2.10.0 +stdlibOAuth2Version=2.10.0 +stdlibUuidVersion=1.7.0 +stdlibUrlVersion=2.4.0 +observeVersion=1.2.0 +observeInternalVersion=1.2.0 ballerinaGradlePluginVersion=2.0.1 From 219172f1f25e88ec58a8fe9266cb712158dd4fbd Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 16:37:23 +0530 Subject: [PATCH 6/8] Change to graalvm commiunity --- .github/workflows/build-master.yml | 2 +- .github/workflows/daily-build.yml | 2 +- .github/workflows/pull-request.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml index ba4c6a8..36093d0 100644 --- a/.github/workflows/build-master.yml +++ b/.github/workflows/build-master.yml @@ -30,7 +30,7 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: java-version: '17.0.7' - distribution: 'graalvm' + distribution: 'graalvm-community' components: 'native-image' github-token: ${{ secrets.GITHUB_TOKEN }} set-java-home: 'false' diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 6d5823c..f5c057e 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -31,7 +31,7 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: java-version: '17.0.7' - distribution: 'graalvm' + distribution: 'graalvm-community' components: 'native-image' github-token: ${{ secrets.GITHUB_TOKEN }} set-java-home: 'false' diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e36e12c..9ac8e51 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -26,7 +26,7 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: java-version: '17.0.7' - distribution: 'graalvm' + distribution: 'graalvm-community' components: 'native-image' github-token: ${{ secrets.GITHUB_TOKEN }} set-java-home: 'false' @@ -55,7 +55,7 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: java-version: '17.0.7' - distribution: 'graalvm' + distribution: 'graalvm-community' components: 'native-image' github-token: ${{ secrets.GITHUB_TOKEN }} set-java-home: 'false' From 519473a71c196a95d18a88e59839dd278756551b Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 17:03:00 +0530 Subject: [PATCH 7/8] Change the builder docker image --- .../main/java/org/ballerinax/azurefunctions/Constants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-plugin/src/main/java/org/ballerinax/azurefunctions/Constants.java b/compiler-plugin/src/main/java/org/ballerinax/azurefunctions/Constants.java index 7dbfb60..319230d 100644 --- a/compiler-plugin/src/main/java/org/ballerinax/azurefunctions/Constants.java +++ b/compiler-plugin/src/main/java/org/ballerinax/azurefunctions/Constants.java @@ -75,8 +75,8 @@ public class Constants { public static final String FUNCTION_JSON_NAME = "function.json"; public static final String BALLERINA_ORG = "ballerina"; - public static final String NATIVE_BUILDER_IMAGE_NAME = "azure_native_builder"; - public static final String NATIVE_BUILDER_IMAGE = BALLERINA_ORG + "/" + NATIVE_BUILDER_IMAGE_NAME; + public static final String NATIVE_BUILDER_IMAGE_NAME = "azf_native_builder"; + public static final String NATIVE_BUILDER_IMAGE = BALLERINA_ORG + "/" + NATIVE_BUILDER_IMAGE_NAME + ":" + "java17"; public static final String CONTAINER_OUTPUT_PATH = ":/app/build/output"; From 9033bc28c79a35ae33ea2a8c509536a44be527d7 Mon Sep 17 00:00:00 2001 From: xlight05 Date: Wed, 20 Sep 2023 23:11:54 +0530 Subject: [PATCH 8/8] Fix regex uses in tests --- ballerina-tests/tests/test.bal | 97 ++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 33 deletions(-) diff --git a/ballerina-tests/tests/test.bal b/ballerina-tests/tests/test.bal index ac54827..397e5c7 100644 --- a/ballerina-tests/tests/test.bal +++ b/ballerina-tests/tests/test.bal @@ -17,7 +17,6 @@ import ballerina/http; import ballerina/io; import ballerina/lang.value; -import ballerina/regex; import ballerina/test; @test:Config {} @@ -25,7 +24,8 @@ function retrFromAnnotField() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrFromAnnotField"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString,"retrFromAnnotField"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrFromAnnotField", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"text/plain"}, "body":"text/plain"}}, "Logs":[], "ReturnValue":null}; @@ -37,7 +37,8 @@ function retrFromParam() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrFromParam"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString,"retrFromParam"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrFromParam", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"text/plain"}, "body":"az-func-http-test.azurewebsites.net"}}, "Logs":[], "ReturnValue":null}; @@ -49,7 +50,8 @@ function retrSingleVal() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrSingleVal"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString,"retrSingleVal"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrSingleVal", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"application/json"}, "body":15}}, "Logs":[], "ReturnValue":null}; @@ -61,7 +63,8 @@ function retrArrVal() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrArrVal"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString,"retrArrVal"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrArrVal", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"application/json"}, "body":20}}, "Logs":[], "ReturnValue":null}; @@ -73,7 +76,8 @@ function retrArrValStr() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrArrValStr"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "retrArrValStr"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrArrValStr", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"text/plain"}, "body":"12"}}, "Logs":[], "ReturnValue":null}; @@ -85,7 +89,8 @@ function retrAsRecord() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrAsRecord"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "retrAsRecord"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrAsRecord", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"application/json"}, "body":105}}, "Logs":[], "ReturnValue":null}; @@ -97,7 +102,8 @@ function retrNilable() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrNilable"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "retrNilable"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrNilable", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":201, "headers":{"Content-Type":"text/plain"}, "body":"az-func-http-test.azurewebsites.net"}}, "Logs":[], "ReturnValue":null}; @@ -109,7 +115,8 @@ function nnonTreatNilAsOptNilnoHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonTreatNilAsOpt-Nil-noHeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonTreatNilAsOpt-Nil-noHeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-nonTreatNilAsOpt-Nil-noHeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":400, "body":"no header value found for 'hoste'", "headers":{"Content-Type":"text/plain"}}}, "Logs":[], "ReturnValue":null}; @@ -121,7 +128,8 @@ function treatNilAsOptnonNilnoHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "treatNilAsOpt-nonNil-noHeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "treatNilAsOpt-nonNil-noHeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-treatNilAsOpt-nonNil-noHeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":400, "body":"no header value found for 'hoste'", "headers":{"Content-Type":"text/plain"}}}, "Logs":[], "ReturnValue":null}; @@ -133,7 +141,8 @@ function treatNilAsOptnonNilHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "treatNilAsOpt-nonNil-HeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "treatNilAsOpt-nonNil-HeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-treatNilAsOpt-nonNil-HeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":400, "body":"no header value found for 'hos'", "headers":{"Content-Type":"text/plain"}}}, "Logs":[], "ReturnValue":null}; @@ -145,7 +154,8 @@ function retrAsRecordNoField() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "retrAsRecordNoField"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "retrAsRecordNoField"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-retrAsRecordNoField", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":400, "body":"no header value found for 'Content-Type1'", "headers":{"Content-Type":"text/plain"}}}, "Logs":[], "ReturnValue":null}; @@ -157,7 +167,8 @@ function treatNilAsOptNilnoHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "treatNilAsOpt-Nil-noHeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "treatNilAsOpt-Nil-noHeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-treatNilAsOpt-Nil-noHeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":202}},"Logs":[],"ReturnValue":null}; @@ -169,7 +180,8 @@ function treatNilAsOptNilHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "treatNilAsOpt-Nil-HeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "treatNilAsOpt-Nil-HeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-treatNilAsOpt-Nil-HeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":202}},"Logs":[],"ReturnValue":null}; @@ -181,7 +193,8 @@ function nonTreatNilAsOptnonNilnoHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonTreatNilAsOpt-nonNil-noHeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonTreatNilAsOpt-nonNil-noHeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-nonTreatNilAsOpt-nonNil-noHeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":400, "body":"no header value found for 'hoste'", "headers":{"Content-Type":"text/plain"}}}, "Logs":[], "ReturnValue":null}; @@ -193,7 +206,8 @@ function nonTreatNilAsOptnonNilHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonTreatNilAsOpt-nonNil-HeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonTreatNilAsOpt-nonNil-HeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-nonTreatNilAsOpt-nonNil-HeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":400, "body":"no header value found for 'hos'", "headers":{"Content-Type":"text/plain"}}}, "Logs":[], "ReturnValue":null}; @@ -205,7 +219,8 @@ function nonTreatNilAsOptNilHeaderTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpHeaderTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonTreatNilAsOpt-Nil-HeaderTest"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonTreatNilAsOpt-Nil-HeaderTest"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-httpHeader-nonTreatNilAsOpt-Nil-HeaderTest", readJson); json expectedResp = {"Outputs":{"outResp":{"statusCode":202}},"Logs":[],"ReturnValue":null}; @@ -237,7 +252,8 @@ function getHttpAccessorTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpAccessorTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(ACCESSOR_NAME)", "get"); + string:RegExp regex = re `(ACCESSOR_NAME)`; + string replacedString = regex.replaceAll(readString, "get"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/get-hello-httpAccessorTest", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "body": "Hello from all"}}, "Logs": [], "ReturnValue": null}; @@ -249,7 +265,8 @@ function putHttpAccessorTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpAccessorTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(ACCESSOR_NAME)", "put"); + string:RegExp regex = re `(ACCESSOR_NAME)`; + string replacedString = regex.replaceAll(readString, "put"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/put-hello-httpAccessorTest", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "body": "Hello from all"}}, "Logs": [], "ReturnValue": null}; @@ -261,7 +278,8 @@ function patchHttpAccessorTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpAccessorTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(ACCESSOR_NAME)", "patch"); + string:RegExp regex = re `(ACCESSOR_NAME)`; + string replacedString = regex.replaceAll(readString, "patch"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/patch-hello-httpAccessorTest", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "body": "Hello from all"}}, "Logs": [], "ReturnValue": null}; @@ -273,7 +291,8 @@ function deleteHttpAccessorTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpAccessorTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(ACCESSOR_NAME)", "delete"); + string:RegExp regex = re `(ACCESSOR_NAME)`; + string replacedString = regex.replaceAll(readString, "delete"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/delete-hello-httpAccessorTest", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "body": "Hello from all"}}, "Logs": [], "ReturnValue": null}; @@ -285,7 +304,8 @@ function headHttpAccessorTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpAccessorTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(ACCESSOR_NAME)", "head"); + string:RegExp regex = re `(ACCESSOR_NAME)`; + string replacedString = regex.replaceAll(readString, "head"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/head-hello-httpAccessorTest", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "body": "Hello from all"}}, "Logs": [], "ReturnValue": null}; @@ -297,7 +317,8 @@ function optionsHttpAccessorTest() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/httpAccessorTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(ACCESSOR_NAME)", "options"); + string:RegExp regex = re `(ACCESSOR_NAME)`; + string replacedString = regex.replaceAll(readString, "options"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/options-hello-httpAccessorTest", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 200, "headers": {"Content-Type": "text/plain"}, "body": "Hello from all"}}, "Logs": [], "ReturnValue": null}; @@ -398,7 +419,8 @@ function nonHttpResTest1() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest1"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest1"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest1", readJson); json expectedResp = { @@ -420,7 +442,8 @@ function nonHttpResTest2() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest2"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest2"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest2", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 201, "headers": {"Content-Type": "application/xml"}, "body": "The Lost World"}}, "Logs": [], "ReturnValue": null}; @@ -432,7 +455,8 @@ function nonHttpResTest3() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest3"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest3"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest3", readJson); json expectedResp = { @@ -454,7 +478,8 @@ function nonHttpResTest4() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest4"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest4"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest4", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 201, "headers": {"Content-Type": "application/json"}, "body": 100}}, "Logs": [], "ReturnValue": null}; @@ -466,7 +491,8 @@ function nonHttpResTest6() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest6"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest6"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest6", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 201, "headers": {"Content-Type": "application/json"}, "body": 100}}, "Logs": [], "ReturnValue": null}; @@ -478,7 +504,8 @@ function nonHttpResTest7() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest7"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest7"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest7", readJson); json expectedResp = {"Outputs": {"outResp": {"statusCode": 201, "headers": {"Content-Type": "application/json"}, "body": true}}, "Logs": [], "ReturnValue": null}; @@ -490,7 +517,8 @@ function nonHttpResTest8() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest8"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest8"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest8", readJson); json expectedResp = { @@ -512,7 +540,8 @@ function nonHttpResTest9() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest9"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest9"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest9", readJson); json expectedResp = { @@ -534,7 +563,8 @@ function nonHttpResTest10() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest10"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest10"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest10", readJson); json expectedResp = { @@ -556,7 +586,8 @@ function nonHttpResTest11() returns error? { final http:Client clientEndpoint = check new ("http://localhost:3000"); string jsonFilePath = "./tests/resources/nonHttpResTest.json"; string readString = check io:fileReadString(jsonFilePath); - string replacedString = regex:replaceAll(readString, "(FUNC_NAME)", "nonHttpResTest11"); + string:RegExp regex = re `(FUNC_NAME)`; + string replacedString = regex.replaceAll(readString, "nonHttpResTest11"); json readJson = check value:fromJsonString(replacedString); json resp = check clientEndpoint->post("/post-hello-nonHttpResTest11", readJson); json expectedResp = {