Esempio n. 1
0
  @BeforeClass(groups = "wso2.greg", alwaysRun = true)
  public void initialize()
      throws RemoteException, LoginAuthenticationExceptionException,
          org.wso2.carbon.registry.api.RegistryException {
    int userId = 2;

    RegistryProviderUtil provider = new RegistryProviderUtil();
    WSRegistryServiceClient wsRegistry =
        provider.getWSRegistry(userId, ProductConstant.GREG_SERVER_NAME);
    governanceRegistry = provider.getGovernanceRegistry(wsRegistry, userId);
  }
  /**
   * @throws RemoteException
   * @throws LoginAuthenticationExceptionException
   * @throws RegistryException
   */
  @BeforeClass(alwaysRun = true)
  public void init()
      throws RemoteException, LoginAuthenticationExceptionException, RegistryException {
    EnvironmentBuilder builder = new EnvironmentBuilder().greg(userId);
    ManageEnvironment environment = builder.build();

    lifeCycleAdminServiceClient =
        new LifeCycleAdminServiceClient(
            environment.getGreg().getProductVariables().getBackendUrl(),
            environment.getGreg().getSessionCookie());
    governanceServiceClient =
        new GovernanceServiceClient(
            environment.getGreg().getProductVariables().getBackendUrl(),
            environment.getGreg().getSessionCookie());
    listMetadataServiceClient =
        new ListMetaDataServiceClient(
            environment.getGreg().getProductVariables().getBackendUrl(),
            environment.getGreg().getSessionCookie());
    lifeCycleManagementClient =
        new LifeCycleManagementClient(
            environment.getGreg().getProductVariables().getBackendUrl(),
            environment.getGreg().getSessionCookie());
    userManagementClient =
        new UserManagementClient(
            environment.getGreg().getProductVariables().getBackendUrl(),
            environment.getGreg().getSessionCookie());
    resourceAdminServiceClient =
        new ResourceAdminServiceClient(
            environment.getGreg().getProductVariables().getBackendUrl(),
            environment.getGreg().getSessionCookie());
    wsRegistryServiceClient =
        registryProviderUtil.getWSRegistry(userId, ProductConstant.GREG_SERVER_NAME);

    Registry reg =
        registryProviderUtil.getGovernanceRegistry(
            new RegistryProviderUtil().getWSRegistry(userId, ProductConstant.GREG_SERVER_NAME),
            userId);
    GovernanceUtils.loadGovernanceArtifacts((UserRegistry) reg);
    serviceManager = new ServiceManager(reg);
  }