BrooklynLauncher extends BasicLauncher<BrooklynLauncher> { public BrooklynServerDetails getServerDetails() { if (!isStarted()) throw new IllegalStateException("Cannot retrieve server details until started"); return new BrooklynServerDetails(webServer, getManagementContext()); }  static BrooklynLauncher newInstance(); BrooklynServerDetails getServerDetails(); BrooklynLauncher restServer(boolean startWebApps); BrooklynLauncher installSecurityFilter(Boolean val); BrooklynLauncher restServerPort(int port); BrooklynLauncher restServerPort(String port); BrooklynLauncher restServerPort(PortRange port); BrooklynLauncher restServerHttps(Boolean useHttps); BrooklynLauncher bindAddress(InetAddress bindAddress); BrooklynLauncher publicAddress(InetAddress publicAddress); BrooklynLauncher webServerFlags(Map<String,?> webServerFlags); BrooklynLauncher webapp(String contextPath, String warUrl); BrooklynLauncher webapp(WebAppContextProvider contextProvider); BrooklynLauncher ignoreWebErrors(boolean ignoreWebErrors); BrooklynLauncher stopWhichAppsOnShutdown(StopWhichAppsOnShutdown stopWhich); BrooklynLauncher customizeManagement(Function<ManagementContext,Void> customizeManagement); BrooklynLauncher shutdownOnExit(boolean val); BrooklynLauncher shutdownHandler(ShutdownHandler shutdownHandler); void terminate(); BrooklynLauncher globalBrooklynPropertiesFile(String file); BrooklynLauncher localBrooklynPropertiesFile(String file); BrooklynLauncher brooklynPropertiesSupplier(Supplier<Map<?, ?>> brooklynPropertiesSupplier);  }
@Test(groups="Integration") public void testWebServerTempDirRespectsDataDirConfig() throws Exception { String dataDirName = ".brooklyn-foo"+Strings.makeRandomId(4); String dataDir = "~/"+dataDirName; launcher = newLauncherForTests(true) .brooklynProperties(BrooklynServerConfig.MGMT_BASE_DIR, dataDir) .start(); ManagementContext managementContext = launcher.getServerDetails().getManagementContext(); String expectedTempDir = Os.mergePaths(Os.home(), dataDirName, "planes", managementContext.getManagementNodeId(), "jetty"); File webappTempDir = launcher.getServerDetails().getWebServer().getWebappTempDir(); assertEquals(webappTempDir.getAbsolutePath(), expectedTempDir); }
@Test(groups="Integration") public void testStartsWebServerWithoutAuthentication() throws Exception { launcher = newLauncherForTests(true) .start(); String uri = launcher.getServerDetails().getWebServerUrl(); HttpToolResponse response = HttpTool.execAndConsume(HttpTool.httpClientBuilder().build(), new HttpGet(uri)); assertEquals(response.getResponseCode(), 200); }