@Test @SuppressWarnings("static-method") public void testControlConnectionAuto() throws Exception { WebConversation webConversation; webConversation = new WebConversation(); webConversation.setExceptionsThrownOnErrorStatus(false); WebRequest req = new GetMethodWebRequest("http: req.setParameter("auto", ""); WebResponse resp = webConversation.getResponse(req); assertEquals(STATUS_OK, resp.getResponseCode()); assertFalse(resp.getText().contains("Esigate Server Status")); assertTrue(StatusReader.getLong(resp.getText(), "Uptime") > 0); Double cpuLoad = StatusReader.getDouble(resp.getText(), "CPULoad"); if (cpuLoad != null) { assertTrue(cpuLoad > 0); } if (!StringUtils.containsIgnoreCase(System.getProperty("os.name"), "win")) { assertNotNull(cpuLoad); } assertEquals(0, StatusReader.getLong(resp.getText(), "Total Accesses").longValue()); assertEquals(0d, StatusReader.getDouble(resp.getText(), "ReqPerSec")); }
private static int getProperty(String prefix, String name, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(System.getProperty(prefix + name)); } catch (NumberFormatException e) { LOG.warn("Value for " + prefix + name + " must be an integer. Using default " + defaultValue); } return result; }
EsigateServer { private static int getProperty(String prefix, String name, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(System.getProperty(prefix + name)); } catch (NumberFormatException e) { LOG.warn("Value for " + prefix + name + " must be an integer. Using default " + defaultValue); } return result; } }
EsigateServer { private static int getProperty(String prefix, String name, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(System.getProperty(prefix + name)); } catch (NumberFormatException e) { LOG.warn("Value for " + prefix + name + " must be an integer. Using default " + defaultValue); } return result; } private  EsigateServer(); }
EsigateServer { private static int getProperty(String prefix, String name, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(System.getProperty(prefix + name)); } catch (NumberFormatException e) { LOG.warn("Value for " + prefix + name + " must be an integer. Using default " + defaultValue); } return result; } private  EsigateServer(); static void init(); static void init(Properties configuration); static int getControlPort(); static void main(String[] args); static void start(); static boolean isStarted(); static void stop(); }
EsigateServer { private static int getProperty(String prefix, String name, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(System.getProperty(prefix + name)); } catch (NumberFormatException e) { LOG.warn("Value for " + prefix + name + " must be an integer. Using default " + defaultValue); } return result; } private  EsigateServer(); static void init(); static void init(Properties configuration); static int getControlPort(); static void main(String[] args); static void start(); static boolean isStarted(); static void stop();  }