public class CarbonCommandToolsUtil extends Object
| Constructor and Description |
|---|
CarbonCommandToolsUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getCurrentOperatingSystem()
Provides current 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 Process |
runScript(String directory,
String[] cmdArray)
This method is to execute commands and return the Process
|
static void |
serverShutdown(int portOffset)
This method is to shutdown carbon server
|
static void |
serverShutdown(String backendURL,
String userName,
String password,
int portOffset)
This method is to shutdown carbon server using admin credentials
|
static boolean |
waitForFileCreation(String filePathString)
This method to check file has created or not
|
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 getting the command directorypublic static Process runScript(String directory, String[] cmdArray) throws CarbonToolsIntegrationTestException
directory - - Directory which has the file to be executed .cmdArray - - Command array to be executedCarbonToolsIntegrationTestException - - Error while getting the execution directorypublic static boolean isServerStartedUp(org.wso2.carbon.automation.engine.context.AutomationContext automationContext,
int portOffset)
throws CarbonToolsIntegrationTestException
automationContext - - AutomationContextCarbonToolsIntegrationTestException - - Error while waiting for loginpublic static boolean isServerDown(int portOffset)
portOffset - - port offsetpublic static boolean waitForFileCreation(String filePathString)
filePathString - - file pathpublic static String getCurrentOperatingSystem()
public static void serverShutdown(int portOffset)
throws CarbonToolsIntegrationTestException
portOffset - - port offsetCarbonToolsIntegrationTestException - - Error occurred while shutdown the serverpublic static void serverShutdown(String backendURL, String userName, String password, int portOffset) throws CarbonToolsIntegrationTestException
backendURL - - server backend urluserName - - admin usernamepassword - - admin passwordportOffset - - port offsetCarbonToolsIntegrationTestException - - Error while server shutting downpublic 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 © 2018 WSO2. All rights reserved.