List of usage examples for org.springframework.context.support AbstractRefreshableApplicationContext getBean
@Override public Object getBean(String name) throws BeansException
From source file:org.alfresco.repo.web.scripts.node.NodeWebScripTest.java
@Override protected void setUp() throws Exception { super.setUp(); AbstractRefreshableApplicationContext ctx = (AbstractRefreshableApplicationContext) getServer() .getApplicationContext();/*from w ww . j av a 2s . co m*/ this.retryingTransactionHelper = (RetryingTransactionHelper) ctx.getBean("retryingTransactionHelper"); this.authenticationService = (MutableAuthenticationService) ctx.getBean("AuthenticationService"); this.personService = (PersonService) ctx.getBean("PersonService"); this.siteService = (SiteService) ctx.getBean("SiteService"); this.nodeService = (NodeService) ctx.getBean("NodeService"); this.nodeArchiveService = (NodeArchiveService) ctx.getBean("nodeArchiveService"); // Do the setup as admin AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser(); // Create a site TEST_SITE = createSite(TEST_SITE_NAME); // Create two users, one who's a site member createUser(USER_ONE, true); createUser(USER_TWO, false); // Do our tests by default as the first user who is a contributor AuthenticationUtil.setFullyAuthenticatedUser(USER_ONE); }