@Test public void testCheckSameState(){ assertTrue(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_REACHABLE.toStateLabel())); assertTrue(cut.checkSameState(WebServerControlOperation.STOP, WebServerReachableState.WS_UNREACHABLE.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_UNREACHABLE.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.STOP, WebServerReachableState.WS_REACHABLE.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_NEW.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_UNEXPECTED_STATE.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_START_SENT.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_STOP_SENT.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.WS_FAILED.toStateLabel())); assertFalse(cut.checkSameState(WebServerControlOperation.START, WebServerReachableState.FORCED_STOPPED.toStateLabel())); }
public boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel) { return webServerControlOperation.START.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_REACHABLE.toStateLabel()) || webServerControlOperation.STOP.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_UNREACHABLE.toStateLabel()); }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { public boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel) { return webServerControlOperation.START.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_REACHABLE.toStateLabel()) || webServerControlOperation.STOP.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_UNREACHABLE.toStateLabel()); } }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { public boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel) { return webServerControlOperation.START.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_REACHABLE.toStateLabel()) || webServerControlOperation.STOP.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_UNREACHABLE.toStateLabel()); } GroupWebServerControlServiceImpl(final GroupService theGroupService, WebServerControlService theWebServerControlService); }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { public boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel) { return webServerControlOperation.START.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_REACHABLE.toStateLabel()) || webServerControlOperation.STOP.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_UNREACHABLE.toStateLabel()); } GroupWebServerControlServiceImpl(final GroupService theGroupService, WebServerControlService theWebServerControlService); @Transactional @Override void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser); @Override void controlAllWebSevers(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User user); boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel); }
GroupWebServerControlServiceImpl implements GroupWebServerControlService { public boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel) { return webServerControlOperation.START.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_REACHABLE.toStateLabel()) || webServerControlOperation.STOP.toString().equals(webServerControlOperation.name()) && webServerStateLabel.equalsIgnoreCase(WebServerReachableState.WS_UNREACHABLE.toStateLabel()); } GroupWebServerControlServiceImpl(final GroupService theGroupService, WebServerControlService theWebServerControlService); @Transactional @Override void controlGroup(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User aUser); @Override void controlAllWebSevers(final ControlGroupWebServerRequest controlGroupWebServerRequest, final User user); boolean checkSameState(final WebServerControlOperation webServerControlOperation, final String webServerStateLabel);  }