@Test public void getProcessIdFromMuleStatusTest() throws Exception { int processId = 10; setStatusToOutputStreamInController("Mule is running (" + processId + ")."); assertThat("Process id is not the expected", controllerSpy.getProcessIdFromStatus(), equalTo(processId)); }
protected int getProcessIdFromStatus() { Matcher matcher = STATUS_PATTERN.matcher(getOutputStream().toString()); if (matcher.find()) { return Integer.parseInt(matcher.group(2)); } else { throw new MuleControllerException("bin/mule status didn't return the expected pattern: " + STATUS); } }
UnixController extends AbstractOSController { protected int getProcessIdFromStatus() { Matcher matcher = STATUS_PATTERN.matcher(getOutputStream().toString()); if (matcher.find()) { return Integer.parseInt(matcher.group(2)); } else { throw new MuleControllerException("bin/mule status didn't return the expected pattern: " + STATUS); } } }
UnixController extends AbstractOSController { protected int getProcessIdFromStatus() { Matcher matcher = STATUS_PATTERN.matcher(getOutputStream().toString()); if (matcher.find()) { return Integer.parseInt(matcher.group(2)); } else { throw new MuleControllerException("bin/mule status didn't return the expected pattern: " + STATUS); } } UnixController(String muleHome, int timeout); }
UnixController extends AbstractOSController { protected int getProcessIdFromStatus() { Matcher matcher = STATUS_PATTERN.matcher(getOutputStream().toString()); if (matcher.find()) { return Integer.parseInt(matcher.group(2)); } else { throw new MuleControllerException("bin/mule status didn't return the expected pattern: " + STATUS); } } UnixController(String muleHome, int timeout); @Override String getMuleBin(); @Override int getProcessId(); @Override int status(String... args); }
UnixController extends AbstractOSController { protected int getProcessIdFromStatus() { Matcher matcher = STATUS_PATTERN.matcher(getOutputStream().toString()); if (matcher.find()) { return Integer.parseInt(matcher.group(2)); } else { throw new MuleControllerException("bin/mule status didn't return the expected pattern: " + STATUS); } } UnixController(String muleHome, int timeout); @Override String getMuleBin(); @Override int getProcessId(); @Override int status(String... args);  }