public class CarbonCommandToolsUtil extends Object
| Constructor and Description |
|---|
CarbonCommandToolsUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getCurrentOperatingSystem()
This method is to get operating system
|
static DataSourceBean |
getDataSourceInformation(String dataSourceName)
Get the data source information from the automation configuration file
|
static boolean |
isScriptRunSuccessfully(String directory,
String[] cmdArray,
String expectedString)
This method is to execute commands and reading the logs to find the expected string.
|
static boolean |
isServerDown(int portOffset)
This method is to check whether server is down or not
|
static boolean |
isServerStartedUp(org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
int portOffset)
This method to check whether server is up or not
This method wait for some time to check login status by checking the port and login
This will throw an exception if port is not open or couldn't login
|
static boolean |
searchOnLogs(String backEndUrl,
String[] searchStringArray,
String cookie)
This method to find multiple strings in same line in log
|
static void |
serverShutdown(int portOffset,
org.wso2.carbon.automation.engine.context.AutomationContext automationContext)
This method is to shutdown a server
|
static Process |
startServerUsingCarbonHome(String carbonHome,
int portOffset,
org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
String[] parameters)
This method is for start a as server
|
public static Process startServerUsingCarbonHome(String carbonHome, int portOffset, org.wso2.carbon.automation.engine.context.AutomationContext automationContext, String[] parameters) throws Exception
carbonHome - - carbon homeportOffset - - port offsetautomationContext - - AutomationContextparameters - - server startup arguments as an string arrayException - - Error occurred when starting the the serverpublic static void serverShutdown(int portOffset,
org.wso2.carbon.automation.engine.context.AutomationContext automationContext)
throws CarbonToolsIntegrationTestException
portOffset - - port offsetautomationContext - - AutomationContextCarbonToolsIntegrationTestException - - Error when trying to shutdown the serverpublic static boolean isServerDown(int portOffset)
portOffset - - port offsetpublic static String getCurrentOperatingSystem()
public static boolean isScriptRunSuccessfully(String directory, String[] cmdArray, String expectedString) throws CarbonToolsIntegrationTestException
directory - - Directory which has the file to be executed .cmdArray - - Command array to be executed.expectedString - - Expected string in the log.CarbonToolsIntegrationTestException - - Error while running the command.public static boolean searchOnLogs(String backEndUrl, String[] searchStringArray, String cookie) throws CarbonToolsIntegrationTestException
backEndUrl - - server back end urlsearchStringArray - - String array to be find in the logcookie - - cookieCarbonToolsIntegrationTestException - - Error when getting the logs and search the stringpublic static boolean isServerStartedUp(org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
int portOffset)
throws Exception
automationContext - - AutomationContextException - - Error while waiting for loginpublic static DataSourceBean getDataSourceInformation(String dataSourceName) throws XPathExpressionException
dataSourceName - - Data source name given in the configuration fileXPathExpressionException - - Throws if an exception occurred when getting data for configuration fileCopyright © 2015 WSO2 Inc. All rights reserved.