Skip to content

Commit

Permalink
Fix intermittent test failure
Browse files Browse the repository at this point in the history
The activeMQ server is getting shutdown intermittently, starting broker in MSMPCronForwarderCase if that is closed
  • Loading branch information
chanikag committed Dec 20, 2023
1 parent 6d5257b commit 9c5cde0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ public static void stopMQServer() {
activeMqBroker.stop();

}

public static boolean isMQServerStarted() {
return activeMqBroker.isBrokerStarted();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.automation.extensions.servers.jmsserver.controller.config.JMSBrokerConfigurationProvider;
import org.wso2.carbon.automation.extensions.servers.tomcatserver.TomcatServerManager;
import org.wso2.carbon.automation.extensions.servers.tomcatserver.TomcatServerType;
import org.wso2.carbon.automation.test.utils.http.client.HttpRequestUtil;
import org.wso2.carbon.automation.test.utils.http.client.HttpResponse;
import org.wso2.carbon.esb.jms.utils.JMSBroker;
import org.wso2.esb.integration.common.extensions.jmsserver.ActiveMQServerExtension;
import org.wso2.esb.integration.common.utils.CarbonLogReader;
import org.wso2.esb.integration.common.utils.ESBIntegrationTest;
import org.wso2.esb.integration.services.jaxrs.customersample.CustomerConfig;
Expand All @@ -52,6 +55,9 @@ public class MSMPCronForwarderCase extends ESBIntegrationTest {
protected void init() throws Exception {
// START THE ESB
super.init();
if (!ActiveMQServerExtension.isMQServerStarted()) {
ActiveMQServerExtension.startMQServer();
}
carbonLogReader.start();
}

Expand Down

0 comments on commit 9c5cde0

Please sign in to comment.