@Test public void getProcessIdMuleEETest() throws Exception { int muleEEProcessPID = 4321; doReturn("").when(controllerSpy, EXECUTE_CMD_METHOD_NAME, DISPLAY_MULE_PROCESS_INFORMATION); doReturn("RUNNING PID : " + muleEEProcessPID).when(controllerSpy, EXECUTE_CMD_METHOD_NAME, DISPLAY_MULE_EE_PROCESS_INFORMATION); assertThat("Process id is not the expected", controllerSpy.getProcessId(), equalTo(muleEEProcessPID)); }
@Override public int getProcessId() { String muleResult = executeCmd("sc queryex \"mule\" "); String muleEEResult = executeCmd("sc queryex \"mule_ee\" "); if (muleResult.contains("RUNNING")) { return getId(muleResult); } else if (muleEEResult.contains("RUNNING")) { return getId(muleEEResult); } else { throw new MuleControllerException("No mule instance is running"); } }
WindowsController extends AbstractOSController { @Override public int getProcessId() { String muleResult = executeCmd("sc queryex \"mule\" "); String muleEEResult = executeCmd("sc queryex \"mule_ee\" "); if (muleResult.contains("RUNNING")) { return getId(muleResult); } else if (muleEEResult.contains("RUNNING")) { return getId(muleEEResult); } else { throw new MuleControllerException("No mule instance is running"); } } }
WindowsController extends AbstractOSController { @Override public int getProcessId() { String muleResult = executeCmd("sc queryex \"mule\" "); String muleEEResult = executeCmd("sc queryex \"mule_ee\" "); if (muleResult.contains("RUNNING")) { return getId(muleResult); } else if (muleEEResult.contains("RUNNING")) { return getId(muleEEResult); } else { throw new MuleControllerException("No mule instance is running"); } } WindowsController(String muleHome, int timeout); }
WindowsController extends AbstractOSController { @Override public int getProcessId() { String muleResult = executeCmd("sc queryex \"mule\" "); String muleEEResult = executeCmd("sc queryex \"mule_ee\" "); if (muleResult.contains("RUNNING")) { return getId(muleResult); } else if (muleEEResult.contains("RUNNING")) { return getId(muleEEResult); } else { throw new MuleControllerException("No mule instance is running"); } } WindowsController(String muleHome, int timeout); @Override String getMuleBin(); @Override void start(String... args); @Override int stop(String... args); @Override int getProcessId(); @Override int status(String... args); @Override void restart(String... args); }
WindowsController extends AbstractOSController { @Override public int getProcessId() { String muleResult = executeCmd("sc queryex \"mule\" "); String muleEEResult = executeCmd("sc queryex \"mule_ee\" "); if (muleResult.contains("RUNNING")) { return getId(muleResult); } else if (muleEEResult.contains("RUNNING")) { return getId(muleEEResult); } else { throw new MuleControllerException("No mule instance is running"); } } WindowsController(String muleHome, int timeout); @Override String getMuleBin(); @Override void start(String... args); @Override int stop(String... args); @Override int getProcessId(); @Override int status(String... args); @Override void restart(String... args);  }