Search in sources :

Example 1 with AutomationUtilException

use of org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException in project product-iots by wso2.

the class SampleInstallationTest method serverRestartTest.

@Test(description = "Test restarting the server", groups = Constants.TestSample.SAMPLE_INSTALL, dependsOnMethods = { "sampleInstallationTest" })
public void serverRestartTest() {
    ServerConfigurationManager serverManager;
    try {
        serverManager = new ServerConfigurationManager(automationContext);
        log.info("Restart Triggered -------------------------------------------------------------------");
        serverManager.restartGracefully();
        logViewerClient.getAllRemoteSystemLogs();
        waitForRestart();
    } catch (AutomationUtilException | XPathExpressionException | MalformedURLException e) {
        log.error("Restart failed due to : " + e.getLocalizedMessage());
    } catch (RemoteException | LogViewerLogViewerException e) {
        log.error("Cannot get server log due to : " + e.getLocalizedMessage());
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) XPathExpressionException(javax.xml.xpath.XPathExpressionException) LogViewerLogViewerException(org.wso2.carbon.logging.view.stub.LogViewerLogViewerException) RemoteException(java.rmi.RemoteException) AutomationUtilException(org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException) Test(org.testng.annotations.Test)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 RemoteException (java.rmi.RemoteException)1 XPathExpressionException (javax.xml.xpath.XPathExpressionException)1 Test (org.testng.annotations.Test)1 AutomationUtilException (org.wso2.carbon.integration.common.utils.exceptions.AutomationUtilException)1 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)1 LogViewerLogViewerException (org.wso2.carbon.logging.view.stub.LogViewerLogViewerException)1