Skip to content

Commit

Permalink
Fix test failures in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
prakanth97 committed Dec 21, 2023
1 parent 68dc4de commit ce72f33
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 42 deletions.
13 changes: 0 additions & 13 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 2 additions & 6 deletions ballerina/tests/resources/default_namespaced_invoice.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<invoice>
<products xmlns="http://www.example.com/products">
<product id="1" name="Product 1" xmlns="http://www.example.com/products">
<description xmlns="http://www.example.com/products">This is the description for
Product 1.
</description>
<description xmlns="http://www.example.com/products">This is the description for Product 1.</description>
<price currency="USD" xmlns="http://www.example.com/products">57.70</price>
<category xmlns="http://www.example.com/products">Home and Garden</category>
</product>
<product id="2" name="Product 2" xmlns="http://www.example.com/products">
<description xmlns="http://www.example.com/products">This is the description for
Product 2.
</description>
<description xmlns="http://www.example.com/products">This is the description for Product 2.</description>
<price currency="LKR" xmlns="http://www.example.com/products">6312.36</price>
<category xmlns="http://www.example.com/products">Books</category>
</product>
Expand Down
16 changes: 4 additions & 12 deletions ballerina/tests/stream_default_namspace_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
7 changes: 2 additions & 5 deletions ballerina/tests/stream_namespace_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import ballerina/io;
import ballerina/test;
import ballerina/lang.regexp;

@Namespace {
uri: "http://www.example.com/products",
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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":[""]
Expand Down

0 comments on commit ce72f33

Please sign in to comment.