Source:
<code>public static Process startServerUsingCarbonHome(String carbonHome, int portOffset, AutomationContext automationContext, String[] parameters) throws Exception { Process tempProcess; String scriptName = "wso2server"; File commandDir = new File(carbonHome); String[] cmdArray; log.info("Starting server............. "); <START> if (System.getProperty("os.name").toLowerCase().contains("windows")) { <END> commandDir = new File(carbonHome + File.separator + "bin"); cmdArray = new String[]{"cmd.exe", "/c", scriptName + ".bat", "-DportOffset=" + portOffset}; cmdArray = mergePropertiesToCommandArray(parameters, cmdArray); tempProcess = Runtime.getRuntime().exec(cmdArray, null, commandDir); } else { cmdArray = new String[]{"sh", "bin/" + scriptName + ".sh", "-DportOffset=" + portOffset}; cmdArray = mergePropertiesToCommandArray(parameters, cmdArray); tempProcess = Runtime.getRuntime().exec(cmdArray, null, commandDir); } InputStreamHandler errorStreamHandler = new InputStreamHandler("errorStream", tempProcess.getErrorStream()); inputStreamHandler = new ServerLogReader("inputStream", tempProcess.getInputStream()); inputStreamHandler.start(); errorStreamHandler.start(); ClientConnectionUtil.waitForPort(Integer.parseInt(FrameworkConstants.SERVER_DEFAULT_HTTPS_PORT) + portOffset, DEFAULT_START_STOP_WAIT_MS, false, automationContext.getInstance().getHosts().get("default")); long time = System.currentTimeMillis() + 60 * 1000; while (!inputStreamHandler.getOutput().contains(SERVER_STARTUP_MESSAGE) && System.currentTimeMillis() < time) { } ClientConnectionUtil.waitForLogin(automationContext); log.info("Server started successfully."); return tempProcess; }</code><technical_language>a utility method check isOnWindows</technical_language>

Target:
public static Process startServerUsingCarbonHome(String carbonHome, int portOffset, AutomationContext automationContext, String[] parameters) throws Exception { Process tempProcess; String scriptName = "wso2server"; File commandDir = new File(carbonHome); String[] cmdArray; log.info("Starting server............. "); if (CarbonCommandToolsUtil.getCurrentOperatingSystem(). contains(OperatingSystems.WINDOWS.name().toLowerCase())) { commandDir = new File(carbonHome + File.separator + "bin"); cmdArray = new String[]{"cmd.exe", "/c", scriptName + ".bat", "-DportOffset=" + portOffset}; cmdArray = mergePropertiesToCommandArray(parameters, cmdArray); tempProcess = Runtime.getRuntime().exec(cmdArray, null, commandDir); } else { cmdArray = new String[]{"sh", "bin/" + scriptName + ".sh", "-DportOffset=" + portOffset}; cmdArray = mergePropertiesToCommandArray(parameters, cmdArray); tempProcess = Runtime.getRuntime().exec(cmdArray, null, commandDir); } InputStreamHandler errorStreamHandler = new InputStreamHandler("errorStream", tempProcess.getErrorStream()); ServerLogReader inputStreamHandler = new ServerLogReader("inputStream", tempProcess.getInputStream()); inputStreamHandler.start(); errorStreamHandler.start(); ClientConnectionUtil.waitForPort(Integer.parseInt(FrameworkConstants.SERVER_DEFAULT_HTTPS_PORT) + portOffset, DEFAULT_START_STOP_WAIT_MS, false, automationContext.getInstance().getHosts().get("default")); long time = System.currentTimeMillis() + DEFAULT_START_STOP_WAIT_MS; while (!inputStreamHandler.getOutput().contains(SERVER_STARTUP_MESSAGE) && System.currentTimeMillis() < time) { } ClientConnectionUtil.waitForLogin(automationContext); log.info("Server started successfully."); return tempProcess; }