private String getServerFullName(List<Server> servers, String partOfName) { for (Server srv : servers) { if (srv.getLabel().getName().contains(partOfName)) { return srv.getLabel().getName(); } } return null; }
protected void checkServerStatus() { ServersView serversView = new ServersView(); serversView.open(); Server server = serversView.getServer(getServerFullName(serversView.getServers(), SERVER_NAME)); assertTrue("Server has not been started!", server.getLabel().getState() == ServerState.STARTED); // assertTrue("Server has not been // synchronized!",server.getLabel().getPublishState() == // ServerPublishState.SYNCHRONIZED); }
private void unDeployModule(String moduleName, Server server) { log.info("UNDEPLOYING MODULE" + moduleName + " ON SERVER " + server.getLabel()); ServerModule serverModule = server.getModule(new RegexMatcher(".*" + moduleName + ".*")); serverModule.remove(); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); }