Skip to content

Commit

Permalink
Merge pull request #215 from RDPerera/GraalVM-fix
Browse files Browse the repository at this point in the history
Migrate std:regex to lang.regexp
  • Loading branch information
RDPerera authored Mar 26, 2024
2 parents e9b2b15 + 6cd43f0 commit c666a89
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ballerina/tests/asb_sender_receiver_negative_tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

import ballerina/log;
import ballerina/test;
import ballerina/regex;

string invalidCompleteError = "^Failed to complete message with ID:.*$";
string invalidAbandonError = "^Failed to abandon message with ID:.*$";
@test:Config {
groups: ["asb_sender_receiver_negative"],
enable: true,
Expand Down Expand Up @@ -78,7 +75,8 @@ function testInvalidComplete() returns error? {
log:printInfo("messgae" + receivedMessage.toString());
Error? result = messageReceiver->complete(receivedMessage);
test:assertTrue(result is error, msg = "Unexpected Complete for Messages in Receive and Delete Mode");
test:assertTrue(regex:matches((<Error>result).message(),invalidCompleteError), msg = "Invalid Complete for " +
string:RegExp completeFailedMsg = re `^Failed to complete message with ID:.*$`;
test:assertTrue(completeFailedMsg.isFullMatch((<Error>result).message()), msg = "Invalid Complete for " +
" Messages in Receive and Delete Mode");
} else if receivedMessage is () {
test:assertFail("No message in the queue.");
Expand Down Expand Up @@ -118,7 +116,8 @@ function testInvalidAbandon() returns error? {
log:printInfo("messgae" + receivedMessage.toString());
Error? result = messageReceiver->abandon(receivedMessage);
test:assertTrue(result is error, msg = "Unexpected Abandon for Messages in Receive and Delete Mode");
test:assertTrue(regex:matches((<Error>result).message(),invalidAbandonError), msg = "Invalid Abandon for " +
string:RegExp abandonFailedMsg = re `^Failed to abandon message with ID:.*$`;
test:assertTrue(abandonFailedMsg.isFullMatch((<Error>result).message()), msg = "Invalid Abandon for " +
" Messages in Receive and Delete Mode");
} else if receivedMessage is () {
test:assertFail("No message in the queue.");
Expand Down

0 comments on commit c666a89

Please sign in to comment.