コード例 #1
0
  @BeforeClass
  public static void initTestsContext() throws Exception {
    ApplicationContext testContext = APP_CONTEXT_INIT.getApplicationContext();

    PRIVATE_REMOTE_CREDENTIALS_SERVICE =
        (RemoteCredentialsService) testContext.getBean("remoteCredentialsService");
    REMOTE_CREDENTIALS_SERVICE =
        (RemoteCredentialsService) testContext.getBean("RemoteCredentialsService");

    AUTHENTICATION_SERVICE =
        (MutableAuthenticationService) testContext.getBean("authenticationService");
    BEHAVIOUR_FILTER = (BehaviourFilter) testContext.getBean("policyBehaviourFilter");
    DICTIONARY_SERVICE = (DictionaryService) testContext.getBean("dictionaryService");
    NAMESPACE_SERVICE = (NamespaceService) testContext.getBean("namespaceService");
    REPOSITORY_HELPER = (Repository) testContext.getBean("repositoryHelper");
    NODE_SERVICE = (NodeService) testContext.getBean("nodeService");
    PUBLIC_NODE_SERVICE = (NodeService) testContext.getBean("NodeService");
    PERSON_SERVICE = (PersonService) testContext.getBean("personService");
    TRANSACTION_HELPER =
        (RetryingTransactionHelper) testContext.getBean("retryingTransactionHelper");
    TRANSACTION_SERVICE = (TransactionService) testContext.getBean("TransactionService");
    PERMISSION_SERVICE = (PermissionService) testContext.getBean("permissionService");

    // Switch to a test shared system container
    RemoteCredentialsServiceImpl.setSharedCredentialsSystemContainerName(
        SHARED_SYSTEM_CONTAINER_NAME);
  }
コード例 #2
0
  private static void findServices() {
    ApplicationContext ctx = testContext.getApplicationContext();

    copyService = ctx.getBean("CopyService", CopyService.class);
    dictionaryService = ctx.getBean("dictionaryService", DictionaryService.class);
    nodeService = ctx.getBean("NodeService", NodeService.class);
    quickShareService = ctx.getBean("QuickShareService", QuickShareService.class);
    repository = ctx.getBean("repositoryHelper", Repository.class);
    attributeService = ctx.getBean("AttributeService", AttributeService.class);
    permissionService = ctx.getBean("PermissionService", PermissionService.class);
  }