Skip to content

Commit

Permalink
Move stop handler unit test to integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
HindujaB committed Oct 4, 2023
1 parent 1d25cad commit 843d7e0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public void testStopHandlerExecution() throws BallerinaTestException {
LogLeecher infoLeecher1 = new LogLeecher("Stopped stopHandlerFunc3");
LogLeecher infoLeecher2 = new LogLeecher("Stopped stopHandlerFunc2");
LogLeecher infoLeecher3 = new LogLeecher("Stopped stopHandlerFunc1");
LogLeecher infoLeecher4 = new LogLeecher("Stopped inlineStopHandler");
serverInstance.addLogLeecher(infoLeecher4);
serverInstance.addLogLeecher(infoLeecher1);
serverInstance.addLogLeecher(infoLeecher2);
serverInstance.addLogLeecher(infoLeecher3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ int count = 0;

function stopHandlerFunc1() returns error? {
incrementCount();
assertCount(5);
assertCount(6);
println("Stopped stopHandlerFunc1");
}

function stopHandlerFunc2() returns error? {
incrementCount();
assertCount(4);
assertCount(5);
println("Stopped stopHandlerFunc2");
}

function stopHandlerFunc3() returns error? {
incrementCount();
assertCount(3);
assertCount(4);
println("Stopped stopHandlerFunc3");
}

Expand All @@ -49,6 +49,12 @@ public function main() {
incrementCount();
assertCount(2);
runtime:onGracefulStop(stopHandlerFunc3);
runtime:StopHandler inlineStopHandler = function() returns error? {
incrementCount();
assertCount(3);
println("Stopped inlineStopHandler");
};
runtime:onGracefulStop(inlineStopHandler);
runtime:sleep(3);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public Object[] packageNameProvider() {
"invalid_values",
"async",
"utils",
"stop_handler",
"identifier_utils",
"environment"
};
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 843d7e0

Please sign in to comment.