@Override protected BrooklynRestApiLauncher baseLauncher() { return super.baseLauncher() .forceUseOfDefaultCatalogWithJavaClassPath(true); }
public static void forceUseOfDefaultCatalogWithJavaClassPath(Server server) { ManagementContext mgmt = getManagementContextFromJettyServerAttributes(server); forceUseOfDefaultCatalogWithJavaClassPath(mgmt); }
/** due to the relative path search in {@link BrooklynRestApiLauncher} we can just call that method */ public static Server startJavascriptAndRest() throws Exception { return BrooklynRestApiLauncher.launcherServlet() .securityProvider(AnyoneSecurityProvider.class) .start(); }
@Test // doesn't work from IDE public void testWebAppStart() throws Exception { checkRestCatalogEntities(useServerForTest(baseLauncher().mode(WEB_XML).start())); }
@Test(groups = "Integration") public void testEntitiesExistOnHotStandbyAndPromotion() throws Exception { initHaCluster(HighAvailabilityMode.AUTO, HighAvailabilityMode.HOT_STANDBY); assertEntityExists(new ReturnCodeNotRetry()); stopWriteNode(); // once the node claims master we should get a 200 assertEntityExists(new ReturnCodeNotRetryAndNodeIsMaster()); assertReadIsMaster(); }
@Test(groups = "Integration") public void testEntitiesExistOnMasterPromotion() throws Exception { initHaCluster(HighAvailabilityMode.AUTO, HighAvailabilityMode.AUTO); assertEquals(getAppResponseCode(), 403); stopWriteNode(); assertEntityExists(new ReturnCodeNotRetryAndNodeIsMaster()); assertReadIsMaster(); }
public static Server startRestResourcesViaServlet() throws Exception { return launcherServlet().start(); }
protected BrooklynRestApiLauncher baseLauncher() { return BrooklynRestApiLauncher.launcher() .securityProvider(AnyoneSecurityProvider.class); }
protected Server newServer() { try { Server server = baseLauncher() .forceUseOfDefaultCatalogWithJavaClassPath(true) .start(); return server; } catch (Exception e) { throw Exceptions.propagate(e); } }
public static Server startRestResourcesViaWebXml() throws Exception { return launcherWebXml().start(); }
@Test(groups = "Integration") public void testEntitiesExistOnDisabledHA() throws Exception { initHaCluster(HighAvailabilityMode.DISABLED, HighAvailabilityMode.DISABLED); assertReadIsMaster(); assertEntityExists(new ReturnCodeNotRetry()); }
public static void enableAnyoneLogin(Server server) { ManagementContext mgmt = getManagementContextFromJettyServerAttributes(server); enableAnyoneLogin(mgmt); }
public static BrooklynRestApiLauncher launcherServlet() { return new BrooklynRestApiLauncher().mode(StartMode.SERVLET); }
@Override protected BrooklynRestApiLauncher baseLauncher() { return BrooklynRestApiLauncher.launcher(); }
/** returns REST endpoint, with trailing slash */ public static String getBaseUriRest(Server server) { return getBaseUriHostAndPost(server)+"/v1/"; }
protected String getBaseUriRest() { return getBaseUriRest(server); } /** returns REST endpoint, with trailing slash */
public static BrooklynRestApiLauncher launcher() { return new BrooklynRestApiLauncher(); }
public void assertAcAllowOrigin(HttpToolResponse response, String shouldAllowOrigin, String method) { assertAcAllowOrigin(response, shouldAllowOrigin, method, true); }
@Test public void testServletStart() throws Exception { checkRestCatalogEntities(useServerForTest(baseLauncher().mode(SERVLET).start())); }
protected String getBaseUriHostAndPost() { return getBaseUriHostAndPost(server); } /** returns base of server, without trailing slash - e.g. <code>http://localhost:8081</code> */