AthenzJettyContainer { static String getServerHostName() { String serverHostName = System.getProperty(AthenzConsts.ATHENZ_PROP_HOSTNAME); if (serverHostName == null || serverHostName.isEmpty()) { try { InetAddress localhost = java.net.InetAddress.getLocalHost(); serverHostName = localhost.getCanonicalHostName(); } catch (java.net.UnknownHostException e) { LOG.info("Unable to determine local hostname: " + e.getMessage()); serverHostName = "localhost"; } } return serverHostName; } AthenzJettyContainer(); static String getRootDir(); void addRequestLogHandler(); void addServletHandlers(String serverHostName); HttpConfiguration newHttpConfiguration(); void addHTTPConnectors(HttpConfiguration httpConfig, int httpPort, int httpsPort,
            int statusPort); void setBanner(String banner); void createServer(int maxThreads); static AthenzJettyContainer createJettyContainer(); void run(); void stop(); static void main(String [] args);  }
@Test public void testGetServerHostNamePropertySet() { System.setProperty(AthenzConsts.ATHENZ_PROP_HOSTNAME, "MyTestHost"); assertEquals(AthenzJettyContainer.getServerHostName(), "MyTestHost"); }
@Test public void testGetServerHostNameNoProperty() { assertNotNull(AthenzJettyContainer.getServerHostName()); }