Package javax.jcr

Examples of javax.jcr.Repository


    }

    protected Repository getOrCreateRepository(String dir, String xml)
            throws Exception {
        synchronized (REPOSITORY_INSTANCES) {
            Repository repo = REPOSITORY_INSTANCES.get(dir);
            if (repo == null) {
                repo = createRepository(dir, xml);
                Session session = repo.login(superuser);
                try {
                    TestContentLoader loader = new TestContentLoader();
                    loader.loadTestContent(session);
                } finally {
                    session.logout();
View Full Code Here


            ServletHolder holder =
                    new ServletHolder(new OakServlet(repository));
            context.addServlet(holder, path + "/*");

            final Repository jcrRepository = jcr.createRepository();

            ServletHolder webdav =
                    new ServletHolder(new SimpleWebdavServlet() {
                        @Override
                        public Repository getRepository() {
View Full Code Here

     * and
     * @throws Exception
     */
    public void setUp() throws Exception {
        super.setUp();
        Repository repo = helper.getRepository();
        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
            throw new NotExecutableException("SetValueLockExceptionTest "
                    + "not executable: Locking not supported");
        }
        else {
View Full Code Here

    /**
     * Tests whether importing a tree respects locking.
     */
    public void doTestLockException(boolean useWorkspace, boolean useHandler)
            throws Exception {
        Repository repository = session.getRepository();
        exportRepository(SKIPBINARY, RECURSE);
        if (isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
            //A LockException is thrown if a lock prevents the addition of the subtree.
            Node lNode = testRootNode.addNode(nodeName1);
            lNode.addMixin(mixLockable);
View Full Code Here

    }

    protected Repository getOrCreateRepository(String dir, String xml)
            throws Exception {
        synchronized (REPOSITORY_INSTANCES) {
            Repository repo = REPOSITORY_INSTANCES.get(dir);
            if (repo == null) {
                repo = createRepository(dir, xml);
                Session session = repo.login(superuser);
                try {
                    prepareTestContent(session);
                } finally {
                    session.logout();
                }
View Full Code Here

    }

    public void testGetAllNodeIds() throws Exception {
        Node root = testRootNode;
        Session session = root.getSession();
        Repository rep = session.getRepository();

        if (!(rep instanceof RepositoryImpl)) {
            log("Test skipped. Required repository class: "
                    + RepositoryImpl.class + " got: " + rep.getClass());
            return;
        }

        RepositoryImpl r = (RepositoryImpl) rep;
        RepositoryConfig conf = r.getConfig();
View Full Code Here

    private final RepositoryFactory factory = new RepositoryFactoryImpl();
    private final RepositoryService service = new RepositoryServiceImpl();

    public void testGetDefaultRepository() throws RepositoryException {
        try {
            Repository repo = factory.getRepository(null);
            assertNotNull(repo);
        } catch (RepositoryException e) {
            // repository on top of spi2davex can only be initialized if the
            // server is running. ok.
        }

        try {
            System.setProperty(org.apache.jackrabbit.client.spi2davex.RepositoryConfigImpl.REPOSITORY_SPI2DAVEX_URI, org.apache.jackrabbit.client.spi2davex.RepositoryConfigImpl.DEFAULT_URI);
            Repository repo = factory.getRepository(null);
            assertNotNull(repo);
        } catch (RepositoryException e) {
            // repository on top of spi2davex can only be initialized if the
            // server is running. ok.
        }
View Full Code Here

            public RepositoryService getRepositoryService() throws RepositoryException {
                return service;
            }
        };

        Repository repo = factory.getRepository(Collections.singletonMap(RepositoryFactoryImpl.REPOSITORY_CONFIG, config));
        assertNotNull(repo);
    }
View Full Code Here

        Map params = new HashMap();
        params.put(RepositoryFactoryImpl.REPOSITORY_CONFIG, config);

        for (int i = 0; i < lwprovider.size(); i++) {
            params.put(RepositoryConfigImpl.PARAM_LOG_WRITER_PROVIDER, lwprovider.get(i));
            Repository repo = factory.getRepository(params);
            assertNotNull(repo);
        }       
    }
View Full Code Here

            assertNotNull(repo);
        }       
    }

    public void testGetRepositoryUnknownParams() throws RepositoryException {
        Repository repo = factory.getRepository(Collections.EMPTY_MAP);
        assertNull(repo);
    }
View Full Code Here

TOP

Related Classes of javax.jcr.Repository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.