BrooklynLauncher extends BasicLauncher<BrooklynLauncher> { public BrooklynLauncher restServer(boolean startWebApps) { this.startWebApps = startWebApps; return this; }  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 public void testStartsAppInstance() throws Exception { launcher = newLauncherForTests(true) .restServer(false) .application(EntitySpec.create(TestApplicationImpl.class)) .start(); assertOnlyApp(launcher, TestApplication.class); }
@Test public void testStartsAppFromSpec() throws Exception { launcher = newLauncherForTests(true) .restServer(false) .application(EntitySpec.create(TestApplication.class)) .start(); assertOnlyApp(launcher, TestApplication.class); }
@Test public void testStartsAppFromYAML() throws Exception { String yaml = "name: example-app\n" + "services:\n" + "- serviceType: org.apache.brooklyn.core.test.entity.TestEntity\n" + " name: test-app"; launcher = newLauncherForTests(true) .restServer(false) .application(yaml) .start(); assertEquals(launcher.getApplications().size(), 1, "apps="+launcher.getApplications()); Application app = Iterables.getOnlyElement(launcher.getApplications()); assertEquals(app.getChildren().size(), 1, "children=" + app.getChildren()); assertTrue(Iterables.getOnlyElement(app.getChildren()) instanceof TestEntity); }
@Test public void testStartsAppInSuppliedLocations() throws Exception { launcher = newLauncherForTests(true) .restServer(false) .location("localhost") .application(EntitySpec.create(TestApplication.class)) .start(); Application app = Iterables.find(launcher.getApplications(), Predicates.instanceOf(TestApplication.class)); assertOnlyLocation(app, LocalhostMachineProvisioningLocation.class); }