/** * Loads a previously not loaded workspace. * * If there's no logical workspace defined with the name it is added, if there's no physical workspace name by this name it is added. * * @deprecated since 4.5 - use {@link info.magnolia.repository.RepositoryManager#loadWorkspace(String, String)} directly. */ public static void loadWorkspace(String repositoryId, String workspaceName) throws RepositoryException { Components.getComponent(RepositoryManager.class).loadWorkspace(repositoryId, workspaceName); }
repositoryManager.loadWorkspace(repositoryName, workspace); } catch (RepositoryException e) {
@Before @Override public void setUp() throws Exception { super.setUp(); RepositoryManager repositoryManager = Components.getComponent(RepositoryManager.class); repositoryManager.loadWorkspace("magnolia", FavoriteStore.WORKSPACE_NAME); repositoryManager.getRepositoryProvider("magnolia").registerNodeTypes(new ByteArrayInputStream(FAVORITE_NODE_TYPES.getBytes())); session = MgnlContext.getJCRSession(FavoriteStore.WORKSPACE_NAME); MockContext ctx = (MockContext) MgnlContext.getInstance(); final User user = mock(User.class); when(user.getName()).thenReturn(TEST_USER); ctx.setUser(user); MgnlContext.setInstance(ctx); favoriteStore = new FavoriteStore(); favoritesManager = new FavoritesManagerImpl(favoriteStore); }
@Override @Before public void setUp() throws Exception { super.setUp(); final RepositoryManager repositoryManager = Components.getComponent(RepositoryManager.class); repositoryManager.loadWorkspace(REPOSITORY, WORKSPACE); repositoryManager.getRepositoryProvider(REPOSITORY).registerNodeTypes(getClass().getResourceAsStream(NODE_TYPES)); messageStore = new MessageStore(); error = createMessage("1", MessageType.ERROR); warning = createMessage("2", MessageType.WARNING); info = createMessage("3", MessageType.INFO); messageStore.saveMessage(USER, error); messageStore.saveMessage(USER, warning); messageStore.saveMessage(USER, info); }