@Test public void getProcessIdNoProcessRunningTest() throws Exception { expected.expect(MuleControllerException.class); expected.expectMessage("No mule instance is running"); doReturn(StringUtils.EMPTY).when(controllerSpy, EXECUTE_CMD_METHOD_NAME, DISPLAY_MULE_PROCESS_INFORMATION); doReturn(StringUtils.EMPTY).when(controllerSpy, EXECUTE_CMD_METHOD_NAME, DISPLAY_MULE_EE_PROCESS_INFORMATION); controllerSpy.getProcessId(); }
@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);  }