public RemoteRegistry getRemoteRegistry (AutomationContext automationContext) throws Exception { RemoteRegistry registry = null; TestFrameworkUtils.setKeyStoreProperties(automationContext); System.setProperty("carbon.repo.write.mode", "true"); try { registry = new RemoteRegistry(new URL( UrlGenerationUtil.getRemoteRegistryURL(automationContext.getDefaultInstance())), automationContext.getContextTenant().getContextUser().getUserName(), automationContext.getContextTenant().getContextUser().getPassword()); } catch (Exception e) { handleException("Failed to initialized remote registry instance ", e); } return registry; }
@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(); }
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; }