From ce72f337d550ad111c52b617292ed432c6c009a0 Mon Sep 17 00:00:00 2001 From: prakanth <50439067+prakanth97@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:13:38 +0530 Subject: [PATCH] Fix test failures in windows --- ballerina/Dependencies.toml | 13 ------------- .../resources/default_namespaced_invoice.xml | 8 ++------ ballerina/tests/stream_default_namspace_test.bal | 16 ++++------------ ballerina/tests/stream_namespace_test.bal | 7 ++----- .../data-native/resource-config.json | 6 ------ 5 files changed, 8 insertions(+), 42 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 4142d61..eb35607 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -14,7 +14,6 @@ version = "0.1.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "test"} ] modules = [ @@ -51,18 +50,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] -[[package]] -org = "ballerina" -name = "lang.regexp" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "lang.regexp", moduleName = "lang.regexp"} -] - [[package]] org = "ballerina" name = "lang.value" diff --git a/ballerina/tests/resources/default_namespaced_invoice.xml b/ballerina/tests/resources/default_namespaced_invoice.xml index 62e237f..86f0bc6 100644 --- a/ballerina/tests/resources/default_namespaced_invoice.xml +++ b/ballerina/tests/resources/default_namespaced_invoice.xml @@ -1,16 +1,12 @@ - This is the description for - Product 1. - + This is the description for Product 1. 57.70 Home and Garden - This is the description for - Product 2. - + This is the description for Product 2. 6312.36 Books diff --git a/ballerina/tests/stream_default_namspace_test.bal b/ballerina/tests/stream_default_namspace_test.bal index ec0c9f2..62afc17 100644 --- a/ballerina/tests/stream_default_namspace_test.bal +++ b/ballerina/tests/stream_default_namspace_test.bal @@ -128,9 +128,7 @@ function testDefaultNamespaceInvoiceFull() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -139,9 +137,7 @@ function testDefaultNamespaceInvoiceFull() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); @@ -228,9 +224,7 @@ function testDefaultNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(invoice.products.product[0].description, string `This is the description for - Product 1. - `); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -239,9 +233,7 @@ function testDefaultNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(invoice.products.product[1].description, string `This is the description for - Product 2. - `); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); diff --git a/ballerina/tests/stream_namespace_test.bal b/ballerina/tests/stream_namespace_test.bal index 3369e9e..54336fd 100644 --- a/ballerina/tests/stream_namespace_test.bal +++ b/ballerina/tests/stream_namespace_test.bal @@ -16,7 +16,6 @@ import ballerina/io; import ballerina/test; -import ballerina/lang.regexp; @Namespace { uri: "http://www.example.com/products", @@ -200,8 +199,7 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[0].length(), 5, "Product 1 field count mismatched"); test:assertEquals(invoice.products.product[0].id, 1); test:assertEquals(invoice.products.product[0].name, "Product 1"); - test:assertEquals(regexp:replaceAll(re `[\r\n]`, invoice.products.product[0].description, "\n"), - "This is the description for\n Product 1.\n "); + test:assertEquals(invoice.products.product[0].description, "This is the description for Product 1."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[0].price.\#content, 57.70d); test:assertEquals(invoice.products.product[0].price.currency, "USD"); @@ -210,8 +208,7 @@ function testNamespaceInvoiceFullPlain() returns error? { test:assertEquals(invoice.products.product[1].length(), 5, "Product 2 field count mismatched"); test:assertEquals(invoice.products.product[1].id, 2); test:assertEquals(invoice.products.product[1].name, "Product 2"); - test:assertEquals(regexp:replaceAll(re `[\r\n]`, invoice.products.product[1].description, "\n"), - "This is the description for\n Product 2.\n "); + test:assertEquals(invoice.products.product[1].description, "This is the description for Product 2."); test:assertEquals(invoice.products.product[0].price.length(), 2, "Price 1 price field count mismatched"); test:assertEquals(invoice.products.product[1].price.\#content, 6312.36d); test:assertEquals(invoice.products.product[1].price.currency, "LKR"); diff --git a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json index 6cfd723..befe09e 100644 --- a/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json +++ b/native/src/main/resources/META-INF/native-image/io.ballerina.stdlib/data-native/resource-config.json @@ -1,10 +1,4 @@ { - "resources":{ - "includes":[ { - "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLInputFactory\\E" - }, { - "pattern":"\\QMETA-INF/services/javax.xml.stream.XMLOutputFactory\\E" - }]}, "bundles":[{ "name":"error", "locales":[""]