protected String getSessionCookie(AutomationContext context) throws RemoteException, XPathExpressionException, LoginAuthenticationExceptionException { AuthenticatorClient authenticationAdminClient = new AuthenticatorClient(context.getContextUrls().getBackEndUrl()); String sessionCookie = authenticationAdminClient.login(automationContext.getSuperTenant(). getTenantAdmin().getUserName(), automationContext.getSuperTenant(). getTenantAdmin().getPassword(), automationContext.getDefaultInstance().getHosts().get("default")); return sessionCookie; }
@BeforeSuite(alwaysRun = true) public void initialize() throws XPathExpressionException, AxisFault { AutomationContext autoContext = new AutomationContext(); logViewerClient = new LogViewerClient(autoContext.getContextUrls().getBackEndUrl(), autoContext.getSuperTenant().getTenantAdmin().getUserName(), autoContext.getSuperTenant().getTenantAdmin().getPassword()); }
new ServerAdminClient( backendURL, automationContext.getSuperTenant().getTenantAdmin().getUserName(), automationContext.getSuperTenant().getTenantAdmin().getPassword());
User superUser = automationContext.getSuperTenant().getTenantAdmin(); ClientConnectionUtil.waitForLogin(backendURL, superUser); log.info("Server started successfully.");
ClientConnectionUtil.sendForcefulShutDownRequest( backendURL, automationContext.getSuperTenant().getContextUser().getUserName(), automationContext.getSuperTenant().getContextUser().getPassword()); } catch (AutomationFrameworkException e) { throw new AutomationFrameworkException("Get context failed", e);
public synchronized void restartGracefully() throws AutomationFrameworkException { try { int httpsPort = defaultHttpsPort + portOffset; //considering the port offset String backendURL = automationContext.getContextUrls().getSecureServiceUrl().replaceAll("(:\\d+)", ":" + httpsPort); User superUser = automationContext.getSuperTenant().getTenantAdmin(); ClientConnectionUtil.sendGraceFullRestartRequest(backendURL, superUser.getUserName() , superUser.getPassword()); } catch (XPathExpressionException e) { throw new AutomationFrameworkException("restart failed", e); } long time = System.currentTimeMillis() + DEFAULT_START_STOP_WAIT_MS; while (!inputStreamHandler.getOutput().contains(SERVER_SHUTDOWN_MESSAGE) && System.currentTimeMillis() < time) { // wait until server shutdown is completed } time = System.currentTimeMillis(); while (System.currentTimeMillis() < time + 5000) { //wait for port to close } try { ClientConnectionUtil.waitForPort( Integer.parseInt(automationContext.getInstance().getPorts().get("https")), automationContext.getInstance().getHosts().get("default")); ClientConnectionUtil.waitForLogin(automationContext); } catch (XPathExpressionException e) { throw new AutomationFrameworkException("Connection attempt to carbon server failed", e); } }
@BeforeClass(alwaysRun = true) public void init() throws XPathExpressionException, IOException, LoginAuthenticationExceptionException { AutomationContext automationContext = new AutomationContext(); ip = automationContext.getDefaultInstance().getHosts().get("default"); port = automationContext.getDefaultInstance().getPorts().get("https"); AuthenticatorClient authenticationAdminClient = new AuthenticatorClient(automationContext.getContextUrls().getBackEndUrl()); webappAdminStub = new WebappAdminStub(automationContext.getContextUrls().getBackEndUrl() + "WebappAdmin"); AuthenticateStubUtil.authenticateStub(authenticationAdminClient.login( automationContext.getSuperTenant(). getTenantAdmin().getUserName(), automationContext.getSuperTenant(). getTenantAdmin().getPassword(), automationContext.getDefaultInstance().getHosts().get("default")), webappAdminStub); result.setMatchKey("specsResult"); appList = getWebApplist(""); jaggeryAppList(); endpointList(); }